rev:1.支持出库不堆叠 2.2022阻挡问题

This commit is contained in:
2024-10-08 18:00:58 +08:00
parent 1e26b90b6e
commit afed5aab19
3 changed files with 72 additions and 4 deletions

View File

@@ -111,7 +111,7 @@ public enum IOSEnum {
OUT_HANGER(MapOf.of("行架位1", "CK2013","行架位2", "CK2017")),
// 点位
POINT_CODE(MapOf.of("退货入库位", "THRKDJW1")),
POINT_CODE(MapOf.of("退货入库位", "THRKDJW1", "2020","CK2020", "2022","CK2022")),
//acs申请任务
ACSTOLMS_TYPE(MapOf.of("成品入库任务", "1","空盘入库","2","空盘出库","3","异常处理位","4","木箱入库","5","退货入库","6","贴标","1","捆扎","2")),

View File

@@ -23,6 +23,9 @@ public enum TASKEnum {
// 托盘任务类型
VEHICLE_TYPE(MapOf.of("托盘入库", "010705", "托盘出库", "010706")),
// 捆扎任务类型
LASH_TYPE(MapOf.of("捆扎桁架任务", "010707")),
// 成品任务类型
PROUD_TYPE(MapOf.of("成品入库", "010703", "成品出库", "010711", "立库转库", "010709")),
;

View File

@@ -4,11 +4,14 @@ import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import org.nl.b_lms.sch.point.dao.SchBasePoint;
import org.nl.b_lms.sch.point.dao.mapper.SchBasePointMapper;
import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.b_lms.sch.tasks.TwoLashTask;
import org.nl.b_lms.sch.tasks.TwoOutHeapTask;
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
@@ -18,6 +21,7 @@ import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxlashbound;
import org.nl.b_lms.storage_manage.database.service.dao.MdpbBoxtype;
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
import org.nl.b_lms.storage_manage.ios.enums.TASKEnum;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.mapper.StIvtIostorinvOutMapper;
import org.nl.b_lms.storage_manage.ios.service.iostorInv.util.service.LashManageService;
import org.nl.common.utils.IdUtil;
@@ -25,9 +29,12 @@ 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.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -76,6 +83,11 @@ public class LashManageServiceImpl implements LashManageService {
*/
private final StIvtIostorinvOutMapper stIvtIostorinvOutMapper;
/**
* 任务服务
*/
private final IschBaseTaskService ischBaseTaskService;
@Override
@Transactional
public void createLashTask(JSONObject whereJson) {
@@ -158,6 +170,12 @@ public class LashManageServiceImpl implements LashManageService {
jsonPoint.put("vehicle_qty", 0);
jsonPoint.put("vehicle_code", "");
is_move = IOSEnum.IS_NOTANDYES.code("");
// 判断是否是2020工位如果是则需要判断2022工位上后续是否有堆叠的木箱如果没有则强制离开
if (jsonPoint.getString("point_code").equals(IOSEnum.POINT_CODE.code("2020"))) {
checkMove();
}
}
end_point = jsonPoint.getString("point_code");
schBasePointMapper.updateById(JSON.parseObject(jsonPoint.toString(), SchBasePoint.class));
@@ -187,12 +205,19 @@ public class LashManageServiceImpl implements LashManageService {
// 有空位
JSONObject jsonPoint = empPointList.get(0);
// 加载具数量、更新载具号
jsonPoint.put("vehicle_qty", NumberUtil.add(jsonPoint.getBigDecimal("vehicle_qty"), 1));
jsonPoint.put("vehicle_code", boxDao.getBox_no());
// 判断是否堆叠
String two_is_lash = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("two_is_lash").getValue();
if (two_is_lash.equals(IOSEnum.IS_NOTANDYES.code(""))) {
is_move = "1";
} else {
// 加载具数量、更新载具号
jsonPoint.put("vehicle_qty", NumberUtil.add(jsonPoint.getBigDecimal("vehicle_qty"), 1));
jsonPoint.put("vehicle_code", boxDao.getBox_no());
}
end_point = jsonPoint.getString("point_code");
schBasePointMapper.updateById(JSON.parseObject(jsonPoint.toString(), SchBasePoint.class));
/*
* 插入绑定木箱表
*/
@@ -349,4 +374,44 @@ public class LashManageServiceImpl implements LashManageService {
return result;
}
/**
* 校验2022捆扎位是否可以强制离开
*/
private void checkMove() {
// 判断2022工位是否有有货
SchBasePoint pointDao = schBasePointMapper.selectOne(
new QueryWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getPoint_code, IOSEnum.POINT_CODE.code("2022"))
);
if (ObjectUtil.isNotEmpty(pointDao.getVehicle_code()) && pointDao.getVehicle_qty().intValue() == 1) {
// 判断是否还有去2022工位的行架任务
List<SchBaseTask> taskList = ischBaseTaskService.list(
new QueryWrapper<SchBaseTask>().lambda()
.eq(SchBaseTask::getTask_type, TASKEnum.LASH_TYPE.code("捆扎桁架任务"))
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code(""))
.eq(SchBaseTask::getPoint_code2, IOSEnum.POINT_CODE.code("2022"))
.ne(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
);
// 如果是空的则下发强制离开
if (ObjectUtil.isEmpty(taskList)) {
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
JSONArray action_rows = new JSONArray();
JSONObject action_jo = new JSONObject();
action_jo.put("device_code", IOSEnum.POINT_CODE.code("2022"));
action_jo.put("code", "to_command");
action_jo.put("product_area", "BLK");
action_jo.put("value", "26");
action_rows.add(action_jo);
wmsToAcsService.action(action_rows);
// 更新点位数量
pointDao.setVehicle_qty(BigDecimal.valueOf(0));
pointDao.setVehicle_code("");
schBasePointMapper.updateById(pointDao);
}
}
}
}