This commit is contained in:
2024-05-16 18:57:46 +08:00
8 changed files with 55 additions and 102 deletions

View File

@@ -201,27 +201,32 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
updateWrapper.set("box_group", maxBoxGroup);
updateWrapper.in("workorder_id", entityList);
pdmBiSubpackagerelationMapper.update(null, updateWrapper);
//下发空木箱出库任务
JSONObject boxInfo = new JSONObject();
//todo 测试暂时默认ZXQ_1_1
boxInfo.put("device_code", "ZXQ_1_1");
boxInfo.put("material_code", boxType);
boxInfo.put("num", entityList.size());
String boxSn = outBoxManageService.outBox(boxInfo);
if (StringUtils.isBlank(boxSn)) {
throw new BadRequestException("满轴缓存位 -> 待检区,木箱码不能为空!");
}
//更新子卷包装关系更新木箱号
UpdateWrapper<PdmBiSubpackagerelation> updateWrapper1 = new UpdateWrapper<>();
updateWrapper1.set("package_box_sn", boxSn);
updateWrapper1.in("workorder_id", entityList);
pdmBiSubpackagerelationMapper.update(null, updateWrapper1);
//下发空木箱出库任务
//outBox(entityList, boxType);
//下发装箱区桁架任务
transferToPacking(packagerelationList);
} catch (Exception e) {
throw new BadRequestException(e.getMessage());
}
}
private void outBox(List<String> entityList, String boxType) {
JSONObject boxInfo = new JSONObject();
//todo 测试暂时默认ZXQ_1_1
boxInfo.put("device_code", "ZXQ_1_1");
boxInfo.put("material_code", boxType);
boxInfo.put("num", entityList.size());
String boxSn = outBoxManageService.outBox(boxInfo);
if (StringUtils.isBlank(boxSn)) {
throw new BadRequestException("满轴缓存位 -> 待检区,木箱码不能为空!");
}
//更新子卷包装关系更新木箱号
UpdateWrapper<PdmBiSubpackagerelation> updateWrapper1 = new UpdateWrapper<>();
updateWrapper1.set("package_box_sn", boxSn);
updateWrapper1.in("workorder_id", entityList);
pdmBiSubpackagerelationMapper.update(null, updateWrapper1);
}
private void transferToPacking(List<PdmBiSubpackagerelation> packagerelationList) {
//创建子卷搬运到装箱区任务
// List<BstIvtPackageinfoivt> zxqPointList = packageinfoivtService

View File

@@ -145,7 +145,7 @@ public class SlitterTaskUtil {
param.put("currentRight", plan.getFRP_material());
param.put("currentRightSize", plan.getFRP_model().split("\\|")[2].charAt(0));
}
param.put("currentLeftSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
param.put("currentRightSpec", SlitterTaskUtil.getPaperTubeInformation(plan));
}
}
}

View File

@@ -263,35 +263,26 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
// 库区表
WQLObject sectTab = WQLObject.getWQLObject("st_ivt_sectattr");
// 参数类型转换 Map-> JSONObject
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(whereJson));
// 分配明细集合
ArrayList<HashMap> list = (ArrayList<HashMap>) whereJson.get("tableMater");
// 类型转换linkenHashMap -> JSONObject
JSONObject jsonDis = list.stream()
.map(row -> JSONObject.parseObject(JSON.toJSONString(row)))
.collect(Collectors.toList()).get(0);
// 判断当前木箱是否已经分配过货位
StIvtIostorinvdis disDao = iStIvtIostorinvdisService.getById(jsonDis.getString("iostorinvdis_id"));
if (ObjectUtil.isNotEmpty(disDao.getStruct_id())) {
throw new BadRequestException("该木箱已经分配过货位,无法继续分配!");
}
// 主表实体类
StIvtIostorinv mstDao = this.getById(disDao.getIostorinv_id());
// 用于锁定货位
JSONObject jsonLock = new JSONObject();
ArrayList<String> paramLockList = new ArrayList<>();
// 仓位对象
JSONObject jsonAttr;
// 是否自动分配货位
Boolean checked = jsonObject.getBoolean("checked");
if (ObjectUtil.isNotEmpty(checked) && checked) {
@@ -301,11 +292,12 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
attrParam.put("sect_id", jsonObject.getString("sect_id"));
attrParam.put("material_id", disDao.getMaterial_id());
attrParam.put("box_no", disDao.getBox_no());
// 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, disDao.getBox_no())
);
BstIvtBoxinfo boxDao = getBstIvtBoxinfo(whereJson);
if (boxDao == null) {
throw new BadRequestException("未找到该木箱信息!");
}
jsonObject.put("box_no",boxDao.getBox_no());
jsonObject.put("vehicle_type",boxDao.getVehicle_type());
attrParam.put("vehicle_type", boxDao.getVehicle_type());
//根据木箱高度,判断入库仓位的高度
String height = "";
@@ -320,9 +312,7 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
height = "3";
}
attrParam.put("height", height);
JSONObject jsonSect = sectTab.query("sect_id = '" + jsonObject.getString("sect_id") + "'").uniqueResult(0);
// 判断是否是虚拟区
if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
jsonAttr = attrTab.query("sect_id = '" + jsonObject.getString("sect_id") + "' AND lock_type = '1' AND is_delete = '0' AND IFNULL( storagevehicle_code, '' ) = ''").uniqueResult(0);
@@ -333,25 +323,20 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
// 指定分配
jsonAttr = attrTab.query("struct_id = '" + jsonDis.getString("struct_id") + "'").uniqueResult(0);
}
if (ObjectUtil.isEmpty(jsonAttr)) {
throw new BadRequestException("没有可用仓位!");
}
// 调用业务处理类锁定货位
paramLockList.add(jsonAttr.getString("struct_code"));
jsonLock.put("inv_type", mstDao.getBill_type());
jsonLock.put("inv_id", mstDao.getIostorinv_id());
jsonLock.put("inv_code", mstDao.getBill_code());
jsonLock.put("lock_type", IOSEnum.LOCK_TYPE.code("入库锁"));
jsonLock.put("operate", IOSEnum.IO_TYPE.code("入库"));
inBussManageService.lockStruct(paramLockList, jsonLock);
// 判断是否虚拟区
String work_status;
Long task_id = null;
JSONObject jsonSect = sectTab.query("sect_id = '" + jsonAttr.getString("sect_id") + "'").uniqueResult(0);
if (jsonSect.getString("sect_type_attr").equals(IOSEnum.SECT_TYPE.code("虚拟区"))) {
// 虚拟区:执行状态为完成
@@ -360,7 +345,6 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
} else {
work_status = IOSEnum.WORK_STATUS.code("未生成");
}
// 更新分配明细
iStIvtIostorinvdisService.update(
new UpdateWrapper<StIvtIostorinvdis>().lambda()
@@ -375,7 +359,6 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
.eq(StIvtIostorinvdis::getIostorinv_id, disDao.getIostorinv_id())
.eq(StIvtIostorinvdis::getBox_no, disDao.getBox_no())
);
// 更新库存
List<StIvtIostorinvdis> disDaoList = iStIvtIostorinvdisService.list(
new QueryWrapper<StIvtIostorinvdis>().lambda()
@@ -383,52 +366,35 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
.eq(StIvtIostorinvdis::getBox_no, disDao.getBox_no())
);
upateIvt(disDaoList, mstDao, IOSEnum.IVT_CHANGE.code("加待入"));
// 更新明细状态
iStIvtIostorinvdtlService.updateStatus(disDao.getIostorinvdtl_id());
// 更新主表状态
StIvtIostorinv mst = updateMstStatus(disDao.getIostorinv_id());
mst.setDis_optid(Long.parseLong(SecurityUtils.getCurrentUserId()));
mst.setDis_optname(SecurityUtils.getCurrentNickName());
mst.setDis_time(DateUtil.now());
this.updateById(mst);
// 判断是否自动下发任务
if (jsonObject.getString("is_send").equals(IOSEnum.IS_NOTANDYES.code("")) && ObjectUtil.isNotEmpty(jsonObject.getString("is_send"))) {
JSONObject jsonSend = new JSONObject();
StIvtIostorinvdtl dtlDao = iStIvtIostorinvdtlService.list(
new QueryWrapper<StIvtIostorinvdtl>().lambda()
.eq(StIvtIostorinvdtl::getIostorinv_id, mst.getIostorinv_id())
).get(0);
List<LinkedHashMap> disList = iStIvtIostorinvdisService.list(
new QueryWrapper<StIvtIostorinvdis>().lambda()
.eq(StIvtIostorinvdis::getIostorinv_id, mst.getIostorinv_id())
).stream().map(row -> JSONObject.parseObject(JSON.toJSONString(row), LinkedHashMap.class))
.collect(Collectors.toList());
//查询木箱码
PdmBiSubpackagerelation pdmBiSubpackagerelation = ipdmBiSubpackagerelationService.getOne(new LambdaQueryWrapper<PdmBiSubpackagerelation>()
.eq(PdmBiSubpackagerelation::getContainer_name, whereJson.get("material_barcode")));
// 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, pdmBiSubpackagerelation.getPackage_box_sn())
);
if (boxDao == null) {
throw new BadRequestException("未找到该木箱信息!");
}
jsonSend.put("dtl_row", JSONObject.parseObject(JSON.toJSONString(dtlDao)));
jsonSend.put("tableMater", disList);
jsonSend.put("point_code", jsonObject.getString("point_code"));
jsonSend.put("stor_id", mst.getStor_id());
//成品入库托盘类型
jsonSend.put("vehicle_code", boxDao.getBox_no());
jsonSend.put("vehicle_code", jsonObject.getString("box_no"));
jsonSend.put("vehicle_code2", jsonObject.getString("vehicle_code"));
JSONObject param = new JSONObject();
param.put("containerType", boxDao.getVehicle_type());
param.put("containerType", jsonObject.getString("vehicle_type"));
jsonSend.put("request_param", param.toString());
String task_id1 = this.setPoint(jsonSend);
// 下发任务
@@ -438,6 +404,18 @@ public class StIvtIostorinvServiceImpl extends ServiceImpl<StIvtIostorinvMapper,
}
}
private BstIvtBoxinfo getBstIvtBoxinfo(Map whereJson) {
//查询木箱码
PdmBiSubpackagerelation pdmBiSubpackagerelation = ipdmBiSubpackagerelationService.getOne(new LambdaQueryWrapper<PdmBiSubpackagerelation>()
.eq(PdmBiSubpackagerelation::getContainer_name, whereJson.get("material_barcode")));
// 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, pdmBiSubpackagerelation.getPackage_box_sn())
);
return boxDao;
}
@Override
@Transactional
public void unDivStruct(Map whereJson) {

View File

@@ -85,14 +85,18 @@ public class InBoxManageServiceImpl implements InBoxManageService {
WQLObject schBasePointService = WQLObject.getWQLObject("sch_base_point");
// 仓位表
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
String box_arr = whereJson.getString("box_no");
// 查询木箱信息
BstIvtBoxinfo boxDao = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, whereJson.getString("box_no"))
);
/*
* 找一个木箱区的一个仓位,生成任务并下发
*/
@@ -101,13 +105,10 @@ public class InBoxManageServiceImpl implements InBoxManageService {
IOSEnum.IS_NOTANDYES.code("否") + "' AND is_used = '" +
IOSEnum.IS_NOTANDYES.code("是") + "'")
.uniqueResult(0);
if (ObjectUtil.isEmpty(jsonPoint)) {
throw new BadRequestException("起始点位不存在或未启用!");
}*/
// 找一个木箱区空位
//根据木箱高度,判断入库仓位的高度
String height = "";
String heightLevel1 = iSysParamService.findByCode("height_level_1").getValue();
@@ -120,7 +121,6 @@ public class InBoxManageServiceImpl implements InBoxManageService {
} else {
height = "3";
}
JSONObject jsonParam = new JSONObject();
jsonParam.put("stor_id", IOSEnum.STOR_ID.code("二期"));
jsonParam.put("sect_id", RegionTypeEnum.TWO_BZC01.getId());
@@ -129,17 +129,12 @@ public class InBoxManageServiceImpl implements InBoxManageService {
jsonParam.put("box_high", boxDao.getBox_high());
jsonParam.put("vehicle_type", boxDao.getVehicle_type());
jsonParam.put("height", height);
JSONObject jsonAttr = getStruct(jsonParam);
if (ObjectUtil.isEmpty(jsonAttr)) {
notInRowList.clear();
notInBlockList.clear();
throw new BadRequestException("仓位不足!");
}
// 生成任务
JSONObject jsonTaskParam = new JSONObject();
jsonTaskParam.put("task_type", "010702");
@@ -150,16 +145,12 @@ public class InBoxManageServiceImpl implements InBoxManageService {
JSONObject param = new JSONObject();
param.put("containerType", boxDao.getVehicle_type());
jsonTaskParam.put("request_param", param.toString());
TwoInBoxTask taskBean = new TwoInBoxTask();
taskBean.createTask(jsonTaskParam);
taskBean.immediateNotifyAcs(null);
// 锁定终点
jsonAttr.put("lock_type", IOSEnum.LOCK_TYPE.code("木箱入库锁"));
attrTab.update(jsonAttr);
// 清空缓存
notInRowList.clear();
notInBlockList.clear();

View File

@@ -71,7 +71,6 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
WQLObject schBasePointService = WQLObject.getWQLObject("sch_base_point");
// 仓位表
WQLObject attrTab = WQLObject.getWQLObject("st_ivt_structattr");
whereJson.put("stor_id", IOSEnum.STOR_ID.code("二期"));
whereJson.put("sect_id", RegionTypeEnum.TWO_BZC01.getId());
@@ -103,19 +102,15 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
JSONObject request_param = new JSONObject();
request_param.put("containerType", jsonAttr.getString("storagevehicle_type"));
jsonTaskParam.put("request_param", request_param.toString());
TwoOutBoxTask taskBean = new TwoOutBoxTask();
taskBean.createTask(jsonTaskParam);
taskBean.immediateNotifyAcs(null);
// 锁定起点
jsonAttr.put("lock_type", IOSEnum.LOCK_TYPE.code("木箱出库锁"));
attrTab.update(jsonAttr);
// 清空缓存
notOutRowList.clear();
notOutBlockList.clear();
return jsonAttr.getString("storagevehicle_code");
}

View File

@@ -108,11 +108,11 @@ public abstract class AbstractAcsTask {
*
*/
public JSONObject immediateNotifyAcs(String task_id) {
List<AcsTaskDto> taskList = this.schedule();
if (ObjectUtil.isNotEmpty(taskList)) {
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(taskList));
return AcsUtil.notifyAcs("api/wms/task", arr);
}
List<AcsTaskDto> taskList = this.schedule();
if (ObjectUtil.isNotEmpty(taskList)) {
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(taskList));
return AcsUtil.notifyAcs("api/wms/task", arr);
}
return null;
}

View File

@@ -326,19 +326,19 @@ export default {
row.index = rowIndex
},
tableChanged(row) {
debugger
this.form.tableMater = this.currentSelection
this.form.checked = row.material_code
debugger
this.form.sale_order_name = this.sale_order_name
crudPackagerelation.updateEntityList(this.form).then(res => {
crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.sale_order_name }).then(res => {
this.openParam = res.content
this.$emit('childEvent')
this.clearSelection()
})
this.form.tableMater = []
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
this.$emit('childEvent')
},
divStruct() {
if (this.currentSelection.length > 0 && this.$refs.dis_table.selection.length > 0) {

View File

@@ -66,7 +66,7 @@
:disabled="dis_flag"
icon="el-icon-position"
size="mini"
@click="divOpen1"
@click="divOpen"
>
分配
</el-button>
@@ -85,7 +85,6 @@
size="mini"
@select="handleSelectionChange"
@selection-change="crud.selectionChangeHandler"
@row-dblclick="handleRowDblClick"
>
<el-table-column type="selection" />
<el-table-column
@@ -218,22 +217,7 @@ export default {
this.query.status = tab.name === 'first' ? '99' : '0'
this.crud.toQuery()
},
// 表格双击事件
handleRowDblClick(row, column, event) {
// 双击事件的处理逻辑
this.divOpen(row)
},
// 双击
divOpen(row) {
debugger
this.sale_order_name = row.sale_order_name
crudSubpackagerelation.queryContainerization({ 'sale_order_name': row.sale_order_name }).then(res => {
debugger
this.openParam = res.content
this.divShow = true
})
},
divOpen1() {
divOpen() {
debugger
this.sale_order_name = this.currentRow.sale_order_name
crudSubpackagerelation.queryContainerization({ 'sale_order_name': this.currentRow.sale_order_name }).then(res => {