Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
custom-magic
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guoyu
custom-magic
Commits
ea4c8533
Commit
ea4c8533
authored
Feb 23, 2023
by
guoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
04f9aa1c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
396 additions
and
59 deletions
+396
-59
创建商品.ms
mushiny/magic-api/api/MFG/创建商品.ms
+95
-16
获取商品库存.ms
mushiny/magic-api/api/MFG/获取商品库存.ms
+9
-9
反馈库存数据.ms
mushiny/magic-api/task/MFG/反馈库存数据.ms
+11
-11
ProductConstant.java
...in/java/com/mushiny/wms/mfg/constant/ProductConstant.java
+17
-0
BaseClient.java
src/main/java/com/mushiny/wms/mfg/entity/BaseClient.java
+1
-1
BaseEntitys.java
src/main/java/com/mushiny/wms/mfg/entity/BaseEntitys.java
+7
-6
BaseWarehouse.java
src/main/java/com/mushiny/wms/mfg/entity/BaseWarehouse.java
+1
-1
LogApi.java
src/main/java/com/mushiny/wms/mfg/entity/LogApi.java
+12
-11
Product.java
src/main/java/com/mushiny/wms/mfg/entity/Product.java
+189
-0
ProductCode.java
src/main/java/com/mushiny/wms/mfg/entity/ProductCode.java
+47
-0
MyNamedTableInterceptor.java
.../mushiny/wms/mfg/interceptor/MyNamedTableInterceptor.java
+6
-4
application.yml
src/main/resources/application.yml
+1
-0
No files found.
mushiny/magic-api/api/MFG/创建商品.ms
View file @
ea4c8533
This diff is collapsed.
Click to expand it.
mushiny/magic-api/api/MFG/获取商品库存.ms
View file @
ea4c8533
{
{
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
"groupId" : "504dbc7823444f7a8df13edb6b189120",
"groupId" : "504dbc7823444f7a8df13edb6b189120",
"name" : "获取商品库存",
"name" : "获取商品库存",
"createTime" : null,
"createTime" : null,
"updateTime" : 167
4982355092
,
"updateTime" : 167
7138527008
,
"lock" : null,
"lock" : null,
"createBy" : null,
"createBy" : null,
"updateBy" : "admin",
"updateBy" : "admin",
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
"method" : "POST",
"method" : "POST",
"parameters" : [ ],
"parameters" : [ ],
"options" : [ ],
"options" : [ ],
"requestBody" : "{\n \"client_no\": \"C-MELB TTC\",\n \"details\": [{\n \"external_sku_id\": \"
001
\"\n }, {\n \"external_sku_id\": \"002\"\n }]\n}",
"requestBody" : "{\n \"client_no\": \"C-MELB TTC\",\n \"details\": [{\n \"external_sku_id\": \"
30758800
\"\n }, {\n \"external_sku_id\": \"002\"\n }]\n}",
"headers" : [ ],
"headers" : [ ],
"paths" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"status\": \"ERROR\",\n \"message\": \"
Client does not exist\",\n \"datetime\": \"2023-01-29 16:50:49
\"\n}",
"responseBody" : "{\n \"status\": \"ERROR\",\n \"message\": \"
Product does not exist, wrong product is 307588001\",\n \"datetime\": \"2023-02-23 15:48:41
\"\n}",
"description" : null,
"description" : null,
"requestBodyDefinition" : {
"requestBodyDefinition" : {
"name" : "",
"name" : "",
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
"expression" : "",
"expression" : "",
"children" : [ {
"children" : [ {
"name" : "external_sku_id",
"name" : "external_sku_id",
"value" : "
001
",
"value" : "
30758800
",
"description" : "",
"description" : "",
"required" : false,
"required" : false,
"dataType" : "String",
"dataType" : "String",
...
@@ -104,7 +104,7 @@
...
@@ -104,7 +104,7 @@
"children" : [ ]
"children" : [ ]
}, {
}, {
"name" : "message",
"name" : "message",
"value" : "
Client does not exist
",
"value" : "
Product does not exist, wrong product is 307588001
",
"description" : "",
"description" : "",
"required" : false,
"required" : false,
"dataType" : "String",
"dataType" : "String",
...
@@ -116,7 +116,7 @@
...
@@ -116,7 +116,7 @@
"children" : [ ]
"children" : [ ]
}, {
}, {
"name" : "datetime",
"name" : "datetime",
"value" : "2023-0
1-29 16:50:49
",
"value" : "2023-0
2-23 15:48:41
",
"description" : "",
"description" : "",
"required" : false,
"required" : false,
"dataType" : "String",
"dataType" : "String",
...
@@ -148,7 +148,7 @@ var sql = """
...
@@ -148,7 +148,7 @@ var sql = """
inner join md_rack mr on mr.id = sb.rack_id
inner join md_rack mr on mr.id = sb.rack_id
where su.del_flag = 0
where su.del_flag = 0
and su.quantity > 0
and su.quantity > 0
and su.warehouse_id = #{product.warehouse
_i
d}
and su.warehouse_id = #{product.warehouse
I
d}
and su.status = 300
and su.status = 300
and mr.type ='POD'
and mr.type ='POD'
group by productId
group by productId
...
@@ -158,7 +158,7 @@ var sql = """
...
@@ -158,7 +158,7 @@ var sql = """
ob_delivery_order_line odl
ob_delivery_order_line odl
inner join ob_delivery_order od on od.id = odl.delivery_order_id
inner join ob_delivery_order od on od.id = odl.delivery_order_id
where od.del_flag = 0
where od.del_flag = 0
and od.warehouse_id = #{product.warehouse
_i
d}
and od.warehouse_id = #{product.warehouse
I
d}
and od.client_id = #{client.id}
and od.client_id = #{client.id}
and od.status < 600
and od.status < 600
and odl.del_flag = 0
and odl.del_flag = 0
...
...
mushiny/magic-api/task/MFG/反馈库存数据.ms
View file @
ea4c8533
{
{
...
@@ -5,13 +5,13 @@
...
@@ -5,13 +5,13 @@
"groupId" : "d0f77f73a23b4374beb298d66a0dd923",
"groupId" : "d0f77f73a23b4374beb298d66a0dd923",
"name" : "反馈库存数据",
"name" : "反馈库存数据",
"createTime" : null,
"createTime" : null,
"updateTime" : 167
498423851
0,
"updateTime" : 167
713876523
0,
"lock" : null,
"lock" : null,
"createBy" : null,
"createBy" : null,
"updateBy" : "admin",
"updateBy" : "admin",
"path" : "inventoryFeedbackJobHandler",
"path" : "inventoryFeedbackJobHandler",
"cron" : "0 * * * * ?",
"cron" : "0 * * * * ?",
"enabled" :
fals
e,
"enabled" :
tru
e,
"description" : ""
"description" : ""
}
}
================================
================================
...
@@ -37,19 +37,19 @@ var saveLog = (url, param, method, code, result, time, status)=>{
...
@@ -37,19 +37,19 @@ var saveLog = (url, param, method, code, result, time, status)=>{
logApi.setId(IdUtil.getSnowflakeNextId());
logApi.setId(IdUtil.getSnowflakeNextId());
logApi.setType(1);
logApi.setType(1);
logApi.setCreator(10001L);
logApi.setCreator(10001L);
logApi.setCreator
_n
ame('ApiUser');
logApi.setCreator
N
ame('ApiUser');
logApi.setStatus(status);
logApi.setStatus(status);
logApi.setRequest
_t
ime(time::int);
logApi.setRequest
T
ime(time::int);
logApi.setCreate
_d
ate(new Date());
logApi.setCreate
D
ate(new Date());
logApi.setUpdater(10001L);
logApi.setUpdater(10001L);
logApi.setUpdate
_d
ate(new Date());
logApi.setUpdate
D
ate(new Date());
logApi.setRequest
_u
ri(url);
logApi.setRequest
U
ri(url);
logApi.setCode('inventory');
logApi.setCode('inventory');
logApi.setName('库存同步反馈');
logApi.setName('库存同步反馈');
logApi.setRequest
_m
ethod(method);
logApi.setRequest
M
ethod(method);
logApi.setRequest
_p
arams(param);
logApi.setRequest
P
arams(param);
logApi.setResult(result::string);
logApi.setResult(result::string);
logApi.setResult
_s
tatus(code);
logApi.setResult
S
tatus(code);
db.table('sys_log_api').insert(BeanUtil.beanToMap(logApi))
db.table('sys_log_api').insert(BeanUtil.beanToMap(logApi))
}
}
...
...
src/main/java/com/mushiny/wms/mfg/constant/ProductConstant.java
0 → 100644
View file @
ea4c8533
package
com
.
mushiny
.
wms
.
mfg
.
constant
;
/**
* @author Gy
* @since 4.0.0
*/
public
class
ProductConstant
{
public
static
final
String
DEFAULT_UNIT
=
"Pieces"
;
public
static
final
String
DEFAULT_TYPE
=
"default"
;
public
static
final
String
Y
=
"Y"
;
public
static
final
String
EXP
=
"EXP"
;
}
src/main/java/com/mushiny/wms/mfg/entity/BaseClient.java
View file @
ea4c8533
...
@@ -27,6 +27,6 @@ public abstract class BaseClient extends BaseWarehouse {
...
@@ -27,6 +27,6 @@ public abstract class BaseClient extends BaseWarehouse {
* 货主ID
* 货主ID
*/
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Long
client
_i
d
;
private
Long
client
I
d
;
}
}
src/main/java/com/mushiny/wms/mfg/entity/BaseEntitys.java
View file @
ea4c8533
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
package
com
.
mushiny
.
wms
.
mfg
.
entity
;
package
com
.
mushiny
.
wms
.
mfg
.
entity
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
lombok.Data
;
import
lombok.Data
;
import
java.beans.Transient
;
import
java.beans.Transient
;
...
@@ -40,7 +41,7 @@ public abstract class BaseEntitys implements Serializable {
...
@@ -40,7 +41,7 @@ public abstract class BaseEntitys implements Serializable {
* 创建时间
* 创建时间
*/
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
create
_d
ate
;
private
Date
create
D
ate
;
/**
/**
* 备注
* 备注
...
@@ -74,25 +75,25 @@ public abstract class BaseEntitys implements Serializable {
...
@@ -74,25 +75,25 @@ public abstract class BaseEntitys implements Serializable {
* 更新时间
* 更新时间
*/
*/
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Date
update
_d
ate
;
private
Date
update
D
ate
;
/**
/**
* 锁定
* 锁定
*/
*/
private
Integer
entity
_l
ock
=
0
;
private
Integer
entity
L
ock
=
0
;
@Transient
@Transient
public
Integer
getLock
()
{
public
Integer
getLock
()
{
return
entity
_l
ock
;
return
entity
L
ock
;
}
}
@Transient
@Transient
public
void
setLock
(
Integer
entityLock
)
{
public
void
setLock
(
Integer
entityLock
)
{
this
.
entity
_lock
=
entity_l
ock
;
this
.
entity
Lock
=
entityL
ock
;
}
}
public
boolean
isLocked
()
{
public
boolean
isLocked
()
{
return
entity
_l
ock
!=
0
;
return
entity
L
ock
!=
0
;
}
}
@Override
@Override
...
...
src/main/java/com/mushiny/wms/mfg/entity/BaseWarehouse.java
View file @
ea4c8533
...
@@ -27,5 +27,5 @@ public abstract class BaseWarehouse extends BaseEntitys {
...
@@ -27,5 +27,5 @@ public abstract class BaseWarehouse extends BaseEntitys {
* 仓库ID
* 仓库ID
*/
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Long
warehouse
_i
d
;
private
Long
warehouse
I
d
;
}
}
src/main/java/com/mushiny/wms/mfg/entity/LogApi.java
View file @
ea4c8533
...
@@ -43,7 +43,7 @@ public class LogApi {
...
@@ -43,7 +43,7 @@ public class LogApi {
/**
/**
* 接口唯一key
* 接口唯一key
*/
*/
private
String
unique
_k
ey
;
private
String
unique
K
ey
;
/**
/**
* 接口类型 0:接收(对方调用我方提供接口received) 1:发送(我方调用对方提供接口send)
* 接口类型 0:接收(对方调用我方提供接口received) 1:发送(我方调用对方提供接口send)
...
@@ -54,27 +54,27 @@ public class LogApi {
...
@@ -54,27 +54,27 @@ public class LogApi {
/**
/**
* 请求URI
* 请求URI
*/
*/
private
String
request
_u
ri
;
private
String
request
U
ri
;
/**
/**
* 请求方式
* 请求方式
*/
*/
private
String
request
_m
ethod
;
private
String
request
M
ethod
;
/**
/**
* 请求参数
* 请求参数
*/
*/
private
String
request
_p
arams
;
private
String
request
P
arams
;
/**
/**
* 请求时长(毫秒)
* 请求时长(毫秒)
*/
*/
private
Integer
request
_t
ime
;
private
Integer
request
T
ime
;
/**
/**
* 用户代理
* 用户代理
*/
*/
private
String
user
_a
gent
;
private
String
user
A
gent
;
/**
/**
* 操作IP
* 操作IP
...
@@ -94,18 +94,18 @@ public class LogApi {
...
@@ -94,18 +94,18 @@ public class LogApi {
/**
/**
* 结果状态 0:失败 1:成功
* 结果状态 0:失败 1:成功
*/
*/
private
Integer
result
_s
tatus
;
private
Integer
result
S
tatus
;
/**
/**
* 重试次数
* 重试次数
*/
*/
private
Integer
retry
_n
um
;
private
Integer
retry
N
um
;
/**
/**
* 用户名
* 用户名
*/
*/
private
String
creator
_n
ame
;
private
String
creator
N
ame
;
/**
/**
* 创建者
* 创建者
...
@@ -115,7 +115,7 @@ public class LogApi {
...
@@ -115,7 +115,7 @@ public class LogApi {
/**
/**
* 创建时间
* 创建时间
*/
*/
private
Date
create
_d
ate
;
private
Date
create
D
ate
;
/**
/**
* 更新者
* 更新者
...
@@ -125,5 +125,5 @@ public class LogApi {
...
@@ -125,5 +125,5 @@ public class LogApi {
/**
/**
* 更新时间
* 更新时间
*/
*/
private
Date
update
_d
ate
;
private
Date
update
D
ate
;
}
}
\ No newline at end of file
src/main/java/com/mushiny/wms/mfg/entity/Product.java
0 → 100755
View file @
ea4c8533
/*
* Copyright (c) 2020 牧星仓库管理系统 All rights reserved.
*
* http://www.mushiny.com
*
* 版权所有,侵权必究!
*/
package
com
.
mushiny
.
wms
.
mfg
.
entity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.math.BigDecimal
;
/**
* 商品管理
*
* @author Gy
* @since 4.0.0
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
Product
extends
BaseClient
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 商品编码
*/
private
String
code
;
/**
* 商品SKU
*/
private
String
sku
;
/**
* 商品名称
*/
private
String
name
;
/**
* 商品描述
*/
private
String
description
;
/**
* 商品名称
*/
private
String
pictureName
;
/**
* 商品主图URL
*/
private
String
pictureUrl
;
/**
* 商品品牌ID
*/
private
Long
brandId
;
/**
* 商品类型ID
*/
private
Long
productTypeId
;
/**
* 商品分组ID
*/
private
Long
productGroupId
;
/**
* 宽度
*/
private
BigDecimal
width
;
/**
* 高度
*/
private
BigDecimal
height
;
/**
* 深度
*/
private
BigDecimal
depth
;
/**
* 体积
*/
private
BigDecimal
volume
;
/**
* 重量
*/
private
BigDecimal
weight
;
/**
* 需要收货通知 0:不需要 1:需要
*/
private
Integer
adviceMandatory
;
/**
* 需要批次管理 0:不需要 1:需要
*/
private
Integer
lotMandatory
;
/**
* 需要有效期管理 0:不需要 1:需要
*/
private
Integer
bestBeforeMandatory
;
/**
* 可以用其他批次替代
*/
private
Integer
lotSubstitutionType
;
/**
* 收货的最小剩余期限
*/
private
Integer
restUsageGi
=
0
;
/**
* 拣货的最小剩余期限
*/
private
Integer
restUsageGo
;
/**
* 记录序列号类型
*/
private
Integer
serialNoRecordType
;
/**
* 记录重量类型
*/
private
Integer
weightRecordType
;
/**
* 有效期类型 MANUFACTURE:生产日期,EXPIRATION:到期日期
*/
private
String
bestBeforeType
;
/**
* 有效期单位 YEAR:年,MONTH:月,DAY:日
*/
private
String
bestBeforeUnit
;
/**
* 保质期之前的最少天数
*/
private
Integer
shelfLife
;
/**
* 安全库存
*/
private
Integer
safetyStock
;
/**
* 贸易集团
*/
private
String
tradeGroup
;
/**
* 默认包装单位ID
*/
private
Long
defaultPackagingUnitId
;
/**
* 默认存储策略ID
*/
private
Long
defaultStorageStrategyId
;
/**
* 默认装载单元类型ID
*/
private
Long
defaultUnitLoadTypeId
;
/**
* 计量单位ID
*/
private
Long
uomId
;
/**
* 商品默认存储区域ID
*/
private
Long
zoneId
;
}
\ No newline at end of file
src/main/java/com/mushiny/wms/mfg/entity/ProductCode.java
0 → 100755
View file @
ea4c8533
/*
* Copyright (c) 2020 牧星仓库管理系统 All rights reserved.
*
* http://www.mushiny.com
*
* 版权所有,侵权必究!
*/
package
com
.
mushiny
.
wms
.
mfg
.
entity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* 商品其他唯一编码
*
* @author Gy
* @since 4.0.0
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
ProductCode
extends
BaseClient
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 商品其他唯一编码
*/
private
String
code
;
/**
* 生产商名称
*/
private
String
manufacturerName
;
/**
* 商品ID
*/
private
Long
productId
;
/**
* 包装单元ID
*/
private
Long
packagingUnitId
;
}
\ No newline at end of file
src/main/java/com/mushiny/wms/mfg/interceptor/MyNamedTableInterceptor.java
View file @
ea4c8533
package
com
.
mushiny
.
wms
.
mfg
.
interceptor
;
package
com
.
mushiny
.
wms
.
mfg
.
interceptor
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.IdUtil
;
import
com.mushiny.wms.mfg.constant.DateFormatPattern
;
import
com.mushiny.wms.mfg.utils.DateTimeUtil
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.ssssssss.magicapi.modules.db.inteceptor.NamedTableInterceptor
;
import
org.ssssssss.magicapi.modules.db.inteceptor.NamedTableInterceptor
;
import
org.ssssssss.magicapi.modules.db.model.SqlMode
;
import
org.ssssssss.magicapi.modules.db.model.SqlMode
;
import
org.ssssssss.magicapi.modules.db.table.NamedTable
;
import
org.ssssssss.magicapi.modules.db.table.NamedTable
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Date
;
/**
/**
...
@@ -23,17 +26,16 @@ public class MyNamedTableInterceptor implements NamedTableInterceptor {
...
@@ -23,17 +26,16 @@ public class MyNamedTableInterceptor implements NamedTableInterceptor {
@Override
@Override
public
void
preHandle
(
SqlMode
sqlMode
,
NamedTable
namedTable
)
{
public
void
preHandle
(
SqlMode
sqlMode
,
NamedTable
namedTable
)
{
Date
date
=
new
Date
();
if
(
sqlMode
==
SqlMode
.
INSERT
)
{
if
(
sqlMode
==
SqlMode
.
INSERT
)
{
namedTable
.
column
(
"id"
,
IdUtil
.
getSnowflakeNextId
());
namedTable
.
column
(
"id"
,
IdUtil
.
getSnowflakeNextId
());
namedTable
.
column
(
"creator"
,
userId
);
namedTable
.
column
(
"creator"
,
userId
);
namedTable
.
column
(
"create_date"
,
date
);
namedTable
.
column
(
"create_date"
,
new
Date
()
);
namedTable
.
column
(
"updater"
,
userId
);
namedTable
.
column
(
"updater"
,
userId
);
namedTable
.
column
(
"update_date"
,
date
);
namedTable
.
column
(
"update_date"
,
new
Date
()
);
}
else
if
(
sqlMode
==
SqlMode
.
UPDATE
)
{
}
else
if
(
sqlMode
==
SqlMode
.
UPDATE
)
{
namedTable
.
column
(
"updater"
,
userId
);
namedTable
.
column
(
"updater"
,
userId
);
namedTable
.
column
(
"update_date"
,
date
);
namedTable
.
column
(
"update_date"
,
new
Date
()
);
}
}
}
}
...
...
src/main/resources/application.yml
View file @
ea4c8533
...
@@ -20,6 +20,7 @@ magic-api:
...
@@ -20,6 +20,7 @@ magic-api:
security
:
# 安全配置
security
:
# 安全配置
username
:
admin
# 登录用的用户名
username
:
admin
# 登录用的用户名
password
:
123456
# 登录用的密码
password
:
123456
# 登录用的密码
sql-column-case
:
camel
# 启用驼峰命名转换
spring
:
spring
:
datasource
:
datasource
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment