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
61beea43
Commit
61beea43
authored
Jan 29, 2023
by
guoyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化
parent
a2cf2408
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
206 additions
and
109 deletions
+206
-109
获取结果处理.ms
mushiny/magic-api/api/MFG/获取结果处理.ms
+7
-7
反馈库存数据.ms
mushiny/magic-api/task/MFG/反馈库存数据.ms
+39
-10
pom.xml
pom.xml
+5
-0
FieldMetaObjectHandler.java
...va/com/mushiny/wms/mfg/config/FieldMetaObjectHandler.java
+0
-71
BaseClient.java
src/main/java/com/mushiny/wms/mfg/entity/BaseClient.java
+3
-3
BaseEntitys.java
src/main/java/com/mushiny/wms/mfg/entity/BaseEntitys.java
+8
-8
BaseWarehouse.java
src/main/java/com/mushiny/wms/mfg/entity/BaseWarehouse.java
+3
-3
LogApi.java
src/main/java/com/mushiny/wms/mfg/entity/LogApi.java
+130
-0
ProductGroup.java
src/main/java/com/mushiny/wms/mfg/entity/ProductGroup.java
+1
-1
application.yml
src/main/resources/application.yml
+10
-6
No files found.
mushiny/magic-api/api/MFG/获取结果处理.ms
View file @
61beea43
{
{
...
...
@@ -5,7 +5,7 @@
"groupId" : "504dbc7823444f7a8df13edb6b189120",
"name" : "获取结果处理",
"createTime" : null,
"updateTime" : 167
3949363712
,
"updateTime" : 167
4898234909
,
"lock" : null,
"createBy" : null,
"updateBy" : "admin",
...
...
@@ -16,7 +16,7 @@
"requestBody" : "{\"name\":\"gy\"}",
"headers" : [ ],
"paths" : [ ],
"responseBody" : "{\n \"
name\": \"gy
\"\n}",
"responseBody" : "{\n \"
code\": \"Success
\"\n}",
"description" : null,
"requestBodyDefinition" : {
"name" : "",
...
...
@@ -55,8 +55,8 @@
"error" : "",
"expression" : "",
"children" : [ {
"name" : "
nam
e",
"value" : "
gy
",
"name" : "
cod
e",
"value" : "
Success
",
"description" : "",
"required" : false,
"dataType" : "String",
...
...
@@ -77,6 +77,5 @@ log.info("返回header:{}", header);
log.info("返回body:{}", body);
return response.json({
success : true,
message : '执行成功'
code: 'Success'
});
\ No newline at end of file
mushiny/magic-api/task/MFG/反馈库存数据.ms
View file @
61beea43
{
{
...
...
@@ -5,13 +5,13 @@
"groupId" : "d0f77f73a23b4374beb298d66a0dd923",
"name" : "反馈库存数据",
"createTime" : null,
"updateTime" : 167
3949461914
,
"updateTime" : 167
4972843173
,
"lock" : null,
"createBy" : null,
"updateBy" : "admin",
"path" : "inventoryFeedbackJobHandler",
"cron" : "0 * * * * ?",
"enabled" :
fals
e,
"enabled" :
tru
e,
"description" : ""
}
================================
...
...
@@ -21,16 +21,43 @@ import http;
import log;
import 'com.mushiny.wms.mfg.dto.InventoryFeedbackResult' as InventoryFeedbackResult;
import 'com.mushiny.wms.mfg.utils.DateTimeUtil' as DateTimeUtils;
import 'com.mushiny.wms.mfg.constant.ResultStatus' as ResultStatus;
import 'cn.hutool.core.util.IdUtil' as IdUtil;
import 'cn.hutool.core.bean.BeanUtil' as BeanUtil;
import 'com.mushiny.wms.mfg.entity.LogApi' as LogApi;
var url =
'http://127.0.0.1:8088/mfg/receiveData'
;
var url =
env.get('custom.url.feedbackInventory')
;
//mfg本地环境
var DWMSCONNECTIONKEY =
"c84b8e4c297269d70205c5450cd278a4fdfc2ee0"
;
var DWMSCONNECTIONKEY =
env.get('custom.connectionKey')
;
var MAX_LIMIT_SEND_DATA_SIZE = 200;
var saveLog = (url, param, method, code, result, time, status)=>{
LogApi logApi = new LogApi();
logApi.setId(IdUtil.getSnowflakeNextId());
logApi.setType(1);
logApi.setCreator(10001L);
logApi.setCreator_name('ApiUser');
logApi.setStatus(status);
logApi.setRequest_time(time::int);
logApi.setCreate_date(new Date());
logApi.setUpdater(10001L);
logApi.setUpdate_date(new Date());
logApi.setRequest_uri(url);
logApi.setCode('inventory');
logApi.setName('库存同步反馈');
logApi.setRequest_method(method);
logApi.setRequest_params(param);
logApi.setResult(result::string);
logApi.setResult_status(code);
db.table('sys_log_api').insert(BeanUtil.beanToMap(logApi))
}
var callInterface = (result, url, connectionId)=>{
String param = result::stringify;
// log.info("调用的url:{},发送的数据:{}", url, param);
log.info("调用的url:{},发送的数据:{}", url, param);
long start = System.currentTimeMillis();
var json = http.connect(url)
.header({
'Content-Type' : 'application/json',
...
...
@@ -38,10 +65,12 @@ var callInterface = (result, url, connectionId)=>{
'DWMSCONNECTIONID' : connectionId,
})
.body(result).post().getBody();
log.info("json:{}", json);
if (is_null(json) || !ResultStatus.success.equals(json.code)) {
saveLog(url, param, 'POST', 0, json, System.currentTimeMillis() - start, 0);
}else{
saveLog(url, param, 'POST', 1, json, System.currentTimeMillis() - start, 1);
}
log.info("同步库存完成结果{}", json);
}
var feedback = (list, url, pageNo, totalPage)=>{
...
...
pom.xml
View file @
61beea43
...
...
@@ -51,6 +51,11 @@
<version>
8.0.27
</version>
</dependency>
<dependency>
<groupId>
org.postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
...
...
src/main/java/com/mushiny/wms/mfg/config/FieldMetaObjectHandler.java
deleted
100755 → 0
View file @
a2cf2408
/*
* Copyright (c) 2020 牧星仓库管理系统 All rights reserved.
*
* http://www.mushiny.com
*
* 版权所有,侵权必究!
*/
package
com
.
mushiny
.
wms
.
mfg
.
config
;
import
com.baomidou.mybatisplus.core.handlers.MetaObjectHandler
;
import
org.apache.ibatis.reflection.MetaObject
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
/**
* 公共字段,自动填充值
*
* @author Elen elen.shen@mushiny.comn
* @since 2.1.0
*/
@Component
public
class
FieldMetaObjectHandler
implements
MetaObjectHandler
{
private
final
static
String
CREATE_DATE
=
"createDate"
;
private
final
static
String
CREATOR
=
"creator"
;
private
final
static
String
UPDATE_DATE
=
"updateDate"
;
private
final
static
String
UPDATER
=
"updater"
;
private
final
static
String
DEL_FLAG
=
"delFlag"
;
private
final
static
String
DEPT_ID
=
"deptId"
;
@Value
(
"${mushiny.user}"
)
private
Long
userId
;
@Override
public
void
insertFill
(
MetaObject
metaObject
)
{
Date
date
=
new
Date
();
//更新时间
strictInsertFill
(
metaObject
,
UPDATE_DATE
,
Date
.
class
,
date
);
strictInsertFill
(
metaObject
,
CREATE_DATE
,
Date
.
class
,
date
);
//删除标识
strictInsertFill
(
metaObject
,
DEL_FLAG
,
Integer
.
class
,
0
);
//创建者
strictInsertFill
(
metaObject
,
CREATOR
,
Long
.
class
,
userId
);
//创建时间
//创建者所属部门
// strictInsertFill(metaObject, DEPT_ID, Long.class, user.getDeptId());
//更新者
strictInsertFill
(
metaObject
,
UPDATER
,
Long
.
class
,
userId
);
}
@Override
public
void
updateFill
(
MetaObject
metaObject
)
{
//更新时间
setFieldValByName
(
UPDATE_DATE
,
new
Date
(),
metaObject
);
//更新者
setFieldValByName
(
UPDATER
,
userId
,
metaObject
);
}
}
\ No newline at end of file
src/main/java/com/mushiny/wms/mfg/entity/BaseClient.java
100755 → 100644
View file @
61beea43
...
...
@@ -16,8 +16,8 @@ import lombok.EqualsAndHashCode;
/**
* 货主基础实体类,所有货主实体都需要继承
*
* @author
Elen elen.shen@mushiny.comn
* @since
2.1
.0
* @author
Gy
* @since
4.0
.0
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
...
...
@@ -27,6 +27,6 @@ public abstract class BaseClient extends BaseWarehouse {
* 货主ID
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Long
client
I
d
;
private
Long
client
_i
d
;
}
src/main/java/com/mushiny/wms/mfg/entity/BaseEntitys.java
100755 → 100644
View file @
61beea43
...
...
@@ -18,8 +18,8 @@ import java.util.Date;
/**
* 基础实体类,所有实体都需要继承
*
* @author
Elen elen.shen@mushiny.comn
* @since
2.1
.0
* @author
Gy
* @since
4.0
.0
*/
@Data
public
abstract
class
BaseEntitys
implements
Serializable
{
...
...
@@ -40,7 +40,7 @@ public abstract class BaseEntitys implements Serializable {
* 创建时间
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
create
D
ate
;
private
Date
create
_d
ate
;
/**
* 备注
...
...
@@ -74,25 +74,25 @@ public abstract class BaseEntitys implements Serializable {
* 更新时间
*/
@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
public
Integer
getLock
()
{
return
entity
L
ock
;
return
entity
_l
ock
;
}
@Transient
public
void
setLock
(
Integer
entityLock
)
{
this
.
entity
Lock
=
entityL
ock
;
this
.
entity
_lock
=
entity_l
ock
;
}
public
boolean
isLocked
()
{
return
entity
L
ock
!=
0
;
return
entity
_l
ock
!=
0
;
}
@Override
...
...
src/main/java/com/mushiny/wms/mfg/entity/BaseWarehouse.java
100755 → 100644
View file @
61beea43
...
...
@@ -16,8 +16,8 @@ import lombok.EqualsAndHashCode;
/**
* 仓库基础实体类,所有仓库实体都需要继承
*
* @author
Elen elen.shen@mushiny.comn
* @since
2.1
.0
* @author
Gy
* @since
4.0
.0
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
...
...
@@ -27,5 +27,5 @@ public abstract class BaseWarehouse extends BaseEntitys {
* 仓库ID
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Long
warehouse
I
d
;
private
Long
warehouse
_i
d
;
}
src/main/java/com/mushiny/wms/mfg/entity/LogApi.java
0 → 100644
View file @
61beea43
/*
* Copyright (c) 2020 牧星仓库管理系统 All rights reserved.
*
* http://www.mushiny.com
*
* 版权所有,侵权必究!
*/
package
com
.
mushiny
.
wms
.
mfg
.
entity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 接口日志
*
* @author Gy
* @since 4.0.0
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
LogApi
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* ID
*/
private
Long
id
;
/**
* 接口编码
*/
private
String
code
;
/**
* 接口名称
*/
private
String
name
;
/**
* 接口唯一key
*/
private
String
unique_key
;
/**
* 接口类型 0:接收(对方调用我方提供接口received) 1:发送(我方调用对方提供接口send)
*/
private
Integer
type
;
/**
* 请求URI
*/
private
String
request_uri
;
/**
* 请求方式
*/
private
String
request_method
;
/**
* 请求参数
*/
private
String
request_params
;
/**
* 请求时长(毫秒)
*/
private
Integer
request_time
;
/**
* 用户代理
*/
private
String
user_agent
;
/**
* 操作IP
*/
private
String
ip
;
/**
* 状态 0:失败 1:成功
*/
private
Integer
status
;
/**
* 返回结果
*/
private
String
result
;
/**
* 结果状态 0:失败 1:成功
*/
private
Integer
result_status
;
/**
* 重试次数
*/
private
Integer
retry_num
;
/**
* 用户名
*/
private
String
creator_name
;
/**
* 创建者
*/
private
Long
creator
;
/**
* 创建时间
*/
private
Date
create_date
;
/**
* 更新者
*/
private
Long
updater
;
/**
* 更新时间
*/
private
Date
update_date
;
}
\ No newline at end of file
src/main/java/com/mushiny/wms/mfg/entity/ProductGroup.java
View file @
61beea43
...
...
@@ -15,7 +15,7 @@ import lombok.EqualsAndHashCode;
* 商品分组
*
* @author Gy
* @since
2.1
.0
* @since
4.0
.0
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
...
...
src/main/resources/application.yml
View file @
61beea43
...
...
@@ -23,14 +23,19 @@ magic-api:
spring
:
datasource
:
driver-class-name
:
com.mysql.cj.jdbc
.Driver
url
:
jdbc:
mysql://localhost:3306/ft_test?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8
username
:
root
password
:
123456789
driver-class-name
:
org.postgresql
.Driver
url
:
jdbc:
postgresql://192.168.2.208:5432/wms?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false
username
:
wms_user
password
:
2HviB7A%R0
mvc
:
pathmatch
:
matching-strategy
:
ant_path_matcher
mushiny
:
user
:
1067246875800000001
warehouse
:
1303927529038716929
\ No newline at end of file
warehouse
:
1303927529038716929
custom
:
connectionKey
:
c84b8e4c297269d70205c5450cd278a4fdfc2ee0
url
:
feedbackInventory
:
http://127.0.0.1:8088/mfg/receiveData
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