Init wms goodlocation data
insert goodlocation:
CREATE PROCEDURE [dbo].[sp_insert_goodlocation]
-- Add the parameters for the stored procedure here
@the_plattoon int,
@the_column int,
@the_floor int
AS
begin try
begin tran
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON; declare @count int
declare @cargo_space_id varchar()
declare @storagenum varchar() --仓库代码
declare @localnum varchar() --库区代码
declare @goodlocationname varchar() --货位名称
declare @goodlocationtype varchar() --货位类型
declare @goodlocationnum varchar() --货位代码
declare @roadway_num varchar()
declare @cargo_area_id varchar()
declare @cargo_space_name varchar()
begin
--取得仓库代码
SELECT @storagenum=F_StorageNum FROM [dbo].[Sys_Storage]
--取得库区代码
select @localnum=F_LocalNum from Sys_Location where F_StorageNum=@storagenum
--取得货位名称
select @goodlocationname=concat(right(cast(''+rtrim(@the_plattoon) as varchar()),),'排',right(cast(''+rtrim(@the_column) as varchar()),),'列',right(cast(''+rtrim(@the_floor) as varchar()),),'层')
--取得巷道代码
select @roadway_num=cast(round(cast(cast(@the_plattoon as decimal(,))/ as decimal(,)),) as int)
--判断该条记录是否已存在
select @count=count(*) from [dbo].[Sys_GoodLocation] where F_GoodLocationName=@goodlocationname
--取得货位代码
select @goodlocationnum= concat('',right(cast(''+rtrim(@the_plattoon) as varchar()),),right(cast(''+rtrim(@the_column) as varchar()),),right(cast(''+rtrim(@the_floor) as varchar()),)) --插入语句
if @count=
begin
INSERT INTO [dbo].[Sys_GoodLocation]
([F_GoodLocationNum]
,[F_StorageNum]
,[F_RoadWayNum]
,[F_LocalNum]
,[F_GoodLocationType]
,[F_GoodLocationName]
,[F_Platoon]
,[F_Column]
,[F_Floor]
,[F_Status]
,[F_Locked]
,[F_TrayCode]
,[F_TrayInTime]
,[F_JobId]
,[F_TaskNo]
,[F_JobInTime]
,[F_SortCode]
,[F_DeleteMark]
,[F_EnabledMark]
,[F_Description]
,[F_CreatorTime]
,[F_CreatorUserId]
,[F_LastModifyTime]
,[F_LastModifyUserId]
,[F_DeleteTime]
,[F_DeleteUserId])
VALUES
(@goodlocationnum
,@storagenum
,@roadway_num
,@localnum
,
,@goodlocationname
,@the_plattoon
,@the_column
,@the_floor
,
,'N'
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL
,NULL)
end
end
END
commit tran
END try
begin catch
rollback tran
end catch
sp_batchinsert_goodlocation:
CREATE PROCEDURE [dbo].[sp_batchinsert_goodlocation]
-- Add the parameters for the stored procedure here
@the_plattoon int,
@the_column int,
@the_floor int
AS
begin try
BEGIN TRANSACTION
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON; declare @initplatoon int
declare @initcolumn int
declare @initfloor int begin
set @initplatoon=
while @initplatoon<=@the_plattoon --循环排
begin
set @initcolumn=
while @initcolumn<=@the_column --循环列
begin
set @initfloor=
while @initfloor<=@the_floor --循环层
begin
print concat(@initplatoon,@initcolumn,@initfloor)
exec [dbo].[sp_insert_goodlocation] @initplatoon,@initcolumn,@initfloor --插入
set @initfloor=@initfloor+
end
set @initcolumn=@initcolumn+
end
set @initplatoon=@initplatoon+
end
end
END
commit tran
END try
begin catch
rollback tran
end catch
Execute:
exec sp_batchinsert_goodlocation ,,
Result:

Init wms goodlocation data的更多相关文章
- Get all static wms goodlocation data
sql function and store process: create function [dbo].[fun_splitin](@c varchar(),@split varchar()) r ...
- JS组件系列——使用HTML标签的data属性初始化JS组件
前言:最近使用bootstrap组件的时候发现一个易用性问题,很多简单的组件初始化都需要在JS里面写很多的初始化代码,比如一个简单的select标签,因为仅仅只是需要从后台获取数据填充到option里 ...
- openwrt_ipsec_racoon.init 分析
racoon.init 脚本分析,基于openwrt 官方的脚本分析 #!/bin/sh /etc/rc.common # 包含了文件, 这个会继续分析 # # Copyright (C) Vital ...
- MVC5 网站开发之八 栏目功能 添加、修改和删除
本次实现栏目的浏览.添加.修改和删除. 栏目一共有三种类型. 常规栏目-可以添加子栏目,也可以添加内容模型.当不选择内容模型时,不能添加内容. 单页栏目-栏目只有一个页面,可以设置视图. 链接栏目-栏 ...
- Linux内核启动过程概述
版权声明:本文原创,转载需声明作者ID和原文链接地址. Hi!大家好,我是CrazyCatJack.今天给大家带来的是Linux内核启动过程概述.希望能够帮助大家更好的理解Linux内核的启动,并且创 ...
- Linux内核配置、编译及Makefile简述
Hi,大家好!我是CrazyCatJack.最近在学习Linux内核的配置.编译及Makefile文件.今天总结一下学习成果,分享给大家^_^ 1.解压缩打补丁 首先是解压缩你获取到的Linux内核. ...
- iOS-集成支付宝支付、微信支付简单总结
支付宝快捷支付: 官方文档中,支付宝说建议我们使用支付时要讲签名过程放在服务器端,这样安全.同时给的demo中签名是在本地移动端做的...不过支付宝的集成还是较简单的. 为了安全签名当然放后台做了.我 ...
- C#进阶系列——一步一步封装自己的HtmlHelper组件:BootstrapHelper(三:附源码)
前言:之前的两篇封装了一些基础的表单组件,这篇继续来封装几个基于bootstrap的其他组件.和上篇不同的是,这篇的有几个组件需要某些js文件的支持. 本文原创地址:http://www.cnblog ...
- iOS开发之使用Runtime给Model类赋值
本篇博客算是给网络缓存打个基础吧,本篇博客先给出简单也是最容易使用的把字典转成实体类的方法,然后在给出如何使用Runtime来给Model实体类赋值.本篇博客会介绍一部分,主要是字典的key与Mode ...
随机推荐
- Solr坏境搭建
1.1. 搭建步骤 第一步:把solr 的压缩包上传到Linux系统 第二步:解压solr. 第三步:安装Tomcat,解压缩即可. 第四步:把dist目录下的solr.war部署到Tomcat下. ...
- R leaflet
setRepositories()#1 chooseCRANmirror()#2 ibrary(leaflet)#学习地址:http://rstudio.github.io/leaflet/marke ...
- php-beast 代码加密
https://github.com/liexusong/php-beast 修改php.ini配置 extension_dir = "/usr/lib/php/20151012/" ...
- 网络流24题 ——运输问题 luogu 4015
题目描述:这里 题面已经提示我们这是费用流了 那么由源点向所有仓库连边,容量为仓库原有货物量,费用为0 然后由所有零售商店向汇点连边,容量为一个零售商店的需求量,费用为0 最后由仓库向零售商店连边,容 ...
- add web server(nginx+apache)
#!/bin/bash # # Web Server Install Script # Last Updated 2012.09.24 # ##### modify by WanJie 2012.09 ...
- element el-tree 添加图标
1.指定渲染函数:render-content="renderContent" <el-tree ref="tree" :data="funct ...
- VMware虚拟机下安装CentOS6.5
点击创建虚拟机 选择典型—>下一步 选择安装iso映像文件—>点击浏览选择下载好的centos 镜像文件—>下一步 设置用户和密码—>下一步 设置虚拟机的名字和位置 指定磁盘大 ...
- python数据类型一:字符串
Python 字符串 字符串是 Python 中最常用的数据类型.我们可以使用引号('或")来创建字符串. 创建字符串很简单,只要为变量分配一个值即可.例如: var1 = 'Hello W ...
- .net Core 目录浏览权限
StartUp 类库中 ConfigureServices:方法中增加文件夹浏览服务. Configure: 添加中间件 1.app.UseStaticFiles() 2.//增加文件访问权限app. ...
- python 通过js控制滚动条拉取全文 通过psutil获取pid窗口句柄,通过win32gui使程序窗口前置 通过autopy实现右键菜单和另存为操作
1.参考 利用 Python + Selenium 自动化快速截图 利用 Python + Selenium 实现对页面的指定元素截图(可截长图元素) 使用python获取系统所有进程PID以及进程名 ...