Commit a23d8cc8 张少辉

1.提供清空库位接口给客户端

1 个父辈 f8dd1436
...@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.bean.ResultBean; ...@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants; import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.ReelLockPosUtil; import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StringUtils; import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.api.SmfApi; import com.neotel.smfcore.core.api.SmfApi;
import com.neotel.smfcore.core.api.listener.ISmfApiListener; import com.neotel.smfcore.core.api.listener.ISmfApiListener;
...@@ -52,6 +53,7 @@ import org.springframework.beans.BeanUtils; ...@@ -52,6 +53,7 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -773,6 +775,36 @@ public class DeviceController { ...@@ -773,6 +775,36 @@ public class DeviceController {
return ResultBean.newOkResult(resultMap); return ResultBean.newOkResult(resultMap);
} }
@ApiOperation("清空指定库位")
@RequestMapping("/service/store/clearPos")
@AnonymousAccess
public ResultBean clearPos(@RequestBody HashMap<String, String> map) {
if (map.containsKey("posName")) {
String posName = map.get("posName");
StoragePos storagePos = storagePosManager.getByPosName(posName);
if (storagePos != null) {
try {
log.info("客户端请求清空库位[" + storagePos.getPosName() + "]");
Barcode barcode = storagePos.getBarcode();
if (barcode != null) {
barcode = barcodeManager.findByBarcode(barcode.getBarcode());
if (barcode == null) {
barcode = storagePos.getBarcode();
}
log.info("清理库位[" + storagePos.getPosName() + "]中的库存" + barcode.getBarcode());
log.info("客户端清理库位[" + storagePos.getPosName() + "]中的库存" + barcode.getBarcode());
taskService.addTaskToFinished(storagePos, null, "客户端-clear");
}
return ResultBean.newOkResult("");
} catch (Exception e) {
return ResultBean.newErrorResult(-1, "smfcore.error", "出错{0}", new String[]{e.toString()});
}
}
}
return ResultBean.newErrorResult(-1, "smfcore.posNotExist", "仓位不存在");
}
private StoragePos findFormList(List<StoragePos> list ,String posName) private StoragePos findFormList(List<StoragePos> list ,String posName)
{ {
for (StoragePos pos : for (StoragePos pos :
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!