Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
18
lms/nladmin-system/src/main/java/org/nl/config/ESConfig.java
Normal file
18
lms/nladmin-system/src/main/java/org/nl/config/ESConfig.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package org.nl.config;
|
||||
|
||||
/*
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/13 9:58 上午
|
||||
*/
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@Data
|
||||
public class ESConfig {
|
||||
|
||||
@Value(("${es.index}"))
|
||||
private String index;
|
||||
}
|
||||
@@ -123,11 +123,8 @@ public class LogAspect {
|
||||
StackTraceElement[] stackTrace = ex.getStackTrace();
|
||||
if (stackTrace!=null && stackTrace.length>0){
|
||||
for (StackTraceElement stack : stackTrace) {
|
||||
x++;
|
||||
errorStack.append(stack.toString().replaceAll("<",">")).append("<br/>");
|
||||
if (x>10){
|
||||
break;
|
||||
}
|
||||
x++;errorStack.append(stack.toString().replaceAll("<",">")).append("<br/>");
|
||||
if (x>10){ break; }
|
||||
}
|
||||
}
|
||||
log.error("[-requestError-][请求接口:{}]【异常信息:{}】[请求参数:{}] {}", url,errorMsg,params, errorStack.append("】").toString());
|
||||
@@ -179,7 +176,4 @@ public class LogAspect {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.springframework.data.elasticsearch.annotations.Document;
|
||||
* @author ZZQ
|
||||
* @Date 2023/2/8 4:06 下午
|
||||
*/
|
||||
@Document(indexName = "lms_log", type = "lms_log")
|
||||
@Document(indexName = "#{@ESConfig.index}", type = "lms_log")
|
||||
@Data
|
||||
public class LogRepositoryDTO {
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> receiveTaskStatusAcs(String string) {
|
||||
log.info("receiveTaskStatusAcs请求参数:--------------------------------------"+string);
|
||||
log.info("receiveTaskStatusAcs请求参数:--------------------------------------" + string);
|
||||
JSONArray array = JSONArray.parseArray(string);
|
||||
//返回处理失败的任务
|
||||
JSONArray errArr = new JSONArray();
|
||||
@@ -508,7 +508,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public JSONObject deviceApply(JSONObject whereJson) {
|
||||
log.info("deviceApply请求参数:---------------------------------------------"+whereJson.toString());
|
||||
log.info("deviceApply请求参数:---------------------------------------------" + whereJson.toString());
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String weight = whereJson.getString("weight");
|
||||
String type = whereJson.getString("type");
|
||||
@@ -571,13 +571,13 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
data.put("box_width", box_width);
|
||||
data.put("box_high", box_high);
|
||||
data.put("bundle_times", 2);
|
||||
result.put("data",data);
|
||||
result.put("data", data);
|
||||
} else if (type.equals("3")) {
|
||||
//烘箱出箱任务
|
||||
String device_code = whereJson.getString("device_code");
|
||||
JSONObject bake_jo = new JSONObject();
|
||||
bake_jo.put("point_code",device_code);
|
||||
bake_jo.put("option","2");
|
||||
bake_jo.put("point_code", device_code);
|
||||
bake_jo.put("option", "2");
|
||||
new BakingServiceImpl().ovenInAndOut(bake_jo);
|
||||
} else {
|
||||
throw new BadRequestException("请输入正确的任务类型!");
|
||||
@@ -587,7 +587,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public JSONObject process(JSONObject whereJson) {
|
||||
log.info("process请求参数:---------------------------------------------"+whereJson.toString());
|
||||
log.info("process请求参数:---------------------------------------------" + whereJson.toString());
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String ext_task_id = whereJson.getString("ext_task_id");
|
||||
String srcLocation = whereJson.getString("srcLocation");
|
||||
@@ -654,20 +654,20 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
|
||||
@Override
|
||||
public JSONObject shipDeviceUpdate(JSONObject whereJson) {
|
||||
log.info("shipDeviceUpdate请求参数:---------------------------------------------"+whereJson.toString());
|
||||
log.info("shipDeviceUpdate请求参数:---------------------------------------------" + whereJson.toString());
|
||||
String device_code = whereJson.getString("device_code");
|
||||
if (StrUtil.isEmpty(device_code)){
|
||||
if (StrUtil.isEmpty(device_code)) {
|
||||
throw new BadRequestException("输入的设备号不能为空!");
|
||||
}
|
||||
|
||||
//查询该设备对应的输送线点位
|
||||
JSONObject deliver_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_code = '"+device_code+"'").uniqueResult(0);
|
||||
if (deliver_jo != null){
|
||||
JSONObject deliver_jo = WQLObject.getWQLObject("st_ivt_deliverypointivt").query("point_code = '" + device_code + "'").uniqueResult(0);
|
||||
if (deliver_jo != null) {
|
||||
String qzzno = deliver_jo.getString("qzzno");
|
||||
if (ObjectUtil.isNotEmpty(deliver_jo)){
|
||||
deliver_jo.put("point_status","01");
|
||||
deliver_jo.put("qzzno","");
|
||||
deliver_jo.put("vehicle_code","");
|
||||
if (ObjectUtil.isNotEmpty(deliver_jo)) {
|
||||
deliver_jo.put("point_status", "01");
|
||||
deliver_jo.put("qzzno", "");
|
||||
deliver_jo.put("vehicle_code", "");
|
||||
WQLObject.getWQLObject("st_ivt_deliverypointivt").update(deliver_jo);
|
||||
|
||||
//如果为靠近分切机一端的输送点,判断远离端是否需要进行横移
|
||||
@@ -681,18 +681,18 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
.addParam("point_code", device_code)
|
||||
.addParam("product_area", product_area)
|
||||
.addParam("sort_seq", sort_seq)
|
||||
.addParam("find_type","1")
|
||||
.addParam("find_type", "1")
|
||||
.addParam("flag", "17").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(right_point) && !right_point.getString("point_status").equals("01")) {
|
||||
//创建载具横移任务
|
||||
String translate_code1 = right_point.getString("point_code");
|
||||
String translate_code2 = device_code;
|
||||
JSONObject tran_jo = new JSONObject();
|
||||
tran_jo.put("point_code1",translate_code1);
|
||||
tran_jo.put("point_code2",translate_code2);
|
||||
tran_jo.put("vehicle_code",right_point.getString("qzzno"));
|
||||
tran_jo.put("vehicle_code2",right_point.getString("vehicle_code"));
|
||||
tran_jo.put("task_type","010406");
|
||||
tran_jo.put("point_code1", translate_code1);
|
||||
tran_jo.put("point_code2", translate_code2);
|
||||
tran_jo.put("vehicle_code", right_point.getString("qzzno"));
|
||||
tran_jo.put("vehicle_code2", right_point.getString("vehicle_code"));
|
||||
tran_jo.put("task_type", "010406");
|
||||
cutConveyorTask.createTask(tran_jo);
|
||||
}
|
||||
}
|
||||
@@ -707,100 +707,98 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
@Override
|
||||
public void initialize(JSONObject param) {
|
||||
{
|
||||
{
|
||||
int j_size = param.getInteger("j"); // 排
|
||||
int k_size = param.getInteger("k"); // 列
|
||||
String block = param.getString("layer"); // 块
|
||||
JSONObject max_jo = WQLObject.getWQLObject("ST_IVT_StructAttr").query("sect_code = 'ZC01' order by out_order_seq desc ").uniqueResult(0);
|
||||
int max_no = 0;
|
||||
if (ObjectUtil.isNotEmpty(max_jo)) {
|
||||
max_no = max_jo.getIntValue("out_order_seq");
|
||||
}
|
||||
max_no++;
|
||||
for (int i = 1; i < 4; i++) {
|
||||
for (int j = 1; j < j_size; j++) {
|
||||
for (int k = 1; k < k_size; k++) {
|
||||
//排
|
||||
String row = "";
|
||||
if (j < 10) {
|
||||
row = "0" + j;
|
||||
} else {
|
||||
row = j + "";
|
||||
}
|
||||
|
||||
//列
|
||||
String line = "";
|
||||
if (k < 10) {
|
||||
line = "0" + k;
|
||||
} else {
|
||||
line = k + "";
|
||||
}
|
||||
|
||||
//块
|
||||
String piece = i + block;
|
||||
|
||||
//层
|
||||
String layer = "0" + i;
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("struct_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jo.put("struct_code", piece + row + "-" + line + "-" + layer);
|
||||
jo.put("struct_name", piece + "区" + row + "排" + line + "列" + layer + "层");
|
||||
jo.put("simple_name", piece + "区" + row + "排" + line + "列" + layer + "层");
|
||||
jo.put("sect_id", "1582991348217286656");
|
||||
jo.put("sect_code", "ZC01");
|
||||
jo.put("sect_name", "主存区");
|
||||
jo.put("stor_id", "1582991156504039424");
|
||||
jo.put("stor_code", "CP01");
|
||||
jo.put("stor_name", "兰州仓库");
|
||||
jo.put("stor_type", "03");
|
||||
jo.put("is_tempstruct", "0");
|
||||
jo.put("row_num", row);
|
||||
jo.put("col_num", line);
|
||||
jo.put("layer_num", layer);
|
||||
jo.put("block_num", piece);
|
||||
jo.put("in_order_seq", 0);
|
||||
jo.put("out_order_seq", max_no);
|
||||
jo.put("in_empty_seq", 0);
|
||||
jo.put("out_empty_seq", 0);
|
||||
jo.put("placement_type", "01");
|
||||
jo.put("create_id", "1");
|
||||
jo.put("create_name", "管理员");
|
||||
jo.put("create_time", DateUtil.now());
|
||||
jo.put("update_optid", "1");
|
||||
jo.put("update_optname", "管理员");
|
||||
jo.put("update_time", DateUtil.now());
|
||||
jo.put("is_delete", "0");
|
||||
jo.put("is_used", "1");
|
||||
jo.put("lock_type", "1");
|
||||
jo.put("material_height_type", "1");
|
||||
WQLObject.getWQLObject("ST_IVT_StructAttr").insert(jo);
|
||||
max_no++;
|
||||
//插入点位
|
||||
JSONObject structMap = new JSONObject();
|
||||
structMap.put("point_id", IdUtil.getSnowflake(1,1).nextId());
|
||||
structMap.put("point_code", jo.getString("struct_code"));
|
||||
structMap.put("point_name", jo.getString("struct_name"));
|
||||
structMap.put("region_id", "1582991348217286656");
|
||||
structMap.put("region_code", jo.getString("sect_code"));
|
||||
structMap.put("region_name", jo.getString("sect_name"));
|
||||
structMap.put("point_type", "2");
|
||||
structMap.put("point_status", "1");
|
||||
structMap.put("lock_type", jo.getString("lock_type"));
|
||||
structMap.put("block_num", jo.getIntValue("block_num"));
|
||||
structMap.put("row_num", jo.getIntValue("row_num"));
|
||||
structMap.put("col_num", jo.getIntValue("col_num"));
|
||||
structMap.put("layer_num", jo.getIntValue("layer_num"));
|
||||
structMap.put("source_id", jo.getString("struct_id"));
|
||||
structMap.put("create_id", "1");
|
||||
structMap.put("create_name", "管理员");
|
||||
structMap.put("create_time", DateUtil.now());
|
||||
structMap.put("update_optid", "1");
|
||||
structMap.put("update_optname", "管理员");
|
||||
structMap.put("update_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("sch_base_point").insert(structMap);
|
||||
int j_size = param.getInteger("j"); // 排
|
||||
int k_size = param.getInteger("k"); // 列
|
||||
String block = param.getString("layer"); // 块
|
||||
JSONObject max_jo = WQLObject.getWQLObject("ST_IVT_StructAttr").query("sect_code = 'ZC01' order by out_order_seq desc ").uniqueResult(0);
|
||||
int max_no = 0;
|
||||
if (ObjectUtil.isNotEmpty(max_jo)) {
|
||||
max_no = max_jo.getIntValue("out_order_seq");
|
||||
}
|
||||
max_no++;
|
||||
for (int i = 1; i < 4; i++) {
|
||||
for (int j = 1; j < j_size; j++) {
|
||||
for (int k = 1; k < k_size; k++) {
|
||||
//排
|
||||
String row = "";
|
||||
if (j < 10) {
|
||||
row = "0" + j;
|
||||
} else {
|
||||
row = j + "";
|
||||
}
|
||||
|
||||
//列
|
||||
String line = "";
|
||||
if (k < 10) {
|
||||
line = "0" + k;
|
||||
} else {
|
||||
line = k + "";
|
||||
}
|
||||
|
||||
//块
|
||||
String piece = i + block;
|
||||
|
||||
//层
|
||||
String layer = "0" + i;
|
||||
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("struct_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
jo.put("struct_code", piece + row + "-" + line + "-" + layer);
|
||||
jo.put("struct_name", piece + "区" + row + "排" + line + "列" + layer + "层");
|
||||
jo.put("simple_name", piece + "区" + row + "排" + line + "列" + layer + "层");
|
||||
jo.put("sect_id", "1582991348217286656");
|
||||
jo.put("sect_code", "ZC01");
|
||||
jo.put("sect_name", "主存区");
|
||||
jo.put("stor_id", "1582991156504039424");
|
||||
jo.put("stor_code", "CP01");
|
||||
jo.put("stor_name", "兰州仓库");
|
||||
jo.put("stor_type", "03");
|
||||
jo.put("is_tempstruct", "0");
|
||||
jo.put("row_num", row);
|
||||
jo.put("col_num", line);
|
||||
jo.put("layer_num", layer);
|
||||
jo.put("block_num", piece);
|
||||
jo.put("in_order_seq", 0);
|
||||
jo.put("out_order_seq", max_no);
|
||||
jo.put("in_empty_seq", 0);
|
||||
jo.put("out_empty_seq", 0);
|
||||
jo.put("placement_type", "01");
|
||||
jo.put("create_id", "1");
|
||||
jo.put("create_name", "管理员");
|
||||
jo.put("create_time", DateUtil.now());
|
||||
jo.put("update_optid", "1");
|
||||
jo.put("update_optname", "管理员");
|
||||
jo.put("update_time", DateUtil.now());
|
||||
jo.put("is_delete", "0");
|
||||
jo.put("is_used", "1");
|
||||
jo.put("lock_type", "1");
|
||||
jo.put("material_height_type", "1");
|
||||
WQLObject.getWQLObject("ST_IVT_StructAttr").insert(jo);
|
||||
max_no++;
|
||||
//插入点位
|
||||
JSONObject structMap = new JSONObject();
|
||||
structMap.put("point_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
structMap.put("point_code", jo.getString("struct_code"));
|
||||
structMap.put("point_name", jo.getString("struct_name"));
|
||||
structMap.put("region_id", "1582991348217286656");
|
||||
structMap.put("region_code", jo.getString("sect_code"));
|
||||
structMap.put("region_name", jo.getString("sect_name"));
|
||||
structMap.put("point_type", "2");
|
||||
structMap.put("point_status", "1");
|
||||
structMap.put("lock_type", jo.getString("lock_type"));
|
||||
structMap.put("block_num", jo.getIntValue("block_num"));
|
||||
structMap.put("row_num", jo.getIntValue("row_num"));
|
||||
structMap.put("col_num", jo.getIntValue("col_num"));
|
||||
structMap.put("layer_num", jo.getIntValue("layer_num"));
|
||||
structMap.put("source_id", jo.getString("struct_id"));
|
||||
structMap.put("create_id", "1");
|
||||
structMap.put("create_name", "管理员");
|
||||
structMap.put("create_time", DateUtil.now());
|
||||
structMap.put("update_optid", "1");
|
||||
structMap.put("update_optname", "管理员");
|
||||
structMap.put("update_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("sch_base_point").insert(structMap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.sch.manage;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -13,19 +14,36 @@ import org.springframework.stereotype.Component;
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoQueryDeviceStatus{
|
||||
public class AutoQueryDeviceStatus {
|
||||
private final WmsToAcsService wmsToAcsService;
|
||||
|
||||
public void run() {
|
||||
//通过ACS接口获取温度
|
||||
JSONArray device_rows = WQL.getWO("PDA_02").addParam("flag","15").process().getResultJSONArray(0);
|
||||
JSONArray device_rows = WQL.getWO("PDA_02").addParam("flag", "15").process().getResultJSONArray(0);
|
||||
JSONObject jo = wmsToAcsService.getPointStatus(device_rows);
|
||||
WQLObject ivtTab=WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_hotpointivt");
|
||||
JSONArray de_rows = jo.getJSONArray("data");
|
||||
for (int i = 0; i < de_rows.size(); i++) {
|
||||
JSONObject row = de_rows.getJSONObject(i);
|
||||
String device_code = row.getString("device_code");
|
||||
JSONObject point_jo = ivtTab.query("point_code = '"+device_code+"'").uniqueResult(0);
|
||||
point_jo.put("temperature",row.getString("temperature"));
|
||||
JSONObject point_jo = ivtTab.query("point_code = '" + device_code + "'").uniqueResult(0);
|
||||
point_jo.put("temperature", row.getString("temperature"));
|
||||
//获取倒计时,分,秒
|
||||
String countdown_house = row.getString("countdown_house");
|
||||
String countdown_min = row.getString("countdown_min");
|
||||
String countdown_sec = row.getString("countdown_sec");
|
||||
|
||||
if (StrUtil.isEmpty(countdown_house)) {
|
||||
countdown_house = "0";
|
||||
}
|
||||
if (StrUtil.isEmpty(countdown_min)) {
|
||||
countdown_min = "0";
|
||||
}
|
||||
if (StrUtil.isEmpty(countdown_sec)) {
|
||||
countdown_sec = "0";
|
||||
}
|
||||
String last_time = countdown_house + "小时" + countdown_min + "分钟";
|
||||
point_jo.put("last_time", last_time);
|
||||
ivtTab.update(point_jo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user