禁用启用货位

main
judy 1 year ago
parent db2307d001
commit 154bbbab61
  1. 32
      shkj-wms/src/main/java/com/shkj/wms/bo/BaseLocationRemoveBo.java
  2. 2
      shkj-wms/src/main/java/com/shkj/wms/constants/ParameterConstants.java
  3. 12
      shkj-wms/src/main/java/com/shkj/wms/controller/base/BaseLocationController.java
  4. 4
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java
  5. 16
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java

@ -0,0 +1,32 @@
package com.shkj.wms.bo;
import com.shkj.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* 更新货位状态实体类
*
* @author lch
* @date 2022-04-23
*/
@Data
public class BaseLocationRemoveBo{
/**
* 货位Id集合
*/
@NotEmpty(message = "货位ID集合不得为空")
private List<Long> ids;
/**
* 状态 true删除 false正常
*/
@NotEmpty(message = "状态不得为空")
private Boolean status;
}

@ -121,6 +121,8 @@ public final class ParameterConstants {
public final static String waitTaskNumber="wait_task_number";
//异常条码保险杠出库
public final static String abnormal_out_point="abnormal_out_point";
}

@ -85,6 +85,18 @@ public class BaseLocationController extends BaseController {
}
/**
* 禁用启用货位
*/
@PostMapping("/enableDisableLocation")
public Result<Boolean> enableDisableLocation(@Valid @RequestBody BaseLocationRemoveBo bo) {
return iBaseLocationService.deleteWithValidById(bo.getIds(), bo.getStatus());
}
/**
* 切换状态
*/

@ -160,7 +160,11 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
@Override
public Result<Boolean> deleteWithValidById(List<Long> ids, Boolean isValid) {
BaseLocation del = new BaseLocation();
if (isValid == true) {
del.setIsDel(IsDelEnum.DELETED.getValue());
} else {
del.setIsDel(IsDelEnum.NORMAL.getValue());
}
LambdaQueryWrapper<BaseLocation> wrapper = new LambdaQueryWrapper<BaseLocation>().in(BaseLocation::getId, ids)
.eq(BaseLocation::getBranchId, SecurityUtils.getCurrentBranchId());
this.update(del, wrapper);

@ -522,6 +522,7 @@ public class BusinDataTaskServiceImpl extends ServiceImpl<BusinDataTaskMapper, B
return Result.err().msg("此货位出库中或已出库,请确认!"+locationCode+" 库位状态:"+baseLocationVo.getLocationStatus());
}
List<SysStockDetailVo> sysStockDetailVoList =null;
//检查货位是否是双深位
Result<Boolean> booleanResult = checkIsSleep(baseLocationVo);
if (!Result.isOk(booleanResult)){
return booleanResult;
@ -540,7 +541,20 @@ public class BusinDataTaskServiceImpl extends ServiceImpl<BusinDataTaskMapper, B
iBaseLocationService.updateById(baseLocation);
//需要搬运到的码头信息
String taskPath ="KW1、KW2";
String toPoint = sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.abnormal_out_point);
String[] toPoints = toPoint.split("、");
List<BasePoint> pointList = iBasePointService.list(new LambdaQueryWrapper<BasePoint>()
.in(BasePoint::getPointNo, toPoints)
.eq(BasePoint::getIsOccupy,"0")
);
String taskPath="";
if (pointList !=null && pointList.size()>0){
taskPath=pointList.get(0).getPointNo();
}
if (StringUtils.isEmpty(taskPath)){
return Result.err().msg("搬运码头无空闲,不可出库");
}
//生成作业任务
int index=0;

Loading…
Cancel
Save