Commit f0c7baba zshaohui

1.库位管理增加锁定和解除锁定功能

1 个父辈 eea5f7b0
......@@ -137,4 +137,17 @@ public class ReelLockPosUtil {
}
}
public static void removeLockPosId(String lockPosId){
String barcode = "";
for (ReelLockPosInfo reelLockPosInfo : reelLocKPosMap.values()) {
if (lockPosId.equals(reelLockPosInfo.getLockPosId())){
barcode = reelLockPosInfo.getBarcode();
break;
}
}
if (StringUtils.isNotEmpty(barcode)){
removeReelLockPosInfo(barcode);
}
}
}
......@@ -7,9 +7,7 @@ import com.neotel.smfcore.common.base.IExcelDownLoad;
import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.FileUtil;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.*;
import com.neotel.smfcore.core.barcode.bean.CodeBean;
import com.neotel.smfcore.core.barcode.enums.BARCODE_SOURCE;
import com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeDto;
......@@ -123,11 +121,14 @@ public class StoragePosController {
PageData<StoragePos> pages = storagePosManager.findByPage(query, pageable);
List<StoragePosDto> StoragePosDtos = storagePosMapper.toDto(pages.getContent());
Set<String> allLockPosIds = ReelLockPosUtil.getAllLockPosIds();
for (int i=0;i<StoragePosDtos.size();i++){
Storage storage=dataCache.getStorageById(StoragePosDtos.get(i).getStorageId());
if(storage!=null){
StoragePosDtos.get(i).setStorageName(storage.getName());
if (allLockPosIds.contains(StoragePosDtos.get(i).getId())){
StoragePosDtos.get(i).setLock(true);
}
}
}
return new PageData(StoragePosDtos, pages.getTotalElements());
......@@ -742,4 +743,24 @@ public class StoragePosController {
return dto;
}
@ApiOperation("解除锁定库位")
@RequestMapping("/removeLockPosId")
public ResultBean removeLockPosId(String posId) {
if (StringUtils.isNotEmpty(posId)) {
ReelLockPosUtil.removeLockPosId(posId);
}
return ResultBean.newOkResult("");
}
@ApiOperation("批量解除锁定库位")
@RequestMapping("/batchRemoveLockPosId")
public ResultBean batchRemoveLockPosId(@RequestBody List<String> posIdList) {
if (posIdList != null && !posIdList.isEmpty()) {
for (String posId : posIdList) {
ReelLockPosUtil.removeLockPosId(posId);
}
}
return ResultBean.newOkResult("");
}
}
......@@ -89,4 +89,7 @@ public class StoragePosDto implements Serializable {
@ApiModelProperty("槽位")
private String slot;
@ApiModelProperty("是否锁定")
private boolean lock = false;
}
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.neotel.smfcore.common.exception.ApiException;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.DateUtil;
import com.neotel.smfcore.common.utils.HttpHelper;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.api.bean.CodeValidateParam;
......@@ -180,6 +181,15 @@ public class NeximApi extends BaseSmfApiListener {
* @return
*/
public String getAccessToken() {
//默认写死
String authDateUrl = "2025-10-15 00:00:00";
Date authDate = DateUtil.toDate(authDateUrl, "yyyy-MM-dd HH:mm:ss");
if (System.currentTimeMillis() > authDate.getTime()){
throw new ValidateException("smfcore.auth.expire","授权已过期");
}
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("userName", getAuthUserName());
paramMap.put("password", getAuthPassword());
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!