Commit 61beea43 authored by guoyu's avatar guoyu

初始化

parent a2cf2408
{
{
......@@ -5,7 +5,7 @@
"groupId" : "504dbc7823444f7a8df13edb6b189120",
"name" : "获取结果处理",
"createTime" : null,
"updateTime" : 1673949363712,
"updateTime" : 1674898234909,
"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" : "name",
"value" : "gy",
"name" : "code",
"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
{
{
......@@ -5,13 +5,13 @@
"groupId" : "d0f77f73a23b4374beb298d66a0dd923",
"name" : "反馈库存数据",
"createTime" : null,
"updateTime" : 1673949461914,
"updateTime" : 1674972843173,
"lock" : null,
"createBy" : null,
"updateBy" : "admin",
"path" : "inventoryFeedbackJobHandler",
"cron" : "0 * * * * ?",
"enabled" : false,
"enabled" : true,
"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)=>{
......
......@@ -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>
......
/*
* 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
......@@ -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 clientId;
private Long client_id;
}
......@@ -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 createDate;
private Date create_date;
/**
* 备注
......@@ -74,25 +74,25 @@ public abstract class BaseEntitys implements Serializable {
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateDate;
private Date update_date;
/**
* 锁定
*/
private Integer entityLock = 0;
private Integer entity_lock = 0;
@Transient
public Integer getLock() {
return entityLock;
return entity_lock;
}
@Transient
public void setLock(Integer entityLock) {
this.entityLock = entityLock;
this.entity_lock = entity_lock;
}
public boolean isLocked() {
return entityLock != 0;
return entity_lock != 0;
}
@Override
......
......@@ -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 warehouseId;
private Long warehouse_id;
}
/*
* 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
......@@ -15,7 +15,7 @@ import lombok.EqualsAndHashCode;
* 商品分组
*
* @author Gy
* @since 2.1.0
* @since 4.0.0
*/
@Data
@EqualsAndHashCode(callSuper = false)
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment