This commit is contained in:
2023-09-28 22:14:49 +08:00
7 changed files with 88 additions and 16 deletions

View File

@@ -322,6 +322,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", driver.getStatus());
jo.put("power", driver.getElectric_qty());
jo.put("x", driver.getX());
jo.put("y", driver.getY());
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : driver.getError_message());
} else if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
@@ -330,6 +332,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", driver.getStatus());
jo.put("power", driver.getElectric_qty());
jo.put("x", driver.getX());
jo.put("y", driver.getY());
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : driver.getError_message());
} else if (device.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {

View File

@@ -29,4 +29,9 @@ public interface AutoRiKuService {
* 获取发货区
* */
JSONObject queryNum(JSONObject whereJson);
/**
* 获取空托盘
* */
JSONObject getEmpPoint();
}

View File

@@ -227,4 +227,44 @@ public class AutoRiKuServiceImpl implements AutoRiKuService {
return result;
}
@Override
public JSONObject getEmpPoint() {
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
JSONObject jsonAll = new JSONObject();
JSONArray dataArr = new JSONArray();
// 获取有货货位
JSONArray haveArr = attrTab.query("sect_code = 'KTP01' and is_delete = '0' and IFNULL(storagevehicle_code,'') <> '' and is_used = '1' ").getResultJSONArray(0);
JSONObject jsonHave = new JSONObject();
jsonHave.put("name", "有货");
jsonHave.put("value", haveArr.size());
// 获取无货货位
JSONArray notHaveArr = attrTab.query("sect_code = 'KTP01' and is_delete = '0' and IFNULL(storagevehicle_code,'') = '' and is_used = '1'").getResultJSONArray(0);
JSONObject jsonNotHave = new JSONObject();
jsonNotHave.put("name", "空闲");
jsonNotHave.put("value", notHaveArr.size());
// 获取禁用货位
JSONArray usedArr = attrTab.query("sect_code = 'KTP01' and is_used = '0' and IFNULL(storagevehicle_code,'') = '' and is_delete = '0'").getResultJSONArray(0);
JSONObject jsonUsed = new JSONObject();
jsonUsed.put("name", "禁用");
jsonUsed.put("value", usedArr.size());
dataArr.add(jsonHave);
dataArr.add(jsonNotHave);
dataArr.add(jsonUsed);
int num = haveArr.size() + notHaveArr.size() + usedArr.size();
jsonAll.put("pieSubTest", "总仓位: "+num);
jsonAll.put("data", dataArr);
jsonAll.put("name", "立库空托盘统计");
return jsonAll;
}
}

View File

@@ -34,6 +34,7 @@ public class AutoWebSocketRiKu {
data.put("two",autoRiKuService.getTwoPoint());
data.put("three",autoRiKuService.getThreePoint());
data.put("all",autoRiKuService.getAllPoint());
data.put("empList",autoRiKuService.getEmpPoint());
return new ResponseEntity<>(data, HttpStatus.OK);
}

View File

@@ -458,6 +458,8 @@ public class SapToLmsServiceImpl implements SapToLmsService {
String lgort_out = jo.getString("LGORT1"); // 调出仓库
String lgort_in = jo.getString("LGORT2"); // 调入仓库
if (ObjectUtil.isEmpty(jo.getString("ZDBSQD"))) throw new BadRequestException("交货单不能为空!");
JSONObject jsonStorOut = storTab.query("stor_code = '" + lgort_out + "' and is_used = '1' and is_delete = '0'").uniqueResult(0);
JSONObject jsonStorIn = storTab.query("stor_code = '" + lgort_in + "' and is_used = '1' and is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonStorOut) || ObjectUtil.isEmpty(jsonStorIn)) {
@@ -488,21 +490,29 @@ public class SapToLmsServiceImpl implements SapToLmsService {
jsonMst.put("user", "sap");
// 明细
JSONArray tableData = new JSONArray();
JSONObject jsonDtl = new JSONObject();
JSONObject jsonMater = materTab.query("material_code = '" + jo.getString("MATNR") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("此物料不存在" + jo.getString("MATNR"));
JSONObject jsonUnit = unitTab.query("measure_unit_id = '" + jsonMater.getString("base_unit_id") + "'").uniqueResult(0);
JSONArray item = jo.getJSONArray("ITEM");
jsonDtl.put("material_id", jsonMater.getString("material_id"));
jsonDtl.put("qty_unit_id", jsonMater.getLongValue("base_unit_id"));
jsonDtl.put("qty_unit_name", jsonUnit.getString("unit_name"));
jsonDtl.put("plan_qty", jo.getDoubleValue("KALAB"));
jsonDtl.put("source_bill_code", jo.getString("ZVBELN"));
jsonDtl.put("vbeln", jo.getString("ZDBSQD")); // 来源交货单
// jsonDtl.put("posnr", json.getString("POSNR")); // 来源交货单行
jsonDtl.put("width", jo.getString("ZHL02")); // 幅宽
tableData.add(jsonDtl);
JSONArray tableData = new JSONArray();
for (int i = 0; i < item.size(); i++) {
JSONObject jsonObject = item.getJSONObject(i);
JSONObject jsonDtl = new JSONObject();
JSONObject jsonMater = materTab.query("material_code = '" + jsonObject.getString("MATNR") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonMater)) throw new BadRequestException("此物料不存在" + jsonObject.getString("MATNR"));
JSONObject jsonUnit = unitTab.query("measure_unit_id = '" + jsonMater.getString("base_unit_id") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonObject.getString("KALAB"))) throw new BadRequestException("调拨数量不能为空!");
if (ObjectUtil.isEmpty(jsonObject.getString("ZVBELN"))) throw new BadRequestException("订单不能为空!");
jsonDtl.put("material_id", jsonMater.getString("material_id"));
jsonDtl.put("qty_unit_id", jsonMater.getLongValue("base_unit_id"));
jsonDtl.put("qty_unit_name", jsonUnit.getString("unit_name"));
jsonDtl.put("plan_qty", jsonObject.getDoubleValue("KALAB"));
jsonDtl.put("source_bill_code", jsonObject.getString("ZVBELN"));
jsonDtl.put("vbeln", jo.getString("ZDBSQD")); // 来源交货单
jsonDtl.put("width", jsonObject.getString("ZHL02")); // 幅宽
tableData.add(jsonDtl);
}
jsonMst.put("tableData", tableData);
// 调用出库新增

View File

@@ -612,7 +612,9 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
for (int j = 0; j < disArr.size(); j++) {
JSONObject jsonDis = disArr.getJSONObject(j);
JSONObject paramDis = new JSONObject();
paramDis.put("ZVBELN", jsonDtl.getString("source_bill_code"));
JSONObject jsonDtl2 = wo_dtl.query("iostorinvdtl_id = '" + jsonDis.getString("iostorinvdtl_id") + "'").uniqueResult(0);
paramDis.put("ZVBELN", jsonDtl2.getString("source_bill_code"));
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
paramDis.put("MATNR", jsonMater.getString("material_code"));

View File

@@ -28,6 +28,14 @@
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :xs="24" :sm="24" :lg="24">
<div class="chart-wrapper">
<pie-chart :chart-data="empList" />
</div>
</el-col>
</el-row>
</div>
</div>
</template>
@@ -46,7 +54,8 @@ export default {
allList: {},
oneList: {},
twoList: {},
threeList: {}
threeList: {},
empList: {}
}
},
mounted() {
@@ -74,6 +83,7 @@ export default {
this.twoList = res.two
this.threeList = res.three
this.allList = res.all
this.empList = res.empList
})
}
}