载具出入库优化、大屏添加配方、批次字段

This commit is contained in:
ldj_willow
2022-10-21 14:24:09 +08:00
parent 200a203e4b
commit b13579810f
15 changed files with 206 additions and 323 deletions

View File

@@ -1,18 +0,0 @@
package org.nl.modules.es.config;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ElasticsearchClientConfig {
@Bean
public RestHighLevelClient restHighLevelClient() {
RestHighLevelClient client = new RestHighLevelClient(
RestClient.builder(
new HttpHost("192.168.81.155", 9200, "http")));
return client;
}
}

View File

@@ -1,32 +0,0 @@
package org.nl.modules.es.rest;
import org.nl.modules.es.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
public class ContentController {
@Autowired
private ContentService contentService;
@GetMapping("/parse/{keyword}")
public Boolean parse(@PathVariable("keyword") String keyword) throws
Exception {
return contentService.parseContent(keyword);
}
//http://localhost:9090/search/java/1/10
@GetMapping("/search/{keyword}/{pageNo}/{pageSize}")
public List<Map<String, Object>> search(@PathVariable("keyword") String
keyword,
@PathVariable("pageNo") int pageNo,
@PathVariable("pageSize") int pageSize) throws
Exception {
return contentService.searchContentPage(keyword, pageNo, pageSize);
}
}

View File

@@ -1,99 +0,0 @@
package org.nl.modules.es.service;
import cn.hutool.core.util.IdUtil;
import net.sf.json.JSONObject;
import org.apache.http.HttpHost;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.TermQueryBuilder;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.builder.SearchSourceBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.web.ResourceProperties;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@Service
public class ContentService {
@Autowired
private RestHighLevelClient restHighLevelClient;
// 1、解析数据存入es
public Boolean parseContent(String keywords) throws Exception {
// 解析查询出来的数据
// List<ResourceProperties.Content> contents = new HtmlParseUtil().parseJD(keywords);
List<ResourceProperties.Content> contents = null;
// 封装数据到索引库中!
BulkRequest bulkRequest = new BulkRequest();
bulkRequest.timeout(TimeValue.timeValueMinutes(2));
bulkRequest.timeout("2m");
JSONObject json=new JSONObject();
json.put("id", IdUtil.simpleUUID());
json.put("name","123");
/* for (int i = 0; i < contents.size(); i++) {
bulkRequest
.add(new IndexRequest("jd_goods")
.source(json, XContentType.JSON));
}*/
bulkRequest
.add(new IndexRequest("jd_goods")
.source(json, XContentType.JSON));
RestHighLevelClient restHighLevelClient = new RestHighLevelClient(
RestClient.builder(
new HttpHost("192.168.81.155", 9200, "http")));
BulkResponse bulkResponse =
restHighLevelClient.bulk(bulkRequest, RequestOptions.DEFAULT);
return !bulkResponse.hasFailures();
}
// 2、实现搜索功能带分页处理
public List<Map<String, Object>> searchContentPage(String keyword, int
pageNo, int pageSize) throws IOException {
// 基本的参数判断!
if (pageNo <= 1) {
pageNo = 1;
}
// 基本的条件搜索
SearchRequest searchRequest = new SearchRequest("jd_goods");
SearchSourceBuilder sourceBuilder = new SearchSourceBuilder();
// 分页
sourceBuilder.from(pageNo);
sourceBuilder.size(pageSize);
// 精准匹配 QueryBuilders 根据自己要求配置查询条件即可!
TermQueryBuilder termQueryBuilder = QueryBuilders.termQuery("title",
keyword);
sourceBuilder.query(termQueryBuilder);
sourceBuilder.timeout(new TimeValue(60, TimeUnit.SECONDS));
// 搜索
searchRequest.source(sourceBuilder);
RestHighLevelClient restHighLevelClient = new RestHighLevelClient(
RestClient.builder(
new HttpHost("192.168.81.155", 9200, "http")));
SearchResponse response = restHighLevelClient.search(searchRequest,
RequestOptions.DEFAULT);
// 解析结果!
List<Map<String, Object>> list = new ArrayList<>();
for (SearchHit documentFields : response.getHits().getHits()) {
list.add(documentFields.getSourceAsMap());
}
return list;
}
}

View File

@@ -12,7 +12,6 @@ import org.nl.modules.system.service.dto.UserDto;
import org.nl.utils.RsaUtils;
import org.nl.wms.ext.dp.service.BigScreenService;
import org.nl.wql.WQL;
import org.springframework.http.HttpStatus;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
@@ -190,6 +189,8 @@ public class BigScreenServiceImpl implements BigScreenService {
JSONObject outjo = allrows.getJSONObject(i);
String out_material_code = outjo.optString("label_code");
if (out_material_code.equals(label_code)) {
materijo.put("formula", outjo.optString("formula"));
materijo.put("pcsn", outjo.optString("pcsn"));
materijo.put("label_code", outjo.optString("label_code"));
materijo.put("sewting_quantity", outjo.optString("sewting_quantity"));
}
@@ -198,6 +199,8 @@ public class BigScreenServiceImpl implements BigScreenService {
JSONObject injo = allrows2.getJSONObject(i);
String in_material_code = injo.optString("label_code");
if (in_material_code.equals(label_code)) {
materijo.put("formula", injo.optString("formula"));
materijo.put("pcsn", injo.optString("pcsn"));
materijo.put("label_code", injo.optString("label_code"));
materijo.put("finished_quantity", injo.optString("finished_quantity"));
}
@@ -220,6 +223,8 @@ public class BigScreenServiceImpl implements BigScreenService {
String material_code = label_code.substring(label_code.length() - 4);
resultrow.put("material_name", material_name);
resultrow.put("material_code", material_code);
resultrow.put("pcsn", resultrow.optString("pcsn"));
resultrow.put("formula", resultrow.optString("formula"));
rows.add(resultrow);
}
@@ -335,6 +340,8 @@ public class BigScreenServiceImpl implements BigScreenService {
String material_code = flag;
jo.put("material_name", material_name);
jo.put("material_code", material_code);
jo.put("formula", jo.optString("formula"));
jo.put("pcsn", jo.optString("pcsn"));
rows.add(jo);
}
return rows;

View File

@@ -43,7 +43,9 @@
QUERY
SELECT
task.create_time,
materi.material_name AS processmaterial_name,
labelmst.material_name AS processmaterial_name,
labelmst.pcsn,
labelmst.formula,
"入库" AS business_type_name,
"1" AS business_type,
round ( dis.realassign_qty, 0 ) AS quantity,
@@ -52,14 +54,17 @@
sch_base_task task
LEFT JOIN sch_base_point point ON task.next_point_code = point.point_code
LEFT JOIN st_buss_iostoredis dis ON dis.task_uuid = task.task_uuid
LEFT JOIN md_base_material materi ON dis.material_uuid = materi.material_uuid
LEFT JOIN md_base_materiallabelmst labelmst ON labelmst.label_uuid = dis.label_uuid
WHERE
task.task_type = '01'
AND point.area_type IN ( '01', '02' )
AND task.task_status IN ( '04', '05' ) UNION
AND task.task_status IN ( '04', '05' )
UNION
SELECT
task.create_time,
labelmst.material_name AS processmaterial_name,
labelmst.pcsn,
formula,
"转储" AS business_type_name,
"1" AS business_type,
"1" AS quantity,
@@ -162,25 +167,26 @@ IF 输入.flag = "3"
SELECT
material.material_name,
material.material_code,
material.pcsn,
material.formula,
point.point_code AS struct_code,
ivt.label_code,
CASE
WHEN point.is_active = '0' THEN
'2'
WHEN TIMESTAMPDIFF( HOUR, ivt.instorage_time, now() ) < ivt.stand_hour THEN
'1'
WHEN TIMESTAMPDIFF( HOUR, ivt.instorage_time, now() ) >= ivt.stand_hour THEN
WHEN TIMESTAMPDIFF( HOUR, ivt.instorage_time, now() ) < ivt.stand_hour THEN '1' WHEN TIMESTAMPDIFF( HOUR, ivt.instorage_time, now() ) >= ivt.stand_hour THEN
'3' ELSE '5'
END AS struct_type,
point.vehicle_code AS storagevehicle_code,
round (ivt.canuse_qty,0) as quantity,
round ( ivt.canuse_qty, 0 ) AS quantity,
"" AS pcsn,
'在库' AS STATUS,
ivt.instorage_time,
TIMESTAMPDIFF( HOUR, ivt.instorage_time, now() ) AS standing_time,
ivt.stand_hour,
CASE
WHEN TIMESTAMPDIFF( HOUR, ivt.instorage_time, now() ) > ivt.stand_hour THEN
'静置完成'
WHEN TIMESTAMPDIFF( HOUR, ivt.instorage_time, now() ) < ivt.stand_hour THEN
@@ -189,64 +195,69 @@ IF 输入.flag = "3"
FROM
sch_base_point point
LEFT JOIN st_ivt_structivt ivt ON ivt.struct_uuid = point.point_uuid
LEFT JOIN md_base_material material ON material.material_uuid = ivt.material_uuid
LEFT JOIN md_base_materialLabelMst material ON material.label_uuid = ivt.label_uuid
WHERE
point.area_type IN ( '01', '02' )
point.area_type IN ('01','02' )
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "6"
QUERY
SELECT
task.create_time,
labelmst.material_name AS processmaterial_name,
"出库" AS business_type_name,
"2" AS business_type,
round ( dis.realassign_qty, 0 ) AS quantity,
"" AS base_unit_uuid_name
FROM
sch_base_task task
LEFT JOIN sch_base_point point ON task.start_point_code = point.point_code
LEFT JOIN st_buss_iostoredis dis ON dis.task_uuid = task.task_uuid
LEFT JOIN md_base_materiallabelmst labelmst ON labelmst.label_uuid = dis.label_uuid
WHERE
task.task_type = '02'
AND point.area_type IN ( '03' )
AND task.task_status IN ( '04', '05' ) UNION
SELECT
task.create_time,
labelmst.material_name AS processmaterial_name,
"转储" AS business_type_name,
"1" AS business_type,
"1" AS quantity,
"托" AS base_unit_uuid_name
FROM
sch_base_task task
LEFT JOIN sch_base_point point ON task.next_point_code = point.point_code
LEFT JOIN st_buss_dumpinv dump ON dump.task_uuid = task.task_uuid
LEFT JOIN md_base_materiallabelmst labelmst ON labelmst.label_uuid = dump.label_uuid
WHERE
task.task_type = '05'
AND point.area_type IN ( '03' )
AND task.task_status IN ( '04', '05' ) UNION
SELECT
task.create_time,
"" AS processmaterial_name,
"余料回库" AS business_type_name,
"1" AS business_type,
"1" AS quantity,
"" AS base_unit_uuid_name
FROM
sch_base_task task
LEFT JOIN sch_base_point point ON task.next_point_code = point.point_code
WHERE
task.task_type = '07'
AND point.area_type IN ( '03' )
AND task.task_status IN ( '04', '05' )
ORDER BY
create_time DESC
SELECT
task.create_time,
labelmst.material_name AS processmaterial_name,
labelmst.pcsn,
labelmst.formula,
"出库" AS business_type_name,
"2" AS business_type,
round ( dis.realassign_qty, 0 ) AS quantity,
"托" AS base_unit_uuid_name
FROM
sch_base_task task
LEFT JOIN sch_base_point point ON task.start_point_code = point.point_code
LEFT JOIN st_buss_iostoredis dis ON dis.task_uuid = task.task_uuid
LEFT JOIN md_base_materiallabelmst labelmst ON labelmst.label_uuid = dis.label_uuid
WHERE
task.task_type = '02'
AND point.area_type IN ( '03' )
AND task.task_status IN ( '04', '05' ) UNION
SELECT
task.create_time,
labelmst.material_name AS processmaterial_name,
labelmst.pcsn,
labelmst.formula,
"转储" AS business_type_name,
"1" AS business_type,
"1" AS quantity,
"托" AS base_unit_uuid_name
FROM
sch_base_task task
LEFT JOIN sch_base_point point ON task.next_point_code = point.point_code
LEFT JOIN st_buss_dumpinv dump ON dump.task_uuid = task.task_uuid
LEFT JOIN md_base_materiallabelmst labelmst ON labelmst.label_uuid = dump.label_uuid
WHERE
task.task_type = '05'
AND point.area_type IN ( '03' )
AND task.task_status IN ( '04', '05' ) UNION
SELECT
task.create_time,
"" AS processmaterial_name,
"" AS pcsn,
"" AS formula,
"余料回库" AS business_type_name,
"1" AS business_type,
"1" AS quantity,
"托" AS base_unit_uuid_name
FROM
sch_base_task task
LEFT JOIN sch_base_point point ON task.next_point_code = point.point_code
WHERE
task.task_type = '07'
AND point.area_type IN ( '03' )
AND task.task_status IN ( '04', '05' )
ORDER BY
create_time DESC
ENDSELECT
ENDQUERY
ENDIF
@@ -311,14 +322,18 @@ IF 输入.flag = "8"
QUERY
SELECT
max( ivt.label_code ) AS label_code,
round( sum( ivt.canuse_qty ), 0 ) AS total_quantity
round( sum( ivt.canuse_qty ), 0 ) AS total_quantity,
mst.formula,
mst.pcsn
FROM
st_ivt_structivt ivt
LEFT JOIN sch_base_point point ON point.point_uuid = ivt.struct_uuid
LEFT JOIN md_base_materialLabelMst mst ON ivt.label_uuid = ivt.label_uuid
WHERE
point.area_type IN ( 03 )
GROUP BY
ivt.label_code
mst.formula,
mst.pcsn ,ivt.label_code
ENDSELECT
ENDQUERY
ENDIF
@@ -326,30 +341,32 @@ IF 输入.flag = "8"
IF 输入.flag = "10"
QUERY
SELECT
material.material_name,
material.material_code,
point.point_code AS struct_code,
ivt.label_code,
CASE
material.material_name,
material.material_code,
material.pcsn,
material.formula,
point.point_code AS struct_code,
ivt.label_code,
CASE
WHEN point.point_status = '01' THEN
'2'
WHEN ( point.point_status = '02' ) THEN
'1'
WHEN ( point.is_active = '0' ) THEN
'3' ELSE '4'
END AS struct_type,
point.vehicle_code AS storagevehicle_code,
round(ivt.canuse_qty ,0)as quantity,
"" AS pcsn,
ivt.instorage_time,
"" as status_name
FROM
sch_base_point point
LEFT JOIN st_ivt_structivt ivt ON ivt.struct_uuid = point.point_uuid
LEFT JOIN md_base_material material ON material.material_uuid = ivt.material_uuid
WHERE
point.area_type IN ( '03' )
WHEN point.point_status = '01' THEN
'2'
WHEN ( point.point_status = '02' ) THEN
'1'
WHEN ( point.is_active = '0' ) THEN
'3' ELSE '4'
END AS struct_type,
point.vehicle_code AS storagevehicle_code,
round( ivt.canuse_qty, 0 ) AS quantity,
"" AS pcsn,
ivt.instorage_time,
"" AS status_name
FROM
sch_base_point point
LEFT JOIN st_ivt_structivt ivt ON ivt.struct_uuid = point.point_uuid
LEFT JOIN md_base_materialLabelMst material ON material.label_uuid = ivt.label_uuid
WHERE
point.area_type IN ('03' )
ENDSELECT
ENDQUERY
ENDIF
@@ -359,15 +376,18 @@ IF 输入.flag = "8"
QUERY
SELECT
round ( sum( ivt.canuse_qty ), 0 ) AS sewting_quantity,
ivt.label_code
ivt.label_code,
mst.formula,
mst.pcsn
FROM
st_ivt_structivt ivt
LEFT JOIN sch_base_point point ON point.point_uuid = ivt.struct_uuid
LEFT JOIN md_base_materialLabelMst mst ON ivt.label_uuid = ivt.label_uuid
WHERE
TIMESTAMPDIFF( HOUR, ivt.instorage_time, now( ) ) < ivt.stand_hour
AND point.area_type IN ( '01', '02' )
GROUP BY
ivt.label_code
mst.formula, mst.pcsn,ivt.label_code
ENDSELECT
ENDQUERY
ENDIF
@@ -376,15 +396,18 @@ IF 输入.flag = "8"
QUERY
SELECT
round ( sum( ivt.canuse_qty ), 0 ) AS finished_quantity,
ivt.label_code
ivt.label_code,
mst.formula,
mst.pcsn
FROM
st_ivt_structivt ivt
LEFT JOIN sch_base_point point ON point.point_uuid = ivt.struct_uuid
LEFT JOIN md_base_materialLabelMst mst ON ivt.label_uuid = ivt.label_uuid
WHERE
TIMESTAMPDIFF( HOUR, ivt.instorage_time, now( ) ) >= ivt.stand_hour
AND point.area_type IN ( '01', '02' )
GROUP BY
ivt.label_code
mst.formula,mst.pcsn,ivt.label_code
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -203,5 +203,12 @@ public class ProduceTaskController {
produceTaskService.forceFinish(JSONObject.fromObject(map));
return new ResponseEntity<>(HttpStatus.OK);
}
@ApiOperation("根据排程查询库存")
@PostMapping("/queryIvtByPscn")
//@PreAuthorize("@el.check('storage:add')")
public ResponseEntity<Object> queryIvtByPscn(@RequestBody Map map) {
String result=produceTaskService.queryIvtByPscn(JSONObject.fromObject(map));
return new ResponseEntity<>(result,HttpStatus.OK);
}
}

View File

@@ -166,5 +166,11 @@ public interface ProduceTaskService {
*/
void forceFinish(JSONObject row);
/**
* 根据批次查询库存数
* @param data
*/
String queryIvtByPscn(JSONObject data);
}

View File

@@ -559,4 +559,22 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
taskObj.put("update_time", now);
taskTab.update(taskObj);
}
@Override
public String queryIvtByPscn(JSONObject data) {
String formula = data.getString("formula");
String pcsn = data.getString("pcsn");
//物料标签主表【md_base_materialLabelMst】
JSONObject labelObj = WQLObject.getWQLObject("md_base_materialLabelMst").query("formula = '" + formula + "' and pcsn = '" + pcsn + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(labelObj)) return "0";
//标签标识
String label_uuid = labelObj.getString("label_uuid");
HashMap param = new HashMap();
param.put("flag","1");
param.put("label_uuid",label_uuid);
JSONObject jsonObject = WQL.getWO("QPDM_PRODUCETASK_005").addParamMap(param).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject))return jsonObject.getString("ivt_qty");
return "0";
}
}

View File

@@ -3,6 +3,7 @@ package org.nl.wms.sch.tasks;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@@ -14,8 +15,6 @@ import org.nl.wms.st.core.enu.EmptyVehicleBillStatusEnum;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import java.util.List;
/**
* 入空载具
*/
@@ -87,8 +86,15 @@ public class InEmptyVehicleTask extends AbstractAcsTask {
JSONArray taskArry = taskTab.query("task_type='" + TaskTypeEnum.IN_EMPTY_VEHICLE_TASK.getCode() + "' AND task_status='" + TaskStatusEnum.SURE_START.getCode() + "' AND is_active='1' AND is_delete='0'").getResultJSONArray(0);
for (int i = 0; i < taskArry.size(); i++) {
JSONObject jsonTask = taskArry.getJSONObject(i);
//空卷轴存储区找
JSONObject jsonPoint = WQL.getWO("QSCH_EMPTYVEHICLE01").addParam("flag", "3").addParam("area_type", "04").process().uniqueResult(0);
//空卷轴存储区找不到可以使用的位置去 恒温存储区(空载具只能去2层以上)
if (ObjectUtil.isEmpty(jsonPoint))
jsonPoint = WQL.getWO("QSCH_EMPTYVEHICLE01").addParam("flag", "4").process().uniqueResult(0);
// 均找不到
if (MapUtil.isEmpty(jsonPoint)) continue;
String next_point_code = jsonPoint.optString("point_code");
jsonTask.put("next_point_code", next_point_code);
jsonTask.put("update_by", SecurityUtils.getCurrentUsername());
@@ -143,8 +149,8 @@ public class InEmptyVehicleTask extends AbstractAcsTask {
jsonTask.put("update_time", DateUtil.now());
taskTab.insert(jsonTask);
//锁定点位
JSONObject jsonPoint= WQLObject.getWQLObject("sch_base_point").query("point_code='" + start_point_code + "'").uniqueResult(0);
jsonPoint.put("lock_type","01");
JSONObject jsonPoint = WQLObject.getWQLObject("sch_base_point").query("point_code='" + start_point_code + "'").uniqueResult(0);
jsonPoint.put("lock_type", "01");
WQLObject.getWQLObject("sch_base_point").update(jsonPoint);
return jsonTask.optString("task_uuid");
}

View File

@@ -1,7 +1,6 @@
package org.nl.wms.sch.tasks;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@@ -18,8 +17,6 @@ import org.nl.wms.st.core.enu.EmptyVehicleBillStatusEnum;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import java.util.List;
/**
* 出空载具
*/
@@ -88,10 +85,14 @@ public class OutEmptyVehicleTask extends AbstractAcsTask {
JSONArray taskArry = taskTab.query("task_type='" + TaskTypeEnum.OUT_EMPTY_VEHICLE_TASK.getCode() + "' AND task_status='" + TaskStatusEnum.SURE_END.getCode() + "' AND is_active='1' AND is_delete='0'").getResultJSONArray(0);
for (int i = 0; i < taskArry.size(); i++) {
JSONObject jsonTask = taskArry.getJSONObject(i);
JSONObject jsonPoint = WQL.getWO("QSCH_EMPTYVEHICLE01").addParam("flag", "2").addParam("area_type", "04").process().uniqueResult(0);
//优先出恒温存储区 空托盘
JSONObject jsonPoint = WQL.getWO("QSCH_EMPTYVEHICLE01").addParam("flag", "2").addParam("area_type", "03").process().uniqueResult(0);
//再空卷轴存储区 出空托盘
if (ObjectUtil.isEmpty(jsonPoint)) {
continue;
jsonPoint = WQL.getWO("QSCH_EMPTYVEHICLE01").addParam("flag", "2").addParam("area_type", "04").process().uniqueResult(0);
}
if (ObjectUtil.isEmpty(jsonPoint))continue;
String start_point_code = jsonPoint.optString("point_code");
jsonTask.put("start_point_code", start_point_code);

View File

@@ -104,3 +104,21 @@
ENDQUERY
ENDIF
IF 输入.flag = "4"
QUERY
SELECT
point.point_uuid,
point_code,
vehicle_code
FROM
sch_base_point point
WHERE
point.lock_type = '00'
AND point.is_active = '1'
AND point.point_status = '00'
AND is_delete = '0'
AND area_type = '03'
AND SUBSTRING( point_code,- 1 )>1
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -1,51 +0,0 @@
package es;
import cn.hutool.core.util.IdUtil;
import net.sf.json.JSONObject;
import org.apache.http.HttpHost;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentType;
import org.springframework.boot.autoconfigure.web.ResourceProperties;
import java.io.IOException;
import java.util.List;
public class Test {
public static void main(String[] args) throws IOException {
// 解析查询出来的数据
// List<ResourceProperties.Content> contents = new HtmlParseUtil().parseJD(keywords);
List<ResourceProperties.Content> contents = null;
// 封装数据到索引库中!
BulkRequest bulkRequest = new BulkRequest();
bulkRequest.timeout(TimeValue.timeValueMinutes(2));
bulkRequest.timeout("2m");
JSONObject json = new JSONObject();
json.put("id", IdUtil.simpleUUID());
json.put("name", "123");
/* for (int i = 0; i < contents.size(); i++) {
bulkRequest
.add(new IndexRequest("jd_goods")
.source(json, XContentType.JSON));
}*/
bulkRequest
.add(new IndexRequest("jd_goods")
.source(json, XContentType.JSON));
RestHighLevelClient restHighLevelClient = new RestHighLevelClient(
RestClient.builder(
new HttpHost("192.168.81.155", 9200, "http")));
BulkResponse bulkResponse =
restHighLevelClient.bulk(bulkRequest, RequestOptions.DEFAULT);
boolean b = bulkResponse.hasFailures();
System.out.println(b);
}
}