fix:立库界面优化
This commit is contained in:
@@ -28,9 +28,11 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhouz
|
||||
@@ -58,6 +60,7 @@ public class StructattrServiceImpl implements StructattrService {
|
||||
map.put("stor_id", (String) whereJson.get("stor_id"));
|
||||
map.put("sect_id", (String) whereJson.get("sect_id"));
|
||||
map.put("lock_type", (String) whereJson.get("lock_type"));
|
||||
map.put("layer_num", (String) whereJson.get("layer_num"));
|
||||
|
||||
//获取人员对应的仓库
|
||||
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||
@@ -264,6 +267,17 @@ public class StructattrServiceImpl implements StructattrService {
|
||||
.addParamMap(MapOf.of("struct_id", struct_id, "flag", "1"))
|
||||
.process()
|
||||
.getResultJSONArray(0);
|
||||
// 计算合计
|
||||
JSONObject json = array.getJSONObject(0);
|
||||
if (ObjectUtil.isNotEmpty(json.getString("net_weight"))) {
|
||||
BigDecimal container_weight = array.stream().map(row -> ((JSONObject) row).getBigDecimal("net_weight")).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
|
||||
for (int j = 0; j < array.size(); j++) {
|
||||
JSONObject jsonObject = array.getJSONObject(j);
|
||||
jsonObject.put("container_weight",container_weight);
|
||||
}
|
||||
}
|
||||
|
||||
// 获取仓位表中的信息
|
||||
JSONObject strInfo = attrTab
|
||||
.query("struct_id = '" + struct_id + "'")
|
||||
@@ -271,6 +285,9 @@ public class StructattrServiceImpl implements StructattrService {
|
||||
if (strInfo.getString("is_used").equals("0")) {
|
||||
// 被禁用
|
||||
struct_status = 4;
|
||||
} else if (strInfo.getString("sect_code").equals("PD01")) {
|
||||
// 盘点位
|
||||
struct_status = 5;
|
||||
} else if (ObjectUtil.isEmpty(strInfo.getString("storagevehicle_code"))) {
|
||||
// 空位
|
||||
struct_status = 3;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
输入.is_used TYPEAS s_string
|
||||
输入.is_delete TYPEAS s_string
|
||||
输入.have_vehicle TYPEAS s_string
|
||||
输入.layer_num TYPEAS s_string
|
||||
输入.in_stor_id TYPEAS f_string
|
||||
|
||||
[临时表]
|
||||
@@ -71,6 +72,9 @@
|
||||
OPTION 输入.lock_type <> ""
|
||||
struct.lock_type = 输入.lock_type
|
||||
ENDOPTION
|
||||
OPTION 输入.layer_num <> ""
|
||||
struct.layer_num = 输入.layer_num
|
||||
ENDOPTION
|
||||
OPTION 输入.lock_type = "1"
|
||||
(struct.storagevehicle_code is null or struct.storagevehicle_code = '')
|
||||
ENDOPTION
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.ext.acs.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -169,7 +170,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
result.put("message", "下发成功,但未连接ACS!");
|
||||
result.put("data", new JSONArray());
|
||||
|
||||
/* // 测试数据
|
||||
// 测试数据
|
||||
JSONArray data = result.getJSONArray("data");
|
||||
JSONObject a = new JSONObject();
|
||||
a.put("electricity", "86");
|
||||
@@ -199,9 +200,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
JSONArray ArrA1 = new JSONArray(); // A1车间
|
||||
JSONArray ArrLk = new JSONArray(); // LK车间
|
||||
|
||||
String run_time = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("AGV_RUN_TIME").getValue();
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject json = data.getJSONObject(i);
|
||||
|
||||
// 工作时长:电量百分比*6
|
||||
String electricity = json.getString("electricity");
|
||||
json.put("run_time", NumberUtil.round(NumberUtil.div(NumberUtil.mul(electricity, run_time),100), 1));
|
||||
|
||||
if ("2,3".contains(json.getString("car_no"))) {
|
||||
ArrA1.add(json);
|
||||
}
|
||||
@@ -211,7 +218,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
}
|
||||
nowJson.put("jsonA1",ArrA1);
|
||||
nowJson.put("jsonLK",ArrLk);
|
||||
result.put("data", nowJson);*/
|
||||
result.put("data", nowJson);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -233,9 +240,16 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
JSONArray ArrA1 = new JSONArray(); // A1车间
|
||||
JSONArray ArrLk = new JSONArray(); // LK车间
|
||||
|
||||
String run_time = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("AGV_RUN_TIME").getValue();
|
||||
|
||||
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
JSONObject json = data.getJSONObject(i);
|
||||
|
||||
// 工作时长:电量百分比*6
|
||||
String electricity = json.getString("electricity");
|
||||
json.put("run_time", NumberUtil.round(NumberUtil.div(NumberUtil.mul(electricity, run_time),100), 1));
|
||||
|
||||
if ("2,3".contains(json.getString("car_no"))) {
|
||||
ArrA1.add(json);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user