Commit ea4c8533 authored by guoyu's avatar guoyu

优化

parent 04f9aa1c
This diff is collapsed.
{ {
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"groupId" : "504dbc7823444f7a8df13edb6b189120", "groupId" : "504dbc7823444f7a8df13edb6b189120",
"name" : "获取商品库存", "name" : "获取商品库存",
"createTime" : null, "createTime" : null,
"updateTime" : 1674982355092, "updateTime" : 1677138527008,
"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-01-29 16:50:49", "value" : "2023-02-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_id} and su.warehouse_id = #{product.warehouseId}
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_id} and od.warehouse_id = #{product.warehouseId}
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
......
{ {
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
"groupId" : "d0f77f73a23b4374beb298d66a0dd923", "groupId" : "d0f77f73a23b4374beb298d66a0dd923",
"name" : "反馈库存数据", "name" : "反馈库存数据",
"createTime" : null, "createTime" : null,
"updateTime" : 1674984238510, "updateTime" : 1677138765230,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : "admin", "updateBy" : "admin",
"path" : "inventoryFeedbackJobHandler", "path" : "inventoryFeedbackJobHandler",
"cron" : "0 * * * * ?", "cron" : "0 * * * * ?",
"enabled" : false, "enabled" : true,
"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_name('ApiUser'); logApi.setCreatorName('ApiUser');
logApi.setStatus(status); logApi.setStatus(status);
logApi.setRequest_time(time::int); logApi.setRequestTime(time::int);
logApi.setCreate_date(new Date()); logApi.setCreateDate(new Date());
logApi.setUpdater(10001L); logApi.setUpdater(10001L);
logApi.setUpdate_date(new Date()); logApi.setUpdateDate(new Date());
logApi.setRequest_uri(url); logApi.setRequestUri(url);
logApi.setCode('inventory'); logApi.setCode('inventory');
logApi.setName('库存同步反馈'); logApi.setName('库存同步反馈');
logApi.setRequest_method(method); logApi.setRequestMethod(method);
logApi.setRequest_params(param); logApi.setRequestParams(param);
logApi.setResult(result::string); logApi.setResult(result::string);
logApi.setResult_status(code); logApi.setResultStatus(code);
db.table('sys_log_api').insert(BeanUtil.beanToMap(logApi)) db.table('sys_log_api').insert(BeanUtil.beanToMap(logApi))
} }
......
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";
}
...@@ -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_id; private Long clientId;
} }
...@@ -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_date; private Date createDate;
/** /**
* 备注 * 备注
...@@ -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_date; private Date updateDate;
/** /**
* 锁定 * 锁定
*/ */
private Integer entity_lock = 0; private Integer entityLock = 0;
@Transient @Transient
public Integer getLock() { public Integer getLock() {
return entity_lock; return entityLock;
} }
@Transient @Transient
public void setLock(Integer entityLock) { public void setLock(Integer entityLock) {
this.entity_lock = entity_lock; this.entityLock = entityLock;
} }
public boolean isLocked() { public boolean isLocked() {
return entity_lock != 0; return entityLock != 0;
} }
@Override @Override
......
...@@ -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_id; private Long warehouseId;
} }
...@@ -43,7 +43,7 @@ public class LogApi { ...@@ -43,7 +43,7 @@ public class LogApi {
/** /**
* 接口唯一key * 接口唯一key
*/ */
private String unique_key; private String uniqueKey;
/** /**
* 接口类型 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_uri; private String requestUri;
/** /**
* 请求方式 * 请求方式
*/ */
private String request_method; private String requestMethod;
/** /**
* 请求参数 * 请求参数
*/ */
private String request_params; private String requestParams;
/** /**
* 请求时长(毫秒) * 请求时长(毫秒)
*/ */
private Integer request_time; private Integer requestTime;
/** /**
* 用户代理 * 用户代理
*/ */
private String user_agent; private String userAgent;
/** /**
* 操作IP * 操作IP
...@@ -94,18 +94,18 @@ public class LogApi { ...@@ -94,18 +94,18 @@ public class LogApi {
/** /**
* 结果状态 0:失败 1:成功 * 结果状态 0:失败 1:成功
*/ */
private Integer result_status; private Integer resultStatus;
/** /**
* 重试次数 * 重试次数
*/ */
private Integer retry_num; private Integer retryNum;
/** /**
* 用户名 * 用户名
*/ */
private String creator_name; private String creatorName;
/** /**
* 创建者 * 创建者
...@@ -115,7 +115,7 @@ public class LogApi { ...@@ -115,7 +115,7 @@ public class LogApi {
/** /**
* 创建时间 * 创建时间
*/ */
private Date create_date; private Date createDate;
/** /**
* 更新者 * 更新者
...@@ -125,5 +125,5 @@ public class LogApi { ...@@ -125,5 +125,5 @@ public class LogApi {
/** /**
* 更新时间 * 更新时间
*/ */
private Date update_date; private Date updateDate;
} }
\ No newline at end of file
/*
* 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
/*
* 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
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());
} }
} }
......
...@@ -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:
......
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