Commit ef4a225e zshaohui

增加西门子 删除uid 接口

1 个父辈 03610c2f
......@@ -672,7 +672,7 @@ public class DataCache {
inventoryItem = new InventoryItem();
inventoryItem.setPartNumber(partNumber);
}
log.info("修改barcode为:"+barcode+",partNumber为:"+ partNumber+"的缓存信息,数量为:"+amount+",盘数+1");
log.info("修改barcode为:"+barcode+",partNumber为:"+ partNumber+"的缓存信息,数量为:"+amount);
inventoryItem.updateInventory(amount);
updateStorageInventory(cid, inventoryItem);
return inventoryItem.getStockReel();
......
package com.neotel.smfcore.custom.siemens;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.storage.service.po.Storage;
import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
@Api(tags = "西门子对接")
@Slf4j
@RequestMapping("/siemens")
@RestController
public class SiemensController {
@Autowired
private IStoragePosManager storagePosManager;
@Autowired
private TaskService taskService;
@Autowired
private DataCache dataCache;
@ApiOperation("删除uid")
@RequestMapping("/deleteUid")
@AnonymousAccess
public Map<String, Object> deleteUid(@RequestBody Map<String, String> paramMap) {
String lotID = paramMap.get("LotID");
String dateTime = paramMap.get("DateTime");
log.info("收到删除uid指令,UID为[" + lotID + "],时间为[" + dateTime + "]");
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("ReturnCode", 0);
resultMap.put("CID", "");
if (StringUtils.isNotEmpty(lotID)) {
StoragePos storagePos = storagePosManager.getByBarcode(lotID);
if (storagePos != null) {
Barcode barcode = storagePos.getBarcode();
//log.info("清理库位[" + storagePos.getPosName() + "]中的库存" + barcode.getBarcode());
String opUser = SecurityUtils.getCurrentUsername();
log.info(opUser + "清理库位[" + storagePos.getPosName() + "]中的库存" + barcode.getBarcode());
taskService.addTaskToFinished(storagePos, null, opUser + "-clear");
Storage storage = dataCache.getStorageById(storagePos.getStorageId());
dataCache.reloadStorage(storage, "");
//如果是料架,库位灭灯
if (storage != null) {
if (storage.isShelf() || storage.isNLShelf() || storage.isNLPShelf() || storage.isNLMShelf()) {
String opKey = "close";
String opStr = storagePos.getPosName();
DevicesStatusUtil.appendOp(storage.getCid(), opKey, opStr);
log.info("操作库位[" + storagePos.getPosName() + "]" + opKey + " : " + opStr);
}
resultMap.put("CID", storage.getCid());
}
resultMap.put("ReturnCode", 1);
} else {
log.info("未找到UID[" + lotID + "]对应的库存信息");
}
} else {
log.info("UID[" + lotID + "]为空");
}
return resultMap;
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!