This commit is contained in:
2023-05-22 17:36:13 +08:00
41 changed files with 1285 additions and 186 deletions

View File

@@ -25,4 +25,8 @@ public interface AutoRiKuService {
* */
JSONObject getAllPoint();
/**
* 获取发货区
* */
JSONObject queryNum(JSONObject whereJson);
}

View File

@@ -1,12 +1,20 @@
package org.nl.modules.mnt.service.impl;
import cn.hutool.core.util.NumberUtil;
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.mnt.service.AutoRiKuService;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
public class AutoRiKuServiceImpl implements AutoRiKuService {
@@ -18,21 +26,22 @@ public class AutoRiKuServiceImpl implements AutoRiKuService {
JSONArray dataArr = new JSONArray();
// 获取有货货位
JSONArray haveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and IFNULL(storagevehicle_code,'') <> '' and layer_num = '1' and is_delete = '0'").getResultJSONArray(0);
JSONArray haveArr = WQL.getWO("AUTORIKU").addParam("flag", "1").addParam("layer_num", "1").process().getResultJSONArray(0);
JSONObject jsonHave = new JSONObject();
jsonHave.put("name", "有货");
jsonHave.put("value", haveArr.size());
// 获取无货货位
JSONArray notHaveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and IFNULL(storagevehicle_code,'') = '' and layer_num = '1' and is_delete = '0'").getResultJSONArray(0);
JSONArray notHaveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01','FTD01') and IFNULL(storagevehicle_code,'') = '' and layer_num = '1' and is_delete = '0'").getResultJSONArray(0);
JSONObject jsonNotHave = new JSONObject();
jsonNotHave.put("name", "空闲");
jsonNotHave.put("value", notHaveArr.size());
// 获取禁用货位
JSONArray usedArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and is_used = '0' and IFNULL(storagevehicle_code,'') = '' and layer_num = '1' and is_delete = '0'").getResultJSONArray(0);
JSONArray usedArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01','FTD01') and is_used = '0' and IFNULL(storagevehicle_code,'') = '' and layer_num = '1' and is_delete = '0'").getResultJSONArray(0);
JSONObject jsonUsed = new JSONObject();
jsonUsed.put("name", "禁用");
@@ -43,7 +52,15 @@ public class AutoRiKuServiceImpl implements AutoRiKuService {
dataArr.add(jsonUsed);
int num = haveArr.size() + notHaveArr.size() + usedArr.size();
jsonAll.put("pieSubTest", "总仓位:"+num);
// 获取净重
BigDecimal net_weight = haveArr.stream()
.map(row -> (JSONObject) row)
.filter(row -> !StrUtil.equals(row.getString("sect_code"), "KTP01") && ObjectUtil.isNotEmpty(row.getString("net_weight")))
.map(row -> row.getBigDecimal("net_weight"))
.reduce(BigDecimal.ZERO, BigDecimal::add);
jsonAll.put("pieSubTest", "总仓位: "+num+" "+"总净重: "+ NumberUtil.round(net_weight,2)+"KG");
jsonAll.put("data", dataArr);
jsonAll.put("name", "立库1层统计");
@@ -58,21 +75,21 @@ public class AutoRiKuServiceImpl implements AutoRiKuService {
JSONArray dataArr = new JSONArray();
// 获取有货货位
JSONArray haveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and IFNULL(storagevehicle_code,'') <> '' and layer_num = '2' and is_delete = '0'").getResultJSONArray(0);
JSONArray haveArr = WQL.getWO("AUTORIKU").addParam("flag", "1").addParam("layer_num", "2").process().getResultJSONArray(0);
JSONObject jsonHave = new JSONObject();
jsonHave.put("name", "有货");
jsonHave.put("value", haveArr.size());
// 获取无货货位
JSONArray notHaveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and IFNULL(storagevehicle_code,'') = '' and layer_num = '2' and is_delete = '0'").getResultJSONArray(0);
JSONArray notHaveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01','FTD01') and IFNULL(storagevehicle_code,'') = '' and layer_num = '2' and is_delete = '0'").getResultJSONArray(0);
JSONObject jsonNotHave = new JSONObject();
jsonNotHave.put("name", "空闲");
jsonNotHave.put("value", notHaveArr.size());
// 获取禁用货位
JSONArray usedArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and is_used = '0' and IFNULL(storagevehicle_code,'') = '' and layer_num = '2' and is_delete = '0'").getResultJSONArray(0);
JSONArray usedArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01','FTD01') and is_used = '0' and IFNULL(storagevehicle_code,'') = '' and layer_num = '2' and is_delete = '0'").getResultJSONArray(0);
JSONObject jsonUsed = new JSONObject();
jsonUsed.put("name", "禁用");
@@ -83,7 +100,15 @@ public class AutoRiKuServiceImpl implements AutoRiKuService {
dataArr.add(jsonUsed);
int num = haveArr.size() + notHaveArr.size() + usedArr.size();
jsonAll.put("pieSubTest", "总仓位:"+num);
// 获取净重
BigDecimal net_weight = haveArr.stream()
.map(row -> (JSONObject) row)
.filter(row -> !StrUtil.equals(row.getString("sect_code"), "KTP01") && ObjectUtil.isNotEmpty(row.getString("net_weight")))
.map(row -> row.getBigDecimal("net_weight"))
.reduce(BigDecimal.ZERO, BigDecimal::add);
jsonAll.put("pieSubTest", "总仓位: "+num+" "+"总净重: "+ NumberUtil.round(net_weight,2)+"KG");
jsonAll.put("data", dataArr);
jsonAll.put("name", "立库2层统计");
@@ -98,21 +123,20 @@ public class AutoRiKuServiceImpl implements AutoRiKuService {
JSONArray dataArr = new JSONArray();
// 获取有货货位
JSONArray haveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and IFNULL(storagevehicle_code,'') <> '' and layer_num = '3' and is_delete = '0'").getResultJSONArray(0);
JSONArray haveArr = WQL.getWO("AUTORIKU").addParam("flag", "1").addParam("layer_num", "3").process().getResultJSONArray(0);
JSONObject jsonHave = new JSONObject();
jsonHave.put("name", "有货");
jsonHave.put("value", haveArr.size());
// 获取无货货位
JSONArray notHaveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and IFNULL(storagevehicle_code,'') = '' and layer_num = '3' and is_delete = '0'").getResultJSONArray(0);
JSONArray notHaveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01','FTD01') and IFNULL(storagevehicle_code,'') = '' and layer_num = '3' and is_delete = '0'").getResultJSONArray(0);
JSONObject jsonNotHave = new JSONObject();
jsonNotHave.put("name", "空闲");
jsonNotHave.put("value", notHaveArr.size());
// 获取禁用货位
JSONArray usedArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and is_used = '0' and IFNULL(storagevehicle_code,'') = '' and layer_num = '3' and is_delete = '0'").getResultJSONArray(0);
JSONArray usedArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01','FTD01') and is_used = '0' and IFNULL(storagevehicle_code,'') = '' and layer_num = '3' and is_delete = '0'").getResultJSONArray(0);
JSONObject jsonUsed = new JSONObject();
jsonUsed.put("name", "禁用");
@@ -123,7 +147,15 @@ public class AutoRiKuServiceImpl implements AutoRiKuService {
dataArr.add(jsonUsed);
int num = haveArr.size() + notHaveArr.size() + usedArr.size();
jsonAll.put("pieSubTest", "总仓位:"+num);
// 获取净重
BigDecimal net_weight = haveArr.stream()
.map(row -> (JSONObject) row)
.filter(row -> !StrUtil.equals(row.getString("sect_code"), "KTP01") && ObjectUtil.isNotEmpty(row.getString("net_weight")))
.map(row -> row.getBigDecimal("net_weight"))
.reduce(BigDecimal.ZERO, BigDecimal::add);
jsonAll.put("pieSubTest", "总仓位: "+num+" "+"总净重: "+ NumberUtil.round(net_weight,2)+"KG");
jsonAll.put("data", dataArr);
jsonAll.put("name", "立库3层统计");
@@ -138,21 +170,20 @@ public class AutoRiKuServiceImpl implements AutoRiKuService {
JSONArray dataArr = new JSONArray();
// 获取有货货位
JSONArray haveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and IFNULL(storagevehicle_code,'') <> '' and is_delete = '0'").getResultJSONArray(0);
JSONArray haveArr = WQL.getWO("AUTORIKU").addParam("flag", "1").process().getResultJSONArray(0);
JSONObject jsonHave = new JSONObject();
jsonHave.put("name", "有货");
jsonHave.put("value", haveArr.size());
// 获取无货货位
JSONArray notHaveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and IFNULL(storagevehicle_code,'') = '' and is_delete = '0'").getResultJSONArray(0);
JSONArray notHaveArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01','FTD01') and IFNULL(storagevehicle_code,'') = '' and is_delete = '0'").getResultJSONArray(0);
JSONObject jsonNotHave = new JSONObject();
jsonNotHave.put("name", "空闲");
jsonNotHave.put("value", notHaveArr.size());
// 获取禁用货位
JSONArray usedArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01') and is_used = '0' and IFNULL(storagevehicle_code,'') = '' and is_delete = '0'").getResultJSONArray(0);
JSONArray usedArr = attrTab.query("sect_code in ('ZC01','KTP01','ZZ01','PD01','FTD01') and is_used = '0' and IFNULL(storagevehicle_code,'') = '' and is_delete = '0'").getResultJSONArray(0);
JSONObject jsonUsed = new JSONObject();
jsonUsed.put("name", "禁用");
@@ -163,11 +194,37 @@ public class AutoRiKuServiceImpl implements AutoRiKuService {
dataArr.add(jsonUsed);
int num = haveArr.size() + notHaveArr.size() + usedArr.size();
jsonAll.put("pieSubTest", "总仓位:"+num);
// 获取净重
BigDecimal net_weight = haveArr.stream()
.map(row -> (JSONObject) row)
.filter(row -> !StrUtil.equals(row.getString("sect_code"), "KTP01") && ObjectUtil.isNotEmpty(row.getString("net_weight")))
.map(row -> row.getBigDecimal("net_weight"))
.reduce(BigDecimal.ZERO, BigDecimal::add);
jsonAll.put("pieSubTest", "总仓位: "+num+" "+"总净重: "+ NumberUtil.round(net_weight,2)+"KG");
jsonAll.put("data", dataArr);
jsonAll.put("name", "立库汇总统计");
return jsonAll;
}
@Override
public JSONObject queryNum(JSONObject whereJson) {
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
String layer_num = whereJson.getString("layer_num");
// 有货个数
JSONArray haveMoney = pointTab.query("layer_num = '" + layer_num + "' and point_type = '9' and IFNULL(vehicle_code,'')<>'' and is_delete = '0' and is_used = '1'").getResultJSONArray(0);
// 无货个数
JSONArray unMoney = pointTab.query("layer_num = '" + layer_num + "' and point_type = '9' and IFNULL(vehicle_code,'')='' and is_delete = '0' and is_used = '1'").getResultJSONArray(0);
JSONObject result = new JSONObject();
result.put("haveMoney",haveMoney.size());
result.put("unMoney",unMoney.size());
return result;
}
}

View File

@@ -37,4 +37,11 @@ public class AutoWebSocketRiKu {
return new ResponseEntity<>(data, HttpStatus.OK);
}
@PostMapping("/queryNum")
@Log("查询发货区")
@ApiOperation("查询发货区")
public ResponseEntity<Object> queryNum(@RequestBody JSONObject whereJson){
return new ResponseEntity<>(autoRiKuService.queryNum(whereJson), HttpStatus.OK);
}
}

View File

@@ -0,0 +1,69 @@
[交易说明]
交易名: 立库监控
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库为空采用默认值默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.layer_num TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
QUERY
SELECT
attr.*,
sub.net_weight
FROM
st_ivt_structattr attr
LEFT JOIN (
SELECT
SUM(net_weight) AS net_weight,
package_box_sn
FROM
pdm_bi_subpackagerelation
WHERE
1 = 1
group by package_box_sn
) sub ON attr.storagevehicle_code = sub.package_box_sn
WHERE
attr.sect_code in ('ZC01','KTP01','ZZ01','PD01','FTD01')
and IFNULL(attr.storagevehicle_code,'') <> ''
and attr.is_delete = '0'
OPTION 输入.layer_num <> ""
attr.layer_num = 输入.layer_num
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -2,18 +2,20 @@ package org.nl.modules.system.util;
import org.nl.modules.system.service.GenCodeService;
import org.nl.modules.system.service.impl.GenCodeServiceImpl;
import org.nl.modules.wql.util.SpringContextHolder;
import org.springframework.boot.SpringApplication;
import java.util.HashMap;
public class CodeUtil {
public static String getNewCode(String ruleCode){
GenCodeService service=new GenCodeServiceImpl();
GenCodeService bean = SpringContextHolder.getBean(GenCodeService.class);
String flag = "1";
HashMap<String,String> map = new HashMap<>();
map.put("flag",flag);
map.put("code",ruleCode);
return service.codeDemo(map);
return bean.codeDemo(map);
}
}

View File

@@ -78,7 +78,41 @@ public class FaultDeviceServiceImpl implements FaultDeviceService {
JSONObject result = SpringContextHolder.getBean(WmsToAcsServiceImpl.class).realTimefaultInfo(param);
JSONArray data = result.getJSONArray("data");
JSONObject test1 = new JSONObject();
JSONObject result2 = SpringContextHolder.getBean(WmsToAcsServiceImpl.class).queryDeviceInfo(null);
JSONObject jsonData = result2.getJSONObject("data");
JSONArray data1 = new JSONArray();
if (ObjectUtil.isNotEmpty(jsonData)) {
JSONArray jsonA1 = jsonData.getJSONArray("jsonA1");
JSONArray jsonLK = jsonData.getJSONArray("jsonLK");
data1.addAll(jsonA1);
data1.addAll(jsonLK);
}
for (int i = 0; i < data1.size(); i++) {
JSONObject jsonObject = data1.getJSONObject(i);
double electricity = jsonObject.getDoubleValue("electricity");
if (electricity <= 30) {
// 新增一条agv报警信息
JSONObject json = new JSONObject();
String car_no = jsonObject.getString("car_no");
if (StrUtil.equals(car_no, "1")) {
json.put("device_name", "一楼1号AGV");
} else if (StrUtil.equals(car_no, "2")) {
json.put("device_name", "二楼1号AGV");
} else if (StrUtil.equals(car_no, "3")) {
json.put("device_name", "二楼2号AGV");
}
json.put("device_code", jsonObject.getString("car_no"));
json.put("fault_code", "99");
json.put("fault_info", "电量不足");
json.put("fault_type", "agv_error_type");
data.add(json);
}
}
// 根据入参处理对应数据
JSONArray objects = new JSONArray();
@@ -124,7 +158,6 @@ public class FaultDeviceServiceImpl implements FaultDeviceService {
}
// 获取报警码
JSONObject jsonFault = faultTab.query("fault_type = '" + json.getString("fault_type") + "' and fault_code = '" + json.getString("fault_code") + "'").uniqueResult(0);

View File

@@ -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;
@@ -308,6 +325,18 @@ public class StructattrServiceImpl implements StructattrService {
.addParamMap(MapOf.of("struct_id", struct_id, "flag", "2"))
.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("point_id = '" + struct_id + "'")

View File

@@ -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

View File

@@ -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;
@@ -172,7 +173,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
/* // 测试数据
JSONArray data = result.getJSONArray("data");
JSONObject a = new JSONObject();
a.put("electricity", "86");
a.put("electricity", "30");
a.put("status_name", "空闲");
a.put("car_no", "1");
a.put("task_code", "");
@@ -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);
}
@@ -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);
}

View File

@@ -18,7 +18,9 @@ public enum RegionTypeEnum {
ZZ01("15","中转区","1582995342054526976"),
LKRK("16","密集库入库输送线","1585164789083148288"),
LKCK("17","密集库出库输送线","1585167595403874304"),
XN01("18","虚拟区","1586913215886004224");
XN01("18","虚拟区","1586913215886004224"),
PD01("19","盘点区","1645705331612979200")
;
private String name;
private String code;

View File

@@ -13,10 +13,12 @@ import org.nl.modules.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.user.ISysUserService;
import org.nl.system.service.user.dao.SysUser;
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
import org.nl.wms.st.inbill.service.StorPublicService;
import org.nl.wms.st.returns.service.impl.InAndOutRetrunServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -187,17 +189,23 @@ public class InbillServiceImpl {
//回传MES
if (StrUtil.equals(mst_jo.getString("bill_type"), "0001")) {
//1.回传MES
//查询该入库单下的所有箱子回传
JSONArray box_rows = WQL.getWO("QST_IVT_INANDOUTRETRUN").addParam("iostorinv_id",mst_jo.getString("iostorinv_id")).addParam("flag","2").process().getResultJSONArray(0);
for (int j = 0; j < box_rows.size(); j++) {
JSONObject box_row = box_rows.getJSONObject(j);
// 调用接口回传
JSONObject paramMesMst = new JSONObject();
paramMesMst.put("PackageBoxSN",box_row.getString("box_no"));
SysUser sysUser = iSysUserService.getById(box_row.getString("input_optid"));
paramMesMst.put("User",sysUser.getUsername());
// new LmsToMesServiceImpl().childRollFGInboundComplete(paramMesMst);
InAndOutRetrunServiceImpl bean = SpringContextHolder.getBean(InAndOutRetrunServiceImpl.class);
JSONObject param = new JSONObject();
JSONArray rows = new JSONArray();
rows.add(mst_jo);
param.put("rows", rows);
try {
bean.uploadMES(param);
} catch (Exception e) {
System.out.println(e.getMessage());
log.info(e.getMessage());
} finally {
mst_jo.put("is_upload", "1");
mst_jo.put("upload_mes", "1");
mst_jo.put("upload_optid", SecurityUtils.getCurrentUserId());
mst_jo.put("upload_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
}
}
//回传SAP

View File

@@ -35,6 +35,7 @@
输入.sect_id TYPEAS s_string
输入.point_code TYPEAS s_string
输入.row_num TYPEAS s_string
输入.block_num TYPEAS s_string
输入.sql_str TYPEAS f_string
输入.in_stor_id TYPEAS f_string
@@ -805,6 +806,13 @@
AND sa.lock_type = '1'
AND sa.is_delete = '0'
AND sa.is_used = '1'
OPTION 输入.block_num <> ""
sa.block_num <> 输入.block_num
ENDOPTION
OPTION 输入.row_num <> ""
sa.row_num <> 输入.row_num
ENDOPTION
GROUP BY
sa.block_num,
sa.row_num,

View File

@@ -97,4 +97,12 @@ public class HandMoveStorController {
handMoveStorService.handdown(whereJson);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@PostMapping("/checkReturn")
@Log("盘点回库")
@ApiOperation("盘点回库")
public ResponseEntity<Object> checkReturn() {
handMoveStorService.checkReturn();
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -85,4 +85,9 @@ public interface HandMoveStorService {
* @param whereJson /
*/
void handdown(JSONObject whereJson);
/**
* 盘点回库
*/
void checkReturn();
}

View File

@@ -731,12 +731,14 @@ public class CheckServiceImpl implements CheckService {
map.put("物料名称", jo.getString("material_name"));
if (ObjectUtil.isEmpty(jsonSub)) {
map.put("生产日期", "");
map.put("厚度", "");
map.put("幅宽", "");
map.put("标准厚度", "");
map.put("客户要求幅宽", "");
map.put("备注", "");
} else {
map.put("生产日期", jsonSub.getString("date_of_production"));
map.put("厚度", jsonSub.getString("thickness"));
map.put("幅宽", jsonSub.getString("width"));
map.put("标准厚度", jsonSub.getString("thickness_request"));
@@ -863,11 +865,17 @@ public class CheckServiceImpl implements CheckService {
@Transactional(rollbackFor = Exception.class)
public void confirmBtn(JSONObject whereJson) {
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_CheckMst");
WQLObject dtlTab = WQLObject.getWQLObject("st_ivt_checkdtl");
JSONObject jsonMst = mstTab.query("check_id = '" + whereJson.getString("check_id") + "'").uniqueResult(0);
jsonMst.put("status", "99");
mstTab.update(jsonMst);
JSONObject jsonObject = new JSONObject();
jsonObject.put("status", "99");
dtlTab.update(jsonObject,"check_id = '"+whereJson.getString("check_id")+"'");
}
@Override

View File

@@ -1,6 +1,7 @@
package org.nl.wms.st.instor.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@@ -17,19 +18,20 @@ import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.st.inbill.service.RawAssistIStorService;
import org.nl.wms.st.inbill.service.StorPublicService;
import org.nl.wms.st.instor.service.HandMoveStorService;
import org.nl.wms.st.instor.task.EmpMoveTask;
import org.nl.wms.st.instor.task.HandMoveStorAcsTask;
import org.nl.wms.st.outbill.service.impl.CheckOutBillServiceImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* PC端出入库新增
@@ -40,6 +42,7 @@ import java.util.Map;
public class HandMoveStorServiceImpl implements HandMoveStorService {
private final StorPublicService storPublicService;
private final HandMoveStorAcsTask handMoveStorAcsTask;
private final EmpMoveTask empMoveTask;
@Override
public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
@@ -153,39 +156,205 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
@Override
@Transactional(rollbackFor = Exception.class)
public void insertDtl(Map map) {
//主表
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
ArrayList<HashMap> rows = (ArrayList<HashMap>) map.get("tableData");
map.remove("tableData");
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
String moveinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String bill_code = CodeUtil.getNewCode("MOVE_CODE");
String biz_date = (String) map.get("biz_date");
biz_date = biz_date.substring(0, 10);
map.put("moveinv_id", moveinv_id);
map.put("bill_code", bill_code);
map.put("buss_type", "");
map.put("create_mode", "01");
map.put("input_optid", currentUserId + "");
map.put("input_optname", nickName);
map.put("input_time", now);
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_time", now);
map.put("is_delete", "0");
map.put("is_upload", "0");
map.put("biz_date", biz_date);
Long deptId = SecurityUtils.getDeptId();
map.put("sysdeptid", deptId);
map.put("syscompanyid", deptId);
JSONObject jo_mst = JSONObject.parseObject(JSON.toJSONString(map));
//调用明细处理方法
JSONObject ret = this.insertDtlByRows(jo_mst, rows);
map.put("detail_count", ret.getString("detail_count"));
map.put("total_qty", ret.getString("total_qty"));
wo_mst.insert(map);
String bill_type = MapUtil.getStr(map, "bill_type");
if (StrUtil.equals(bill_type, "30")) {
// 辅道移库: 调用辅道出库方法
map = roadInsertDtl(map);
}
if (ObjectUtil.isNotEmpty(map.get("tableData"))) {
//主表
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
ArrayList<Map> rows = (ArrayList<Map>) map.get("tableData");
map.remove("tableData");
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
String moveinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String bill_code = CodeUtil.getNewCode("MOVE_CODE");
String biz_date = (String) map.get("biz_date");
biz_date = biz_date.substring(0, 10);
map.put("moveinv_id", moveinv_id);
map.put("bill_code", bill_code);
map.put("buss_type", "");
map.put("create_mode", "01");
map.put("input_optid", currentUserId + "");
map.put("input_optname", nickName);
map.put("input_time", now);
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_time", now);
map.put("is_delete", "0");
map.put("is_upload", "0");
map.put("biz_date", biz_date);
Long deptId = SecurityUtils.getDeptId();
map.put("sysdeptid", deptId);
map.put("syscompanyid", deptId);
JSONObject jo_mst = JSONObject.parseObject(JSON.toJSONString(map));
//调用明细处理方法
JSONObject ret = this.insertDtlByRows(jo_mst, rows);
map.put("detail_count", ret.getString("detail_count"));
map.put("total_qty", ret.getString("total_qty"));
wo_mst.insert(map);
}
}
@Transactional(rollbackFor = Exception.class)
public Map roadInsertDtl(Map map) {
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
/*
1.货位上是空托盘:直接生成点对点任务
2.货位上是木箱:走正常流程
*/
RawAssistIStorService rawAssistIStorService = SpringContextHolder.getBean(RawAssistIStorService.class);
// 1.找出此区域 第 7 排所有有货货位
String block_num = MapUtil.getStr(map, "block_num");
// 判断此区有没有被锁住的货位
JSONArray resultJSONArray = attrTab.query("block_num = '" + block_num + "' and is_used = '1' and is_delete = '0' and row_num = '7' and lock_type <> '1'").getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(resultJSONArray)) throw new BadRequestException("有正在运行的任务或已锁定未生成任务");
// 找出所有货位
JSONArray boxArr = attrTab.query("block_num = '" + block_num + "' and is_used = '1' and is_delete = '0' and IFNULL(storagevehicle_code,'') <> '' and lock_type = '1' and row_num = '7' order by out_order_seq DESC").getResultJSONArray(0);
// 判断是否是空托盘区
boolean is_ktp = boxArr.stream()
.map(row -> (JSONObject) row)
.anyMatch(row -> StrUtil.equals(row.getString("sect_code"), "KTP01"));
ArrayList<Map> dtlArr = new ArrayList<>();
if (is_ktp) {
// 空托盘
for (int i = 0; i < boxArr.size(); i++) {
JSONObject json = boxArr.getJSONObject(i);
// 调用空托盘入库
JSONObject param = new JSONObject();
param.put("block_num", json.getString("block_num"));
param.put("row_num", json.getString("row_num"));
JSONObject jsonEmp = queryEmp(param);
// 生成空托盘移库任务
JSONObject param2 = new JSONObject();
param2.put("task_type", "010505");
param2.put("task_name", "空托盘转库任务");
param2.put("vehicle_code", json.getString("storagevehicle_code"));
param2.put("point_code1", json.getString("struct_code"));
param2.put("point_code2", jsonEmp.getString("struct_code"));
String task_id = empMoveTask.createTask(param2);
// 下发任务
empMoveTask.immediateNotifyAcs(task_id);
}
} else {
// 货位
for (int i = 0; i < boxArr.size(); i++) {
JSONObject json = boxArr.getJSONObject(i);
// 找到一个移入货位
JSONObject moveParam = new JSONObject();
moveParam.put("box_no", json.getString("storagevehicle_code"));
moveParam.put("sect_id", RegionTypeEnum.ZZ01.getId());
moveParam.put("layer_num", json.getString("layer_num"));
JSONObject jsonMove = rawAssistIStorService.autoDisMove(moveParam);
if (ObjectUtil.isEmpty(jsonMove)) throw new BadRequestException("没有可用暂存位");
// 组织明细
JSONArray jsonIvt = WQL.getWO("QST_IVT_HANDMOVESTOR").addParam("flag", "35").addParam("package_box_sn", json.getString("storagevehicle_code")).process().getResultJSONArray(0);
List<Map> collect = jsonIvt.stream().map(row -> (Map) row).collect(Collectors.toList());
collect.forEach(row -> {
row.put("wrok_status", "10");
row.put("turnin_sect_id", jsonMove.getString("sect_id"));
row.put("turnin_sect_code", jsonMove.getString("sect_code"));
row.put("turnin_sect_name", jsonMove.getString("sect_name"));
row.put("turnin_struct_id", jsonMove.getString("struct_id"));
row.put("turnin_struct_code", jsonMove.getString("struct_code"));
row.put("turnin_struct_name", jsonMove.getString("struct_name"));
dtlArr.add(row);
});
jsonMove.put("lock_type", "7");
attrTab.update(jsonMove);
}
}
map.put("tableData",dtlArr);
return map;
}
@Transactional(rollbackFor = Exception.class)
public JSONObject queryEmp(JSONObject whereJson) {
whereJson.put("flag", "21");
JSONArray emptyArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(whereJson).process().getResultJSONArray(0);
JSONObject struct_jo = new JSONObject();
for (int i = 0; i < emptyArr.size(); i++) {
JSONObject empty_row = emptyArr.getJSONObject(i);
String block_num = empty_row.getString("block_num");
String row_num = empty_row.getString("row_num");
String placement_type = empty_row.getString("placement_type");
JSONArray isLock = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('4','5') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(0);
if (ObjectUtil.isEmpty(isLock)) {
if (placement_type.equals("03")) {
// 右通
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0);
break;
} else if (placement_type.equals("02")) {
// 左通
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
break;
} else {
// 双通
// 先倒序找到第一个托盘、判断上一个是否有货位
JSONObject jsonDescStruct = new JSONObject();
JSONObject jsonDescBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonDescBox)) {
String out_order_seq = jsonDescBox.getString("out_order_seq");
// 上一个货位顺序号
jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
} else {
// 倒序找到第一个空位
jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
}
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
struct_jo = jsonDescStruct;
break;
} else {
// 没有就正序找到第一个托盘、判断上一个是否有货位
JSONObject jsonAscStruct = new JSONObject();
JSONObject jsonAscBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonAscBox)) {
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
// 上一个货位顺序号
jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
} else {
jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
}
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
struct_jo = jsonAscStruct;
break;
}
}
}
} else {
continue;
}
}
if (ObjectUtil.isEmpty(struct_jo)) {
throw new BadRequestException("未查询到可用的空载具存放点位!");
}
return struct_jo;
}
/**
@@ -194,7 +363,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
* @param rows
*/
@Transactional(rollbackFor = Exception.class)
JSONObject insertDtlByRows(JSONObject jo_mst, ArrayList<HashMap> rows) {
JSONObject insertDtlByRows(JSONObject jo_mst, ArrayList<Map> rows) {
//明细表
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_MoveInvDtl");
//主表
@@ -213,9 +382,9 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
HashMap<String, JSONObject> Struct_map = new HashMap<String, JSONObject>();
StringBuffer ids = new StringBuffer();
for (int i = 0; i < rows.size(); i++) {
HashMap<String, String> row = rows.get(i);
Map row = rows.get(i);
JSONObject jo_row = (JSONObject) JSONObject.toJSON(row);
String storagevehicle_code = row.get("storagevehicle_code");
String storagevehicle_code = (String) row.get("storagevehicle_code");
if (i == 0) {
ids.append("'");
}
@@ -388,7 +557,9 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
for (int i = 0; i < rows.size(); i++) {
JSONObject row = rows.getJSONObject(i);
String storagevehicle_code = row.getString("storagevehicle_code");
ids.append("'");
if (i == 0) {
ids.append("'");
}
if (!Struct_map.containsKey(storagevehicle_code)) {
Struct_map.put(storagevehicle_code, row);
}
@@ -441,6 +612,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
task.put("task_id", task_id);
task.put("task_code", task_code);
task.put("task_type", "010505");
task.put("acs_task_type", "7");
task.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
task.put("point_code1", jo.getString("start_point_code"));
task.put("point_code2", point.getString("point_code"));
@@ -522,7 +694,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
//调用删除明细,还原库存方法
this.deleteById(moveinv_id + "");
//获取明细
ArrayList<HashMap> rows = (ArrayList<HashMap>) whereJson.get("tableData");
ArrayList<Map> rows = (ArrayList<Map>) whereJson.get("tableData");
//调用明细处理方法
JSONObject ret = this.insertDtlByRows(jo_mst, rows);
jo_mst.put("remark", whereJson.get("remark"));
@@ -987,6 +1159,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
String now = DateUtil.now();
String moveinv_id = whereJson.getString("moveinv_id");
String bill_type = whereJson.getString("bill_type");
//查询所有载具的库存
JSONArray ja = WQL.getWO("QST_IVT_HANDMOVESTOR")
.addParam("flag", "4")
@@ -999,11 +1172,13 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
JSONObject jo = ja.getJSONObject(i);
String task_id = jo.getString("task_id");
// 判断起点是否被挡
JSONObject jsonTask = wo_Task.query("task_id = '" + task_id + "'").uniqueResult(0);
JSONObject jsonAttr = wo_attr.query("struct_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
// 调用共用判断是否阻挡并生成任务、移库单
this.isBlock(jsonAttr);
if (!StrUtil.equals(bill_type, "30")) {
// 判断起点是否被挡
JSONObject jsonTask = wo_Task.query("task_id = '" + task_id + "'").uniqueResult(0);
JSONObject jsonAttr = wo_attr.query("struct_code = '" + jsonTask.getString("point_code1") + "'").uniqueResult(0);
// 调用共用判断是否阻挡并生成任务、移库单
this.isBlock(jsonAttr);
}
JSONObject result = handMoveStorAcsTask.immediateNotifyAcs(task_id);
JSONObject task = wo_Task.query("task_id='" + task_id + "'").uniqueResult(0);
@@ -1016,11 +1191,11 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
map.put("work_status", "02");
wo_dtl.update(map, "is_issued='0' and task_id='" + task.getString("task_id") + "'");
//更新任务为已下发
map.put("task_status", "02");
map.put("task_status", "05");
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_time", now);
wo_Task.update(map, "is_delete ='0' and task_status='01' and task_id='" + task_id + "'");
wo_Task.update(map, "is_delete ='0' and task_id='" + task_id + "'");
} else {
throw new BadRequestException("任务下发失败,请稍后重试!");
}
@@ -1033,6 +1208,91 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
wo_mst.update(map, "moveinv_id='" + moveinv_id + "'");
}
@Override
@Transactional(rollbackFor = Exception.class)
public void checkReturn() {
/*
* 将所有盘点位上的木箱生成移库单并下发任务
*/
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr"); // 仓位表
// 1.找出所有需要盘点的移库的木箱
JSONArray boxArr = attrTab.query("sect_id = '" + RegionTypeEnum.PD01.getId() + "' and IFNULL(storagevehicle_code,'') <> '' and is_used = '1' and is_delete = '0' order by block_num ASC,out_order_seq DESC").getResultJSONArray(0);
if (ObjectUtil.isEmpty(boxArr)) throw new BadRequestException("没有需要盘点回库的木箱!");
// 2.判断是否有被锁定的木箱
boolean is_lock = boxArr.stream().map(row -> (JSONObject) row)
.anyMatch(row -> !StrUtil.equals(row.getString("lock_type"), "1"));
if (is_lock) throw new BadRequestException("木箱存在被锁定,请检查!");
/* for (int i = 0; i < boxArr.size(); i++) {
JSONObject json = boxArr.getJSONObject(i);
// 3.判断木箱是否存在未完成的盘点单
WQL.getWO("QST_IVT_HANDMOVESTOR").addParam("flag", "8").addParam("storagevehicle_code",json.getString("storagevehicle_code"));
}*/
// 3.判断木箱是否存在未完成的盘点单
boxArr.forEach(row -> {
JSONObject json = WQL.getWO("QST_IVT_HANDMOVESTOR").addParam("flag", "8").addParam("storagevehicle_code", ((JSONObject) row).getString("storagevehicle_code")).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(json))
throw new BadRequestException("此木箱的盘点单据未完成:"+json.getString("storagevehicle_code"));
});
// 4.生成移库单
for (int i = 0; i < boxArr.size(); i++) {
JSONObject json = boxArr.getJSONObject(i);
// 找一个移入仓位
RawAssistIStorService rawAssistIStorService = SpringContextHolder.getBean(RawAssistIStorService.class);
JSONObject moveParamIn = new JSONObject();
moveParamIn.put("box_no", json.getString("storagevehicle_code"));
moveParamIn.put("sect_id", RegionTypeEnum.ZC01.getId());
moveParamIn.put("layer_num", json.getString("layer_num"));
JSONObject jsonMoveIn = rawAssistIStorService.autoDisMove(moveParamIn);
if (ObjectUtil.isEmpty(jsonMoveIn)) throw new BadRequestException("没有可用暂存位");
JSONObject jsonMst = new JSONObject(); // 主表
jsonMst.put("bill_type", "31");
jsonMst.put("buss_type", "31");
jsonMst.put("bill_status", "10");
jsonMst.put("biz_date", DateUtil.today());
jsonMst.put("stor_code", "CP01");
jsonMst.put("stor_id", "1582991156504039424");
jsonMst.put("stor_name", "成品仓库");
jsonMst.put("is_task", "1");
JSONArray dtlArr = new JSONArray(); // 明细
// 组织明细
JSONArray jsonIvt = WQL.getWO("QST_IVT_HANDMOVESTOR").addParam("flag", "35").addParam("package_box_sn", json.getString("storagevehicle_code")).process().getResultJSONArray(0);
jsonIvt.forEach(row -> {
((JSONObject) row).put("wrok_status", "10");
((JSONObject) row).put("turnin_sect_id", jsonMoveIn.getString("sect_id"));
((JSONObject) row).put("turnin_sect_code", jsonMoveIn.getString("sect_code"));
((JSONObject) row).put("turnin_sect_name", jsonMoveIn.getString("sect_name"));
((JSONObject) row).put("turnin_struct_id", jsonMoveIn.getString("struct_id"));
((JSONObject) row).put("turnin_struct_code", jsonMoveIn.getString("struct_code"));
((JSONObject) row).put("turnin_struct_name", jsonMoveIn.getString("struct_name"));
dtlArr.add(row);
});
jsonMst.put("tableData", dtlArr);
String moveinv_id = insertDtl2(jsonMst);
// 下发任务
JSONObject taskParam = new JSONObject();
taskParam.put("moveinv_id",moveinv_id);
taskParam.put("bill_type",jsonMst.getString("jsonMst"));
handdown(taskParam);
}
}
@Transactional(rollbackFor = Exception.class)
public Integer isBlock(JSONObject whereJson) {
String placement_type = whereJson.getString("placement_type");

View File

@@ -0,0 +1,199 @@
package org.nl.wms.st.instor.task;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import org.nl.common.utils.SecurityUtils;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.sch.AcsTaskDto;
import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.st.instor.service.impl.HandMoveStorServiceImpl;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@Component
@RequiredArgsConstructor
public class EmpMoveTask extends AbstractAcsTask {
private final String THIS_CLASS = EmpMoveTask.class.getName();
@Override
public List<AcsTaskDto> addTask() {
/*
* 下发给ACS时需要特殊处理
*/
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
ArrayList<AcsTaskDto> resultList = new ArrayList<>();
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
char dtl_type = json.getString("task_type").charAt(json.getString("task_type").length()-1);
AcsTaskDto dto = AcsTaskDto.builder()
.ext_task_id(json.getString("task_id"))
.task_code(json.getString("task_code"))
.task_type(json.getString("acs_task_type"))
.start_device_code(json.getString("point_code1"))
.next_device_code(json.getString("point_code2"))
.vehicle_code(json.getString("vehicle_code"))
.priority(json.getString("priority"))
.dtl_type(String.valueOf(dtl_type))
.remark(json.getString("remark"))
.build();
resultList.add(dto);
}
return resultList;
}
/**
*
* @param taskObj 代表一条任务对象
* @param status 代表wcs任务完成状态 //1:执行中,2:完成 ,3:acs取消
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateTaskStatus(JSONObject taskObj, String status) {
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task"); //任务表
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr"); // 仓位表
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
String task_id = taskObj.getString("task_id");
if (StrUtil.isEmpty(task_id)) {
throw new BadRequestException("任务id不能为空");
}
JSONObject jsonTask = wo_Task.query("task_id='"+task_id+"'").uniqueResult(0);
if(jsonTask==null){
throw new BadRequestException("查询不到操作的任务记录!");
}
if(TaskStatusEnum.EXECUTING.getCode().equals(status)){
// 执行中
jsonTask.put("task_status", TaskStatusEnum.EXECUTING.getCode());
jsonTask.put("update_time", DateUtil.now());
wo_Task.update(jsonTask);
}else if(TaskStatusEnum.FINISHED.getCode().equals(status)){
// 完成
String currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject param = new JSONObject();
// 更新仓位
param.put("lock_type", "1");
param.put("storagevehicle_code", "");
attrTab.update(param,"struct_code = '"+jsonTask.getString("point_code1")+"'");
param.put("storagevehicle_code",jsonTask.getString("vehicle_code"));
attrTab.update(param,"struct_code = '"+jsonTask.getString("point_code2")+"'");
// 更新点位
JSONObject param2 = new JSONObject();
param2.put("lock_type", "1");
param2.put("vehicle_code", "");
param2.put("point_status", "1");
pointTab.update(param2,"point_code = '"+jsonTask.getString("point_code1")+"'");
param2.put("vehicle_code", jsonTask.getString("vehicle_code"));
param2.put("point_status", "3");
pointTab.update(param2,"point_code = '"+jsonTask.getString("point_code2")+"'");
// 更新任务为完成
jsonTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
jsonTask.put("update_optid", currentUserId);
jsonTask.put("update_optname", currentUsername);
jsonTask.put("update_time", DateUtil.now());
wo_Task.update(jsonTask);
}else if("0".equals(status)){
// 取消
if (jsonTask.getIntValue("task_status") > Integer.valueOf(TaskStatusEnum.START_AND_POINT.getCode())) {
throw new BadRequestException("任务:" + jsonTask.getString("task_code") + "已下发,不可取消");
}
// 更新删除字段
jsonTask.put("is_delete", "1");
jsonTask.put("update_time", DateUtil.now());
wo_Task.update(jsonTask);
// 更新仓位
JSONObject param = new JSONObject();
param.put("lock_type", "1");
attrTab.update(param,"struct_code = '"+jsonTask.getString("point_code1")+"'");
attrTab.update(param,"struct_code = '"+jsonTask.getString("point_code2")+"'");
}else{
throw new BadRequestException("任务状态更新异常!");
}
}
/**
*
* @param form 创建任务需要的参数
* @return
*/
@Override
public String createTask(JSONObject form) {
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
String currentUserId = SecurityUtils.getCurrentUserId();
String currentUsername = SecurityUtils.getCurrentUsername();
JSONObject json = new JSONObject();
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
json.put("task_code", IdUtil.getSnowflake(1, 1).nextId());
json.put("task_type", form.getString("task_type"));
json.put("vehicle_code", form.getString("vehicle_code"));
json.put("task_name", form.getString("task_name"));
json.put("point_code1", form.getString("point_code1"));
json.put("point_code2", form.getString("point_code2"));
json.put("material_id", form.getString("material_id"));
json.put("task_group_id", form.getString("task_group_id"));
json.put("sort_seq", form.getString("sort_seq"));
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
json.put("handle_class", THIS_CLASS);
json.put("create_id", currentUserId);
json.put("create_name", currentUsername);
json.put("create_time", DateUtil.now());
json.put("acs_task_type", "7");
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
// 锁定起点
JSONObject param = new JSONObject();
param.put("lock_type", "4");
attrTab.update(param,"struct_code = '"+form.getString("point_code1")+"'");
// 锁定终点
param.put("lock_type", "5");
attrTab.update(param,"struct_code = '"+form.getString("point_code2")+"'");
return json.getString("task_id");
}
@Override
@Transactional(rollbackFor = Exception.class)
public void forceFinish(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, TaskStatusEnum.FINISHED.getCode());
}
@Override
public void cancel(String task_id) {
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
this.updateTaskStatus(taskObj, "0");
}
}

View File

@@ -160,12 +160,23 @@
struct.sect_code,
mb.material_code,
mb.material_name,
user1.person_name AS process_optname
user1.person_name AS process_optname,
sub.date_of_production
FROM
ST_IVT_CheckDtl CheckDtl
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
LEFT JOIN (
SELECT
MIN(date_of_production) AS date_of_production,
package_box_sn
FROM
pdm_bi_subpackagerelation
WHERE
1=1
group by package_box_sn
) sub ON sub.package_box_sn = CheckDtl.storagevehicle_code
WHERE
CheckDtl.status <> '1'
OPTION 输入.check_id <> ""
@@ -185,12 +196,23 @@
struct.sect_code,
mb.material_code,
mb.material_name,
user1.person_name AS process_optname
user1.person_name AS process_optname,
sub.date_of_production
FROM
ST_IVT_CheckDtl CheckDtl
LEFT JOIN md_me_materialbase mb ON mb.material_id = CheckDtl.material_id
LEFT JOIN st_ivt_structattr struct ON struct.struct_id = CheckDtl.struct_id
LEFT JOIN sys_user user1 ON user1.user_id = CheckDtl.process_optid
LEFT JOIN (
SELECT
MIN(date_of_production) AS date_of_production,
package_box_sn
FROM
pdm_bi_subpackagerelation
WHERE
1=1
group by package_box_sn
) sub ON sub.package_box_sn = CheckDtl.storagevehicle_code
WHERE
CheckDtl.status = '1'
OPTION 输入.check_id <> ""

View File

@@ -219,6 +219,48 @@
ENDPAGEQUERY
ENDIF
IF 输入.flag = "35"
QUERY
SELECT
ivt2.stockrecord_id,
ivt2.material_id,
ivt2.pcsn,
ivt2.quality_scode,
ivt2.qty_unit_id,
ivt2.ivt_qty AS qty,
mb.material_code,
mb.material_name,
struct.struct_id AS turnout_struct_id,
struct.struct_code AS turnout_struct_code,
struct.struct_name AS turnout_struct_name,
struct.sect_id AS turnout_sect_id,
struct.sect_name AS turnout_sect_name,
struct.sect_code AS turnout_sect_code,
struct.storagevehicle_id,
struct.storagevehicle_code,
mu.unit_name AS qty_unit_name,
sub.sale_order_name,
sub.customer_name,
sub.customer_description,
sub.sap_pcsn
FROM
st_ivt_structattr struct
INNER JOIN ST_IVT_StructIvt ivt2 ON struct.struct_id = ivt2.struct_id
LEFT JOIN md_me_materialbase mb ON mb.material_id = ivt2.material_id
LEFT JOIN md_pb_measureunit mu ON mu.measure_unit_id = ivt2.qty_unit_id
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = ivt2.pcsn AND sub.package_box_sn = struct.storagevehicle_code
WHERE
1 = 1
AND struct.lock_type = '1'
OPTION 输入.package_box_sn <> ""
sub.package_box_sn = 输入.package_box_sn
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF
IF 输入.flag = "33"
QUERY
SELECT
@@ -371,5 +413,24 @@
ENDQUERY
ENDIF
IF 输入.flag = "8"
QUERY
SELECT
dtl.*
FROM
st_ivt_checkdtl dtl
LEFT JOIN st_ivt_checkmst mst ON mst.check_id = dtl.check_id
WHERE
mst.is_delete = '0'
and dtl.status not in ('3','5','99')
OPTION 输入.storagevehicle_code <> ""
dtl.storagevehicle_code = 输入.storagevehicle_code
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -3660,11 +3660,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
String struct_code = json.getString("struct_code");
String vehicle_code = json.getString("storagevehicle_code");
JSONObject jsonTask1 = taskTab.query("point_code1 = '" + struct_code + "' and task_status in ('05','06')").uniqueResult(0);
JSONObject jsonTask2 = taskTab.query("point_code2 = '" + struct_code + "' and task_status in ('05','06')").uniqueResult(0);
JSONObject jsonTask1 = taskTab.query("point_code1 = '" + struct_code + "' and task_status in ('05','06','07') and vehicle_code = '"+vehicle_code+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonTask1) || ObjectUtil.isNotEmpty(jsonTask2)) {
if (ObjectUtil.isNotEmpty(jsonTask1)) {
} else {
result.add(json);
@@ -4208,7 +4208,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
jo_mst.put("update_optid", currentUserId + "");
jo_mst.put("update_optname", nickName);
jo_mst.put("update_time", now);
jo_mst.put("out_stor_id", "");
jo_mst.put("out_stor_id", out_jo.getString("stor_id"));
mst_wql.insert(jo_mst);
for (int i = 0; i < dis_rows.size(); i++) {
@@ -4222,9 +4222,10 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
dis_row.put("seq_no", i + 1);
dis_row.put("bill_status", "30");
dis_row.put("real_qty", "0");
dis_row.put("vbeln", dtl_row.getString("vbeln"));
dis_row.put("source_billdtl_id", dtl_row.getString("iostorinvdtl_id"));
dis_row.put("source_bill_type", mst_row.getString("bill_type"));
dis_row.put("source_bill_code", mst_row.getString("bill_code"));
dis_row.put("source_bill_code", dtl_row.getString("source_bill_code"));
dis_row.put("source_bill_table", "ST_IVT_IOStorInvDtl");
dis_row.put("assign_qty", dis_row.getString("plan_qty"));
dis_row.put("unassign_qty", "0");

View File

@@ -2,6 +2,7 @@ package org.nl.wms.st.returns.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
@@ -534,20 +535,20 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject jsonDis = disArr.getJSONObject(j);
JSONObject paramDis = new JSONObject();
paramDis.put("ZDBSQD", jsonDtl.getString("vbeln"));
paramDis.put("VBELN", jsonDtl.getString("source_bill_code"));
paramDis.put("ZVBELN", jsonDtl.getString("source_bill_code"));
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
paramDis.put("MATNR", jsonMater.getString("material_code"));
paramDis.put("LGORT1", jo_mst.getString("stor_code"));
paramDis.put("LGORT2", jo_mst.getString("stor_code"));
JSONObject jsonStorOut = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_id = '" + jo_mst.getString("out_stor_id") + "'").uniqueResult(0);
paramDis.put("LGORT2", jsonStorOut.getString("stor_code"));
paramDis.put("LGORT1", jsonStorOut.getString("stor_code"));
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "'").uniqueResult(0);
paramDis.put("ZHL02", jsonSub.getString("width"));
paramDis.put("ZZWLHD", jsonSub.getString("thickness"));
paramDis.put("CHARG", jsonDis.getString("pcsn"));
paramDis.put("KALAB", jsonDis.getString("plan_qty"));
paramDis.put("CHARG", jsonSub.getString("sap_pcsn"));
paramDis.put("KALAB", NumberUtil.round(jsonDis.getDoubleValue("plan_qty"),3));
paramDis.put("WERKS", "2460");
paramSapMstArr.add(paramDis);
}
@@ -563,7 +564,6 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
jo_mst.put("upload_optid", SecurityUtils.getCurrentUserId());
jo_mst.put("upload_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(jo_mst);
}
// 改切出库
@@ -881,20 +881,20 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService {
JSONObject jsonDis = disArr.getJSONObject(j);
JSONObject paramDis = new JSONObject();
paramDis.put("ZDBSQD", jsonDtl.getString("vbeln"));
paramDis.put("VBELN", jsonDtl.getString("source_bill_code"));
paramDis.put("ZVBELN", jsonDtl.getString("source_bill_code"));
JSONObject jsonMater = materTab.query("material_id = '" + jsonDis.getString("material_id") + "'").uniqueResult(0);
paramDis.put("MATNR", jsonMater.getString("material_code"));
paramDis.put("LGORT1", jo_mst.getString("stor_code"));
paramDis.put("LGORT2", jo_mst.getString("stor_code"));
JSONObject jsonStorOut = WQLObject.getWQLObject("st_ivt_bsrealstorattr").query("stor_id = '" + jo_mst.getString("out_stor_id") + "'").uniqueResult(0);
paramDis.put("LGORT2", jsonStorOut.getString("stor_code"));
paramDis.put("LGORT1", jsonStorOut.getString("stor_code"));
JSONObject jsonSub = subTab.query("container_name = '" + jsonDis.getString("pcsn") + "'").uniqueResult(0);
paramDis.put("ZHL02", jsonSub.getString("width"));
paramDis.put("ZZWLHD", jsonSub.getString("thickness"));
paramDis.put("CHARG", jsonDis.getString("pcsn"));
paramDis.put("KALAB", jsonDis.getString("plan_qty"));
paramDis.put("CHARG", jsonSub.getString("sap_pcsn"));
paramDis.put("KALAB", NumberUtil.round(jsonDis.getDoubleValue("plan_qty"),3));
paramDis.put("WERKS", "2460");
paramSapMstArr.add(paramDis);
}

View File

@@ -6,6 +6,7 @@ import green from '../../../image/green.svg'
import yellow from '../../../image/yellow.svg'
import grey from '../../../image/grey.svg'
import blue from '../../../image/blue.svg'
import red from '../../../image/red.svg'
class ButtonNodeModel extends HtmlResize.model {
initNodeData(data) {
@@ -47,6 +48,9 @@ class ButtonNode extends HtmlResize.view {
case 4:
imageUrl = grey
break
case 5:
imageUrl = red
break
default:
break
}

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1681192570476" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2046" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M891.050667 248.149333A101.888 101.888 0 0 0 820.352 213.333333H205.056a114.773333 114.773333 0 0 0-73.088 33.536C112.426667 266.410667 0 447.914667 0 486.144v244.053333c0.170667 18.432 7.68 36.053333 20.821333 48.896 13.397333 12.970667 31.317333 20.181333 49.92 20.053334h882.56c18.56 0.128 36.522667-7.082667 49.877334-20.096 13.141333-12.885333 20.650667-30.378667 20.821333-48.810667v-244.053333c0-38.272-132.992-238.037333-132.992-238.037334z m-227.669334 216.362667a32.981333 32.981333 0 0 0-33.792 23.765333v4.992a115.285333 115.285333 0 0 1-230.4-6.570666 36.437333 36.437333 0 0 0-32.682666-22.442667H76.288l98.901333-167.253333s19.797333-32.426667 38.613334-32.213334h616.021333c13.866667 7.296 25.344 18.346667 33.237333 31.914667l97.066667 167.808h-296.874667 0.128z" fill="#FF0000" p-id="2047"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -30,3 +30,11 @@ export function autoWeb() { // 查询立库监控数据
method: 'post'
})
}
export function queryNum(data) { // 获取个数
return request({
url: 'api/autoWeb/queryNum',
method: 'post',
data
})
}

View File

@@ -33,7 +33,7 @@
<!-- <div v-if="agvObj.car_no === '' || agvObj.car_no == null" class="grid-content bg-purple" style="height: 250px;background-color: white;border-bottom:3px solid rgb(240, 242, 245)">-->
<!-- 请添加更多AGV设备-->
<!-- </div>-->
<div v-if="agvObj.car_no !== '' && agvObj.car_no != null" class="grid-content bg-purple" style="height: 350px;background-color: white;border-bottom:0px solid rgb(240, 242, 245)">
<div v-if="agvObj.car_no !== '' && agvObj.car_no != null" class="grid-content bg-purple" style="height: 400px;background-color: white;border-bottom:0px solid rgb(240, 242, 245)">
<el-row>
<el-col :span="8">
<img
@@ -91,6 +91,16 @@
</el-col>
</div>
</el-row>
<el-row>
<div class="grid-content bg-purple" style="height: 50px;">
<el-col :span="8" style="line-height: 40px; text-align: center">
运行时长
</el-col>
<el-col :span="16" style="line-height: 40px; text-align: center">
{{ agvObj.run_time }}
</el-col>
</div>
</el-row>
<el-row>
<div v-if="form.flag === '5'" class="grid-content bg-purple" style="padding-left: 400px; padding-top: 30px">
<el-button

View File

@@ -146,6 +146,7 @@ export default {
}
},
mounted() {
this.query.is_fault = '1'
this.init()
},
beforeDestroy() {

View File

@@ -9,18 +9,24 @@
@open="open"
>
<!-- 搜索 -->
<el-row>
<el-col :span="6">
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="库区">
<el-cascader
v-model="query.sect"
v-model="defaultList"
placeholder="所属库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-col>
<el-col :span="6">
</el-form-item>
<el-form-item label="货位">
<el-input
v-model="query.search"
clearable
@@ -29,12 +35,11 @@
placeholder="输入货位编码、名称"
prefix-icon="el-icon-search"
class="filter-item"
/> </el-col>
/>
</el-form-item>
<el-col :span="6">
<rrOperation />
</el-col>
</el-row>
<rrOperation />
</el-form>
<!--表格渲染-->
<el-table
ref="table"
@@ -94,7 +99,11 @@ export default {
},
storId: {
type: String,
default: null
default: String
},
layerNum: {
type: String,
default: String
}
},
data() {
@@ -106,7 +115,8 @@ export default {
checkrow: {},
rows: [],
dialogDis: true,
lock: ''
lock: '',
defaultList: ['1582991156504039424', '1645705331612979200']
}
},
watch: {
@@ -117,7 +127,6 @@ export default {
},
sectProp: {
handler(newValue, oldValue) {
debugger
this.sect = newValue
}
}
@@ -132,33 +141,21 @@ export default {
this.lock = '1'
},
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.stor_id = this.storId
this.crud.query.layer_num = this.layerNum
this.query.lock_type = this.lock
if (this.storId === this.defaultList[0]) {
this.crud.query.sect_id = this.defaultList[1]
}
return true
},
open() {
crudUserStor.getSect({ 'stor_id': this.storId }).then(res => {
this.sects = res.content
})
if (this.sect) {
this.query.sect = this.sect
if (this.sect.length === 1) {
this.query.stor_id = this.sect[0]
this.query.stor_id = this.storId
}
if (this.sect.length === 0) {
this.query.sect_id = ''
this.query.stor_id = ''
}
if (this.sect.length === 2) {
this.query.stor_id = this.sect[0]
this.query.sect_id = this.sect[1]
}
}
this.query.is_lock = '1'
this.query.lock_type = this.lock
this.query.is_used = '1'
debugger
this.query.stor_id = this.storId
this.crud.toQuery()
},
handleSelectionChange(val, row) {
@@ -182,6 +179,7 @@ export default {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = val[1]
}
this.crud.toQuery()
},
onSelectAll() {
this.$refs.table.clearSelection()

View File

@@ -1,5 +1,31 @@
<template>
<div>
<el-row style="padding-top: 10px;padding-left: 10px;padding-bottom: 30px">
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="立库层数">
<el-select
v-model="stageParam"
size="mini"
placeholder="请选择"
class="filter-item"
@change="changeStage"
>
<el-option
v-for="item in layerList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div id="container" className="container" />
</el-row>
@@ -70,7 +96,12 @@ export default {
},
allStructMsg: [],
msgTop: '200px',
msgLeft: '200px'
msgLeft: '200px',
layerList: [
{ 'label': '立库1层', 'value': 'AS_1' },
{ 'label': '立库2层', 'value': 'AS_2' },
{ 'label': '立库3层', 'value': 'AS_3' }
]
}
},
mounted() {
@@ -188,8 +219,13 @@ export default {
// 以下是设置参数显示值
for (const val in data1) {
if (val === 'storagevehicle_code' && data1.storagevehicle_code) {
const obj = { name: '木箱号', value: data1[val] }
this.arr.push(obj)
if (data1.sect_code === 'KTP01') {
const obj = { name: '托盘号', value: data1[val] }
this.arr.push(obj)
} else {
const obj = { name: '木箱号', value: data1[val] }
this.arr.push(obj)
}
}
if (val === 'quanlity_in_box' && data1.quanlity_in_box) {
const obj = { name: '子卷数', value: data1[val] }
@@ -207,6 +243,10 @@ export default {
const obj = { name: '木箱总重', value: data1[val] }
this.arr.push(obj)
}
if (val === 'container_weight' && data1.container_weight) {
const obj = { name: '子卷净重', value: data1[val] }
this.arr.push(obj)
}
}
if (data.length > 1) { // 显示子卷
for (let i = 0; i < data.length; i++) {
@@ -227,6 +267,9 @@ export default {
}
}
}
},
changeStage() {
this.initStageData()
}
}
}

View File

@@ -66,6 +66,9 @@ export default {
title: {
text: this.chartData.name,
subtext: this.chartData.pieSubTest,
subtextStyle: {
'color': '#333'
},
left: 'center'
},
tooltip: {
@@ -83,6 +86,13 @@ export default {
type: 'pie',
radius: '70%',
center: ['50%', '58%'],
avoidLabelOverlap: true,
label: {
show: true,
position: 'outside',
formatter: `{b}:{c}`,
fontSize: 14
},
data: this.chartData.data,
emphasis: {
itemStyle: {

View File

@@ -188,8 +188,13 @@ export default {
// 以下是设置参数显示值
for (const val in data1) {
if (val === 'storagevehicle_code' && data1.storagevehicle_code) {
const obj = { name: '木箱号', value: data1[val] }
this.arr.push(obj)
if (data1.sect_code === 'KTP01') {
const obj = { name: '托盘号', value: data1[val] }
this.arr.push(obj)
} else {
const obj = { name: '木箱号', value: data1[val] }
this.arr.push(obj)
}
}
if (val === 'quanlity_in_box' && data1.quanlity_in_box) {
const obj = { name: '子卷数', value: data1[val] }
@@ -207,6 +212,10 @@ export default {
const obj = { name: '木箱总重', value: data1[val] }
this.arr.push(obj)
}
if (val === 'container_weight' && data1.container_weight) {
const obj = { name: '子卷净重', value: data1[val] }
this.arr.push(obj)
}
}
if (data.length > 1) { // 显示子卷
for (let i = 0; i < data.length; i++) {

View File

@@ -188,8 +188,13 @@ export default {
// 以下是设置参数显示值
for (const val in data1) {
if (val === 'storagevehicle_code' && data1.storagevehicle_code) {
const obj = { name: '木箱号', value: data1[val] }
this.arr.push(obj)
if (data1.sect_code === 'KTP01') {
const obj = { name: '托盘号', value: data1[val] }
this.arr.push(obj)
} else {
const obj = { name: '木箱号', value: data1[val] }
this.arr.push(obj)
}
}
if (val === 'quanlity_in_box' && data1.quanlity_in_box) {
const obj = { name: '子卷数', value: data1[val] }
@@ -207,6 +212,10 @@ export default {
const obj = { name: '木箱总重', value: data1[val] }
this.arr.push(obj)
}
if (val === 'container_weight' && data1.container_weight) {
const obj = { name: '子卷净重', value: data1[val] }
this.arr.push(obj)
}
}
if (data.length > 1) { // 显示子卷
for (let i = 0; i < data.length; i++) {

View File

@@ -1,5 +1,47 @@
<template>
<div>
<el-row style="padding-top: 10px;padding-left: 10px;padding-bottom: 30px">
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="100px"
label-suffix=":"
>
<el-form-item label="发货区层数">
<el-select
v-model="stageParam"
size="mini"
placeholder="请选择"
class="filter-item"
@change="changeStage"
>
<el-option
v-for="item in layerList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="有货点位">
<el-input
v-model="numData.haveMoney"
disabled
style="width: 80px"
size="mini"
/>
</el-form-item>
<el-form-item label="无货点位">
<el-input
v-model="numData.unMoney"
disabled
style="width: 80px"
size="mini"
/>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div id="container" className="container" />
</el-row>
@@ -56,7 +98,7 @@ import '@logicflow/extension/lib/style/index.css'
import { LogicFlow } from '@logicflow/core'
import { registerCustomElement } from '@/views/system/logicflow/editor/components/node'
import { getStructByCodesFs, unLockPoint } from '@/views/system/monitor/device/structStage'
import { getStructByCodesFs, unLockPoint, queryNum } from '@/views/system/monitor/device/structStage'
let data = {}
let lf = ''
export default {
@@ -82,11 +124,21 @@ export default {
},
allStructMsg: [],
msgTop: '200px',
msgLeft: '200px'
msgLeft: '200px',
layerList: [
{ 'label': '发货1层', 'value': 'FS_1' },
{ 'label': '发货2层', 'value': 'FS_2' }
],
numData: {
haveMoney: null,
unMoney: null
},
layerNum: '1'
}
},
mounted() {
this.init()
this.queryNum()
},
beforeDestroy() {
// js提供的clearInterval方法用来清除定时器
@@ -176,10 +228,12 @@ export default {
this.timer = setInterval(() => { // 定时刷新设备的状态信息
console.log('定时器启动')
this.initStatus()
this.queryNum()
}, 10000)
},
initStatus() { // 初始化数据
let resion = {}
debugger
resion = lf.getGraphData().nodes.map(item => ({ id: item.id, struct_id: item.properties.struct_id }))
getStructByCodesFs(resion).then(res => {
this.allStructMsg = res
@@ -231,6 +285,10 @@ export default {
const obj = { name: '木箱总重', value: data1[val] }
this.arr.push(obj)
}
if (val === 'container_weight' && data1.container_weight) {
const obj = { name: '子卷净重', value: data1[val] }
this.arr.push(obj)
}
}
if (data.length > 1) { // 显示子卷
for (let i = 0; i < data.length; i++) {
@@ -264,11 +322,27 @@ export default {
unLockPoint(this.form).then(res => {
this.dialogFormVisible1 = false
this.initStageData()
this.queryNum()
this.$message({
message: '解绑成功',
type: 'success'
})
})
},
changeStage(value) {
if (value === 'FS_1') {
this.layerNum = '1'
} else if (value === 'FS_2') {
this.layerNum = '2'
}
this.initStageData()
this.queryNum()
},
queryNum() {
queryNum({ 'layer_num': this.layerNum }).then(res => {
this.numData.haveMoney = res.haveMoney
this.numData.unMoney = res.unMoney
})
}
}
}

View File

@@ -69,7 +69,7 @@
>
<el-option
v-for="item in dict.ST_INV_TYPE_MV"
:disabled="item.value === '21'"
:disabled="item.value === '21' || item.value === '31'"
:key="item.value"
:label="item.label"
:value="item.value"
@@ -117,6 +117,22 @@
:disabled="crud.status.view > 0"
/>
</el-form-item>
<el-form-item v-if="form.bill_type === '30'" label="所属区域" prop="block_num">
<el-select
v-model="form.block_num"
clearable
placeholder="所属区域"
class="filter-item"
:disabled="crud.status.view > 0"
>
<el-option
v-for="item in blockList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input
@@ -137,6 +153,7 @@
<slot name="left" />
<el-button
slot="left"
v-if="form.bill_type !== '30'"
class="filter-item"
type="primary"
icon="el-icon-plus"
@@ -229,7 +246,7 @@
</el-table-column>
</el-table>
<AddDtl :dialog-show.sync="dtlShow" :stor-id="storId" @tableChanged="tableChanged" />
<StructDiv ref="child" :dialog-show.sync="structShow" @tableChanged="structChanged" />
<StructDiv ref="child" :layer-num="layer_num" :stor-id="storId" :dialog-show.sync="structShow" @tableChanged="structChanged" />
</el-dialog>
</template>
@@ -243,9 +260,10 @@ import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
const defaultForm = {
bill_code: '',
stor_id: '',
stor_code: '',
stor_name: '',
stor_id: '1582991156504039424',
stor_code: 'AC01',
stor_name: '兰州仓库',
block_num: null,
bill_status: '10',
total_qty: '0',
detail_count: '0',
@@ -278,6 +296,42 @@ export default {
nowindex: '',
storlist: [],
invtypelist: [],
layer_num: null,
blockList: [
{ 'label': '101', 'value': '101' },
{ 'label': '103', 'value': '103' },
{ 'label': '105', 'value': '105' },
{ 'label': '107', 'value': '107' },
{ 'label': '109', 'value': '109' },
{ 'label': '111', 'value': '111' },
{ 'label': '113', 'value': '113' },
{ 'label': '115', 'value': '115' },
{ 'label': '117', 'value': '117' },
{ 'label': '119', 'value': '119' },
{ 'label': '121', 'value': '121' },
{ 'label': '201', 'value': '201' },
{ 'label': '203', 'value': '203' },
{ 'label': '205', 'value': '205' },
{ 'label': '207', 'value': '207' },
{ 'label': '209', 'value': '209' },
{ 'label': '211', 'value': '211' },
{ 'label': '213', 'value': '213' },
{ 'label': '215', 'value': '215' },
{ 'label': '217', 'value': '217' },
{ 'label': '219', 'value': '219' },
{ 'label': '221', 'value': '221' },
{ 'label': '301', 'value': '301' },
{ 'label': '303', 'value': '303' },
{ 'label': '305', 'value': '305' },
{ 'label': '307', 'value': '307' },
{ 'label': '309', 'value': '309' },
{ 'label': '311', 'value': '311' },
{ 'label': '313', 'value': '313' },
{ 'label': '315', 'value': '315' },
{ 'label': '317', 'value': '317' },
{ 'label': '319', 'value': '319' },
{ 'label': '321', 'value': '321' }
],
rules: {
stor_id: [
{ required: true, message: '仓库不能为空', trigger: 'blur' }
@@ -319,7 +373,6 @@ export default {
})
},
[CRUD.HOOK.afterToView]() {
debugger
handmovestor.getOutBillDtl({ 'moveinv_id': this.form.moveinv_id }).then(res => {
this.form.tableData = res
// 将明细变成不可编辑
@@ -331,7 +384,6 @@ export default {
})
},
bill_statusFormat(row) {
debugger
return this.dict.label.work_status[row.work_status]
},
quality_scodeFormat(row) {
@@ -350,6 +402,7 @@ export default {
this.form.stor_name = item.stor_name
}
})
this.form.tableData = []
},
async queryDtl() {
if (!this.form.stor_id) {
@@ -359,6 +412,7 @@ export default {
this.dtlShow = true
},
async queryStruct(index, row) {
this.layer_num = row.turnout_struct_code.charAt(row.turnout_struct_code.length - 1)
this.structShow = true
this.$refs.child.getMsg(false)
this.nowindex = index
@@ -467,13 +521,20 @@ export default {
}
},
[CRUD.HOOK.beforeSubmit]() {
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form.tableData.length; i++) {
if (!this.form.tableData[i].edit) {
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
if (this.form.bill_type !== '30') {
if (this.form.tableData.length === 0) {
this.crud.notify('请至少选择一条明细', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
for (let i = 0; i < this.form.tableData.length; i++) {
if (!this.form.tableData[i].edit) {
this.crud.notify('尚有未完成编辑的物料明细序号' + (i + 1) + ',请检查!')
return false
}
}
} else {
if (!this.form.block_num) {
this.crud.notify('请选择所属区域', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}

View File

@@ -9,18 +9,36 @@
@close="close"
@open="open"
>
<el-row>
<el-col :span="5">
<!-- 搜索 -->
<!-- 搜索 -->
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<el-form-item label="库区">
<el-cascader
v-model="defaultList"
placeholder="库区"
:options="sects"
:props="{ checkStrictly: true }"
clearable
@change="sectQueryChange"
/>
</el-col>
<el-col :span="5">
</el-form-item>
<el-form-item label="木箱">
<el-input
v-model="query.package_box_sn"
clearable
size="mini"
placeholder="木箱号模糊查询"
style="width: 200px;"
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<el-form-item label="货位">
<el-input
v-model="query.struct_code"
clearable
@@ -30,8 +48,8 @@
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-col>
<el-col :span="5">
</el-form-item>
<el-form-item label="物料">
<el-input
v-model="query.remark"
clearable
@@ -41,8 +59,8 @@
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-col>
<el-col :span="5">
</el-form-item>
<el-form-item label="批次">
<el-input
v-model="query.pcsn"
clearable
@@ -52,12 +70,9 @@
class="filter-item"
@keyup.enter.native="crud.toQuery"
/>
</el-col>
<el-col :span="4">
<rrOperation />
</el-col>
</el-row>
</el-form-item>
<rrOperation />
</el-form>
<!--表格渲染-->
<div style="padding: 10px" />
<el-table
@@ -135,7 +150,8 @@ export default {
dialogVisible: false,
opendtlParam: '',
sects: [],
rows: []
rows: [],
defaultList: ['1582991156504039424', '1582991348217286656']
}
},
watch: {
@@ -153,6 +169,9 @@ export default {
methods: {
[CRUD.HOOK.beforeRefresh]() {
this.crud.query.stor_id = this.storId
if (this.storId === this.defaultList[0]) {
this.crud.query.sect_id = this.defaultList[1]
}
},
open() {
crudUserStor.getSect({ 'stor_id': this.storId }).then(res => {
@@ -186,6 +205,7 @@ export default {
this.crud.query.stor_id = val[0]
this.crud.query.sect_id = val[1]
}
this.crud.toQuery()
},
submit() {
debugger

View File

@@ -73,4 +73,11 @@ export function getBoxIvt(data) {
data
})
}
export default { add, edit, del, getOutBillDtl,getStructIvt,confirm,getInvTypes,handdown, getBoxIvt }
export function checkReturn() {
return request({
url: '/api/handmovestor/checkReturn',
method: 'post'
})
}
export default { add, edit, del, getOutBillDtl,getStructIvt,confirm,getInvTypes,handdown, getBoxIvt, checkReturn }

View File

@@ -140,6 +140,17 @@
>
强制确认
</el-button>
<el-button
slot="right"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
:loading="checkReturnLoading"
@click="checkReturn"
>
盘点回库
</el-button>
</crudOperation>
<!--表格渲染-->
<el-table
@@ -231,7 +242,8 @@ export default {
mstrow: {},
loadingConfirm: false,
currentRow: null,
storlist: []
storlist: [],
checkReturnLoading: false
}
},
mounted: function() {
@@ -303,6 +315,17 @@ export default {
return row.bill_status !== '99'
},
taskOpen() {
this.loadingConfirm = true
debugger
const a = this.currentRow
handmovestor.handdown({ 'moveinv_id': this.currentRow.moveinv_id, 'bill_type': this.currentRow.bill_type }).then(res => {
this.querytable()
this.loadingConfirm = false
}).catch(() => {
this.loadingConfirm = false
})
},
taskOpen2() {
this.loadingConfirm = true
handmovestor.handdown({ 'moveinv_id': this.currentRow.moveinv_id }).then(res => {
this.querytable()
@@ -320,6 +343,16 @@ export default {
this.onSelectAll()
this.crud.toQuery()
this.handleCurrentChange(null)
},
checkReturn() {
this.checkReturnLoading = true
handmovestor.checkReturn().then(res => {
this.crud.toQuery()
this.crud.notify('操作成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.checkReturnLoading = false
}).catch(() => {
this.checkReturnLoading = false
})
}
}
}