update
This commit is contained in:
@@ -1242,7 +1242,7 @@ public class DashboardService {
|
||||
JSONObject row = new JSONObject();
|
||||
row.put("equipment", datum.getString("name"));
|
||||
row.put("status", this.agvStatusToDictStatus(datum.getIntValue("state")));
|
||||
row.put("equipmentName", datum.getString("device_name"));
|
||||
row.put("equipmentName", datum.getString("name"));
|
||||
row.put("statusChinese", this.agvStatusToChinese(datum.getIntValue("state")));
|
||||
|
||||
JSONArray rowData = new JSONArray();
|
||||
@@ -1268,11 +1268,6 @@ public class DashboardService {
|
||||
rowDatum.put("value", datum.getIntValue("positionY"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
rowDatum = new JSONObject();
|
||||
rowDatum.put("key", "故障信息");
|
||||
rowDatum.put("value", datum.getJSONArray("faultInfo"));
|
||||
rowData.add(rowDatum);
|
||||
|
||||
agvArr.add(row);
|
||||
}
|
||||
|
||||
@@ -1792,36 +1787,55 @@ public class DashboardService {
|
||||
private int agvStatusToDictStatus(int status) {
|
||||
switch (status) {
|
||||
case 2:
|
||||
case 3:
|
||||
return 1;
|
||||
case 4:
|
||||
case 5:
|
||||
case 7:
|
||||
return 2;
|
||||
case 0:
|
||||
case 1:
|
||||
return 3;
|
||||
case 3:
|
||||
case 5:
|
||||
case 6:
|
||||
return 4;
|
||||
default:
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
private String agvStatusToChinese(int status) {
|
||||
switch (status) {
|
||||
case 2:
|
||||
case 3:
|
||||
return "运行";
|
||||
case 4:
|
||||
case 5:
|
||||
case 7:
|
||||
return "暂停";
|
||||
case 1:
|
||||
return "停机";
|
||||
return "关机";
|
||||
case 2:
|
||||
return "运行中";
|
||||
case 3:
|
||||
return "交通管制";
|
||||
case 4:
|
||||
return "任务等待";
|
||||
case 5:
|
||||
return "充电中";
|
||||
case 6:
|
||||
return "故障";
|
||||
return "故障中";
|
||||
case 7:
|
||||
return "低电量";
|
||||
default:
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
|
||||
private String toJoinString(JSONArray jsonArray) {
|
||||
if (ObjectUtil.isEmpty(jsonArray)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
sb.append(jsonArray.getString(i));
|
||||
if (i != jsonArray.size() - 1) {
|
||||
sb.append(",");
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,6 +240,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
if ("0000".equals(vehicleCode)) {
|
||||
throw new BadRequestException("条码不能为空!");
|
||||
}
|
||||
JSONObject vd_update = new JSONObject();
|
||||
vd_update.put("is_delete", TrueOrFalse.TRUE.value());
|
||||
TaskUtils.addACSUpdateColum(vd_update);
|
||||
WQLObject.getWQLObject("st_ivt_vehicle_detail").update(vd_update, "is_delete = '0' AND vehicle_type = '1' AND vehicle_code = '" + vehicleCode + "'");
|
||||
|
||||
String weight = param.getString("weight");
|
||||
if (StrUtil.isBlank(weight)) {
|
||||
throw new BadRequestException("重量不能为空!");
|
||||
@@ -652,7 +657,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
TaskUtils.addACSUpdateColum(workOrder);
|
||||
workOrderTable.update(workOrder);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestException("未知操作类型!");
|
||||
}
|
||||
|
||||
@@ -226,25 +226,6 @@ public class GZSendMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||
}
|
||||
|
||||
JSONObject detail = WQL.getWO("SEND_MATERIAL_TASK").addParam("flag", "6").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
|
||||
String dd = detail.getString("dd");
|
||||
String extCode = detail.getString("ext_code");
|
||||
if (StrUtil.isNotBlank(dd) && StrUtil.isNotBlank(extCode)) {
|
||||
JSONObject regionIn = new JSONObject();
|
||||
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId());
|
||||
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE"));
|
||||
regionIn.put("dDate", DateUtil.now());
|
||||
regionIn.put("cVouchType", RegionInType.BCPRK.label());
|
||||
regionIn.put("cMocode", dd);
|
||||
regionIn.put("cInvCode", detail.getString("material_number"));
|
||||
regionIn.put("iQuantity", String.format("%.3f", detail.getDoubleValue("weight") / 1000));
|
||||
regionIn.put("iNum", detail.getIntValue("qty"));
|
||||
regionIn.put("iinvexchrate", String.format("%.5f", detail.getDoubleValue("dz") / 1000));
|
||||
regionIn.put("cBatch", dd);
|
||||
regionIn.put("PLANSID", extCode);
|
||||
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package org.nl.wms.sch.task.send.material;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.basedata.eum.TrueOrFalse;
|
||||
@@ -239,6 +242,25 @@ public class YZSendMaterialTask extends AbstractAcsTask {
|
||||
}
|
||||
point_table.update(point2, "point_code = '" + point_code2 + "'");
|
||||
}
|
||||
|
||||
JSONObject detail = WQL.getWO("SEND_MATERIAL_TASK").addParam("flag", "6").addParam("vd_id", task.getString("group_id")).process().uniqueResult(0);
|
||||
String dd = detail.getString("dd");
|
||||
String extCode = detail.getString("ext_code");
|
||||
if (StrUtil.isNotBlank(dd) && StrUtil.isNotBlank(extCode)) {
|
||||
JSONObject regionIn = new JSONObject();
|
||||
regionIn.put("id", IdUtil.getSnowflake(1L, 1L).nextId());
|
||||
regionIn.put("cCode", CodeUtil.getNewCode("IN_STORE_CODE"));
|
||||
regionIn.put("dDate", DateUtil.now());
|
||||
regionIn.put("cVouchType", RegionInType.BCPRK.label());
|
||||
regionIn.put("cMocode", dd);
|
||||
regionIn.put("cInvCode", detail.getString("material_number"));
|
||||
regionIn.put("iQuantity", String.format("%.3f", detail.getDoubleValue("weight") / 1000));
|
||||
regionIn.put("iNum", detail.getIntValue("qty"));
|
||||
regionIn.put("iinvexchrate", String.format("%.5f", detail.getDoubleValue("dz") / 1000));
|
||||
regionIn.put("cBatch", dd);
|
||||
regionIn.put("PLANSID", extCode);
|
||||
WQLObject.getWQLObject("st_ivt_regionio").insert(regionIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user