add: 新增立库监控前后端
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
package org.nl.wms.basedata.st.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -73,4 +74,12 @@ public class StructattrController {
|
||||
structattrService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/getStructByCodes")
|
||||
@Log("获取仓位信息")
|
||||
@ApiOperation("获取仓位信息")
|
||||
public ResponseEntity<Object> getStructByCodes(@RequestBody String json){
|
||||
JSONArray jsonArray = JSONArray.parseArray(json);
|
||||
return new ResponseEntity<>(structattrService.getStructByCodes(jsonArray), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package org.nl.wms.basedata.st.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.wms.basedata.st.service.dto.StructattrDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -69,4 +70,9 @@ public interface StructattrService {
|
||||
*/
|
||||
void changeActive(JSONObject json);
|
||||
|
||||
/**
|
||||
* 获取仓位信息
|
||||
* @return
|
||||
*/
|
||||
JSONArray getStructByCodes(JSONArray json);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata.st.service.SectattrService;
|
||||
@@ -240,4 +241,52 @@ public class StructattrServiceImpl implements StructattrService {
|
||||
WQLObject.getWQLObject("sch_base_point").update(json, " point_id = '" + struct_id + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getStructByCodes(JSONArray jsonArray) {
|
||||
/**
|
||||
* jsonArry: 所有组件的信息,包括组件本身的id以及仓位id,组件id是用来给前端做对应筛选使用,如果没有仓位id证明不是
|
||||
* 仓位组件,故不做处理,可以不用返回数据。
|
||||
*/
|
||||
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
JSONArray arr = new JSONArray();
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject obj = new JSONObject();
|
||||
JSONObject js = jsonArray.getJSONObject(i);
|
||||
String struct_id = js.getString("struct_id");
|
||||
|
||||
if (ObjectUtil.isEmpty(struct_id)) continue;
|
||||
|
||||
int struct_status = 2;
|
||||
// 获取信息 1蓝色空载具 2黄色木箱 3绿色空位 4灰色禁用
|
||||
// 查找详细信息, 这里可能是有多条数据
|
||||
JSONArray array = WQL
|
||||
.getWO("QST_STRUCTATTR")
|
||||
.addParamMap(MapOf.of("struct_id", struct_id, "flag", "1"))
|
||||
.process()
|
||||
.getResultJSONArray(0);
|
||||
// 获取仓位表中的信息
|
||||
JSONObject strInfo = attrTab
|
||||
.query("struct_id = '" + struct_id + "'")
|
||||
.uniqueResult(0);
|
||||
if (strInfo.getString("is_delete").equals("1")) {
|
||||
// 被删掉
|
||||
struct_status = 4;
|
||||
} else if (ObjectUtil.isEmpty(strInfo.getString("storagevehicle_code"))) {
|
||||
// 空位
|
||||
struct_status = 3;
|
||||
} else if (ObjectUtil.isNotEmpty(strInfo.getString("storagevehicle_code"))
|
||||
&& strInfo.getString("sect_code").equals("KTP01")) {
|
||||
struct_status = 1;
|
||||
}
|
||||
// 剩余层数货位信息没统计,统计可以用obj.put(key, value)返给前端,前端在initStatus()就可以遍历去获取,给节点赋值
|
||||
obj.put("data", array);
|
||||
obj.put("struct_status", struct_status);
|
||||
obj.put("struct_id", strInfo.getString("struct_id"));
|
||||
obj.put("struct_code", strInfo.getString("struct_code"));
|
||||
obj.put("id", js.getString("id")); // 设备不存在就只保留id,方便前端查看
|
||||
arr.add(obj);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
[交易说明]
|
||||
交易名: 将海亮的物料导入mysql
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.struct_id TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
attr.*,
|
||||
sub.package_box_sn,
|
||||
sub.quanlity_in_box,
|
||||
sub.box_weight,
|
||||
sub.sale_order_name,
|
||||
sub.container_name,
|
||||
sub.product_description,
|
||||
sub.net_weight
|
||||
FROM
|
||||
st_ivt_structattr attr
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = attr.storagevehicle_code
|
||||
WHERE
|
||||
1 = 1
|
||||
OPTION 输入.struct_id <> ""
|
||||
attr.struct_id = 输入.struct_id
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
Reference in New Issue
Block a user