Compare commits

..

2 Commits

Author SHA1 Message Date
judy 964912635f Merge remote-tracking branch 'origin/main' into main 1 year ago
judy d10df4be46 线上优化代码 1 year ago
  1. 42
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java
  2. 3
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinPickupServiceImpl.java
  3. 22
      shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinEnptyContainerServiceImpl.java
  4. 3
      shkj-wms/src/main/java/com/shkj/wms/third/rcs/RCSUtil.java
  5. 2
      shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml

@ -904,6 +904,48 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
locationVo = iBusinEnptyContainerService.assginLocation(resultLocationList);
}
}
//如果选取的1个巷道,因为双深位逻辑未查找到合适的空货位。则循环查询下一个巷道
if(locationVo == null)
{
if(tunnelResult.size() > 1)
{
for (int i = 1; i < tunnelResult.size(); i++)
{
String tunnel = tunnelResult.get(i);
log.info("空治具重新选择其他巷道:" + tunnel);
List<BaseLocationVo> resultLocationList = baseLocationVos.stream().filter(e -> tunnel.equals(e.getTunnel())).collect(Collectors.toList());
//巷道中货位数大于1时,进行分配
if (resultLocationList.size() > 1) {
locationVo = iBusinEnptyContainerService.assginLocation(resultLocationList);
}
if (locationVo != null)
{
break;
}
}
}
else{
for (int i = 0; i < tunnelList.size(); i++) {
if(!tunnelResult.get(0).equals(tunnelList.get(i)))
{
String tunnel = tunnelList.get(i);
log.info("空治具重新选择其他巷道:" + tunnel);
List<BaseLocationVo> resultLocationList = baseLocationVos.stream().filter(e -> tunnel.equals(e.getTunnel())).collect(Collectors.toList());
//巷道中货位数大于1时,进行分配
if (resultLocationList.size() > 1) {
locationVo = iBusinEnptyContainerService.assginLocation(resultLocationList);
}
if (locationVo != null)
{
break;
}
}
}
}
}
}
else {
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = assingEmptyLocBo.getBusinDataTaskGoodsVos();

@ -423,6 +423,7 @@ public class BusinPickupServiceImpl extends ServiceImpl<BusinPickupMapper, Busin
Result<Boolean> booleanResult = iBusinEnptyContainerService.emptyContainerFlowDir(point, bo.getContainerId(), agvno, null);
if (Result.isOk(booleanResult)){
redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno,3, TimeUnit.MINUTES);
log.info("方法[saveBusinPickupRecord]设置redis=> xzz:"+DataTask.getId()+",agv_no:"+agvno);
}
// 创建任务
@ -753,7 +754,7 @@ public class BusinPickupServiceImpl extends ServiceImpl<BusinPickupMapper, Busin
Result<Boolean> booleanResult = iBusinEnptyContainerService.emptyContainerFlowDir(point, businPickupAddBo.getContainerId(), agvno, null);
if (Result.isOk(booleanResult)){
log.info("小组装放行完成:"+point+" AGV编号:"+agvno+" 任务号:"+businPickupAddBo.getTaskCode());
redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno,3,TimeUnit.MINUTES); //修改为3分钟
redisTemplate.opsForValue().set("xzz:"+DataTask.getId(),agvno,5,TimeUnit.MINUTES);
DataTask.setTaskStatus("2");
businDataTaskService.updateById(DataTask);

@ -638,7 +638,19 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
BaseLocationVo resultLocationVo = null;
//根据拣货路径选择最近一个货位
for (int i = 0; i < locationList.size(); i++) {
BaseLocationVo locationVo = locationList.get(i);
//BaseLocationVo locationVo = locationList.get(i);
//2024-09-05 调整代码,重新查询货位状态,如果货位状态为4则循环继续寻找下个货位
BaseLocationVo locationVoOld = locationList.get(i);
BaseLocationVo locationVo = baseLocationMapper.queryLocationById(locationVoOld.getId());
if ( "1".equals(locationVo.getLocationStatus())
|| "2".equals(locationVo.getLocationStatus())
|| "4".equals(locationVo.getLocationStatus()))
{
log.info("此货位已经被占用,继续查找其他货位:"+JsonUtil.toJSONString(locationVo));
continue;
}
//如果该货位为双深位,则直接选择该库位
if ("2".equals(locationVo.getIsDeep())) {
return locationVo;
@ -656,11 +668,13 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
if (baseLocationVos.size() > 0) {
log.info("查询到的双深位库位信息:"+JsonUtil.toJSONString(baseLocationVos.get(0)));
if(baseLocationVos.get(0).getLocationStatus().equals("4")
|| baseLocationVos.get(0).getLocationStatus().equals("1")){
log.info("已有库存,继续查找:"+JsonUtil.toJSONString(baseLocationVos.get(0)));
|| baseLocationVos.get(0).getLocationStatus().equals("1")
|| baseLocationVos.get(0).getLocationStatus().equals("2")
){
log.info("深位已有库存,继续查找其他货位:"+JsonUtil.toJSONString(baseLocationVos.get(0)));
continue;
}else{
return locationVo;
return baseLocationVos.get(0);
}
}else{
return locationVo;

@ -940,7 +940,7 @@ public class RCSUtil {
assemblyLineAddBo.setContainerId(businDataTask.getContainerId());
assemblyLineAddBo.setPointNo(assemblePointBefore);
redisTemplate.opsForValue().set(RedisConstant.redisAssemblyLineFront, assemblyLineAddBo);
log.info(RedisConstant.redisAssemblyLineFront+"键值设为"+assemblyLineAddBo);
}
// 到达组装线前杠点位之后的业务逻辑处理
@ -954,6 +954,7 @@ public class RCSUtil {
assemblyLineAddBo.setPointNo(assemblePointAfter);
redisTemplate.opsForValue().set(RedisConstant.redisAssemblyLineAfter, assemblyLineAddBo);
log.info(RedisConstant.redisAssemblyLineAfter+"键值设为"+assemblyLineAddBo);
}
log.info("agv点位信息" + businDataTask.getPoints());

@ -362,7 +362,7 @@
ORDER BY bl.route asc,is_deep desc
</select>
<select id="queryBaseLocationListByDerive1" resultMap="BaseLocationResult"
<select id="queryBaseLocationListByDerive1" resultType="com.shkj.wms.vo.BaseLocationVo"
parameterType="com.shkj.wms.bo.BaseLocationQueryListBo">
SELECT
bl.*,

Loading…
Cancel
Save