rev:型材出库修改/加锁;日志清除

This commit is contained in:
zhangzhiqiang
2023-10-12 17:15:23 +08:00
parent 1dd594a843
commit 6907f62d6b
6 changed files with 89 additions and 86 deletions

View File

@@ -68,7 +68,6 @@ public class EsLogServiceImpl implements EsLogService {
page.setPage(logQuery.getPage()); page.setPage(logQuery.getPage());
page.setPageSize(logQuery.getSize()); page.setPageSize(logQuery.getSize());
res.put("total",page.getTotal()); res.put("total",page.getTotal());
this.clearLogs(logQuery);
} }
res.put("page",page); res.put("page",page);
return res; return res;
@@ -86,9 +85,6 @@ public class EsLogServiceImpl implements EsLogService {
if (!StringUtils.isEmpty(system)){ if (!StringUtils.isEmpty(system)){
query.must().add(QueryBuilders.matchQuery("system", system)); query.must().add(QueryBuilders.matchQuery("system", system));
} }
long time = DateUtil.offset(new Date(), DateField.DAY_OF_MONTH, -7).getTime();
String script = "doc['@timestamp'].value.millis < " + time + "L";
query.must().add(QueryBuilders.scriptQuery(new Script(script)));
DeleteQuery deleteQuery = new DeleteQuery(); DeleteQuery deleteQuery = new DeleteQuery();
deleteQuery.setQuery(query); deleteQuery.setQuery(query);
elasticsearchRestTemplate.delete(deleteQuery,new LogRepositoryDTO().getClass()); elasticsearchRestTemplate.delete(deleteQuery,new LogRepositoryDTO().getClass());

View File

@@ -17,6 +17,7 @@ import org.nl.pda.exception.PdaRequestException;
import org.nl.pda.st.in.service.HandNewMaterialService; import org.nl.pda.st.in.service.HandNewMaterialService;
import org.nl.pda.st.out.service.HandCleanOutIvtService; import org.nl.pda.st.out.service.HandCleanOutIvtService;
import org.nl.utils.SecurityUtils; import org.nl.utils.SecurityUtils;
import org.nl.wms.common.util.RedissonUtils;
import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.st.core.service.CheckOutBillService; import org.nl.wms.st.core.service.CheckOutBillService;
import org.nl.wms.st.core.service.StorPublicService; import org.nl.wms.st.core.service.StorPublicService;
@@ -358,6 +359,7 @@ public class HandCleanOutIvtServiceImpl implements HandCleanOutIvtService {
if (StrUtil.isEmpty(point_code)) { if (StrUtil.isEmpty(point_code)) {
throw new PdaRequestException("请选择一个站点!"); throw new PdaRequestException("请选择一个站点!");
} }
RedissonUtils.lock(a->{
Long currentUserId = SecurityUtils.getCurrentUserId(); Long currentUserId = SecurityUtils.getCurrentUserId();
UserDto userDto = userService.findById(currentUserId); UserDto userDto = userService.findById(currentUserId);
String storagevehicle_code = (String) jsonObject.get("storagevehicle_code"); String storagevehicle_code = (String) jsonObject.get("storagevehicle_code");
@@ -417,7 +419,6 @@ public class HandCleanOutIvtServiceImpl implements HandCleanOutIvtService {
task.put("priority", "1"); task.put("priority", "1");
WQLObject taskTable = WQLObject.getWQLObject("SCH_BASE_Task"); WQLObject taskTable = WQLObject.getWQLObject("SCH_BASE_Task");
taskTable.insert(task); taskTable.insert(task);
JSONObject returnjo = new JSONObject();
//下发给acs //下发给acs
AbstractAcsTask intask = new InTask(); AbstractAcsTask intask = new InTask();
//调用ACS接受任务接口 //调用ACS接受任务接口
@@ -432,7 +433,9 @@ public class HandCleanOutIvtServiceImpl implements HandCleanOutIvtService {
throw new PdaRequestException("任务下发失败:" + result.getString("message")); throw new PdaRequestException("任务下发失败:" + result.getString("message"));
} }
} }
},"backstore"+point_code,2);
JSONObject returnjo = new JSONObject();
returnjo.put("code", "1"); returnjo.put("code", "1");
returnjo.put("desc", "成功生成指令!"); returnjo.put("desc", "成功生成指令!");
return returnjo; return returnjo;

View File

@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
import org.nl.modules.system.service.UserService; import org.nl.modules.system.service.UserService;
import org.nl.modules.system.service.dto.UserDto; import org.nl.modules.system.service.dto.UserDto;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
import org.nl.modules.system.util.MapOf;
import org.nl.pda.exception.PdaRequestException; import org.nl.pda.exception.PdaRequestException;
import org.nl.pda.st.out.service.HandXCOutIvtService; import org.nl.pda.st.out.service.HandXCOutIvtService;
import org.nl.utils.SecurityUtils; import org.nl.utils.SecurityUtils;
@@ -179,8 +180,12 @@ public class HandXCOutIvtServiceImpl implements HandXCOutIvtService {
param.put("point_status","00"); param.put("point_status","00");
param.put("lock_type","00"); param.put("lock_type","00");
if (StringUtils.isNotEmpty(storagevehicle_code)){
WQLObject.getWQLObject("ST_IVT_StructAttr").update(MapOf.of("storagevehicle_code",null,"storagevehicle_id",null,"storagevehicle_type",null,"update_time",DateUtil.now()),
"is_delete = '1' and storagevehicle_code = '"+storagevehicle_code+"'");
WQLObject.getWQLObject("sch_base_point").update(param,"vehicle_code = '"+storagevehicle_code+"'"); WQLObject.getWQLObject("sch_base_point").update(param,"vehicle_code = '"+storagevehicle_code+"'");
System.out.println("载具"+storagevehicle_code+"解绑成功!"); System.out.println("载具"+storagevehicle_code+"解绑成功!");
}
JSONObject returnjo = new JSONObject(); JSONObject returnjo = new JSONObject();
returnjo.put("code", "1"); returnjo.put("code", "1");

View File

@@ -22,15 +22,14 @@ spring:
client: client:
reactive: reactive:
#endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网 #endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网
endpoints: 47.96.133.178:8200 #外网 endpoints: 127.0.0.1:200 #外网
# endpoints: http://10.1.3.90:9200 #外网 # endpoints: http://10.1.3.90:9200 #外网
elasticsearch: elasticsearch:
rest: rest:
#uris: 172.31.185.110:9200,172.31.154.9:9200 #内网 #uris: 172.31.185.110:9200,172.31.154.9:9200 #内网
uris: 47.96.133.178:8200 #外网 uris: 127.0.0.1:9200 #外网
# uris: http://10.1.3.90:9200 #外网 # uris: http://10.1.3.90:9200 #外网
username: elastic
password: 123456
datasource: datasource:
druid: druid:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource

View File

@@ -21,12 +21,12 @@ spring:
client: client:
reactive: reactive:
#endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网 #endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网
endpoints: 10.16.1.24:9200 #外网 endpoints: 127.0.0.1:9200 #外网
# endpoints: http://10.1.3.90:9200 #外网 # endpoints: http://10.1.3.90:9200 #外网
elasticsearch: elasticsearch:
rest: rest:
#uris: 172.31.185.110:9200,172.31.154.9:9200 #内网 #uris: 172.31.185.110:9200,172.31.154.9:9200 #内网
uris: 10.16.1.24:9200 #外网 uris: 127.0.0.1:9200 #外网
# uris: http://10.1.3.90:9200 #外网 # uris: http://10.1.3.90:9200 #外网
# username: elastic # username: elastic
# password: 123456 # password: 123456

View File

@@ -50,7 +50,7 @@ https://juejin.cn/post/6844903775631572999
</appender> </appender>
<appender name="esLogAppender" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender"> <appender name="esLogAppender" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
<url>http://10.16.1.24:9200/_bulk</url> <url>http://127.0.0.1:9200/_bulk</url>
<index>${esIndex}</index> <index>${esIndex}</index>
<type>whxr_log</type> <type>whxr_log</type>
<loggerName>es-logger</loggerName> <!-- optional --> <loggerName>es-logger</loggerName> <!-- optional -->