Commit ea4c8533 authored by guoyu's avatar guoyu

优化

parent 04f9aa1c
This diff is collapsed.
{
{
......@@ -5,7 +5,7 @@
"groupId" : "504dbc7823444f7a8df13edb6b189120",
"name" : "获取商品库存",
"createTime" : null,
"updateTime" : 1674982355092,
"updateTime" : 1677138527008,
"lock" : null,
"createBy" : null,
"updateBy" : "admin",
......@@ -13,10 +13,10 @@
"method" : "POST",
"parameters" : [ ],
"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" : [ ],
"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,
"requestBodyDefinition" : {
"name" : "",
......@@ -65,7 +65,7 @@
"expression" : "",
"children" : [ {
"name" : "external_sku_id",
"value" : "001",
"value" : "30758800",
"description" : "",
"required" : false,
"dataType" : "String",
......@@ -104,7 +104,7 @@
"children" : [ ]
}, {
"name" : "message",
"value" : "Client does not exist",
"value" : "Product does not exist, wrong product is 307588001",
"description" : "",
"required" : false,
"dataType" : "String",
......@@ -116,7 +116,7 @@
"children" : [ ]
}, {
"name" : "datetime",
"value" : "2023-01-29 16:50:49",
"value" : "2023-02-23 15:48:41",
"description" : "",
"required" : false,
"dataType" : "String",
......@@ -148,7 +148,7 @@ var sql = """
inner join md_rack mr on mr.id = sb.rack_id
where su.del_flag = 0
and su.quantity > 0
and su.warehouse_id = #{product.warehouse_id}
and su.warehouse_id = #{product.warehouseId}
and su.status = 300
and mr.type ='POD'
group by productId
......@@ -158,7 +158,7 @@ var sql = """
ob_delivery_order_line odl
inner join ob_delivery_order od on od.id = odl.delivery_order_id
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.status < 600
and odl.del_flag = 0
......
{
{
......@@ -5,13 +5,13 @@
"groupId" : "d0f77f73a23b4374beb298d66a0dd923",
"name" : "反馈库存数据",
"createTime" : null,
"updateTime" : 1674984238510,
"updateTime" : 1677138765230,
"lock" : null,
"createBy" : null,
"updateBy" : "admin",
"path" : "inventoryFeedbackJobHandler",
"cron" : "0 * * * * ?",
"enabled" : false,
"enabled" : true,
"description" : ""
}
================================
......@@ -37,19 +37,19 @@ var saveLog = (url, param, method, code, result, time, status)=>{
logApi.setId(IdUtil.getSnowflakeNextId());
logApi.setType(1);
logApi.setCreator(10001L);
logApi.setCreator_name('ApiUser');
logApi.setCreatorName('ApiUser');
logApi.setStatus(status);
logApi.setRequest_time(time::int);
logApi.setCreate_date(new Date());
logApi.setRequestTime(time::int);
logApi.setCreateDate(new Date());
logApi.setUpdater(10001L);
logApi.setUpdate_date(new Date());
logApi.setRequest_uri(url);
logApi.setUpdateDate(new Date());
logApi.setRequestUri(url);
logApi.setCode('inventory');
logApi.setName('库存同步反馈');
logApi.setRequest_method(method);
logApi.setRequest_params(param);
logApi.setRequestMethod(method);
logApi.setRequestParams(param);
logApi.setResult(result::string);
logApi.setResult_status(code);
logApi.setResultStatus(code);
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 {
* 货主ID
*/
@TableField(fill = FieldFill.INSERT)
private Long client_id;
private Long clientId;
}
......@@ -9,6 +9,7 @@
package com.mushiny.wms.mfg.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.beans.Transient;
......@@ -40,7 +41,7 @@ public abstract class BaseEntitys implements Serializable {
* 创建时间
*/
@TableField(fill = FieldFill.INSERT)
private Date create_date;
private Date createDate;
/**
* 备注
......@@ -74,25 +75,25 @@ public abstract class BaseEntitys implements Serializable {
* 更新时间
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date update_date;
private Date updateDate;
/**
* 锁定
*/
private Integer entity_lock = 0;
private Integer entityLock = 0;
@Transient
public Integer getLock() {
return entity_lock;
return entityLock;
}
@Transient
public void setLock(Integer entityLock) {
this.entity_lock = entity_lock;
this.entityLock = entityLock;
}
public boolean isLocked() {
return entity_lock != 0;
return entityLock != 0;
}
@Override
......
......@@ -27,5 +27,5 @@ public abstract class BaseWarehouse extends BaseEntitys {
* 仓库ID
*/
@TableField(fill = FieldFill.INSERT)
private Long warehouse_id;
private Long warehouseId;
}
......@@ -43,7 +43,7 @@ public class LogApi {
/**
* 接口唯一key
*/
private String unique_key;
private String uniqueKey;
/**
* 接口类型 0:接收(对方调用我方提供接口received) 1:发送(我方调用对方提供接口send)
......@@ -54,27 +54,27 @@ public class LogApi {
/**
* 请求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
......@@ -94,18 +94,18 @@ public class LogApi {
/**
* 结果状态 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 {
/**
* 创建时间
*/
private Date create_date;
private Date createDate;
/**
* 更新者
......@@ -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;
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.stereotype.Component;
import org.ssssssss.magicapi.modules.db.inteceptor.NamedTableInterceptor;
import org.ssssssss.magicapi.modules.db.model.SqlMode;
import org.ssssssss.magicapi.modules.db.table.NamedTable;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
......@@ -23,17 +26,16 @@ public class MyNamedTableInterceptor implements NamedTableInterceptor {
@Override
public void preHandle(SqlMode sqlMode, NamedTable namedTable) {
Date date = new Date();
if (sqlMode == SqlMode.INSERT) {
namedTable.column("id", IdUtil.getSnowflakeNextId());
namedTable.column("creator", userId);
namedTable.column("create_date", date);
namedTable.column("create_date", new Date());
namedTable.column("updater", userId);
namedTable.column("update_date", date);
namedTable.column("update_date", new Date());
}else if (sqlMode == SqlMode.UPDATE) {
namedTable.column("updater", userId);
namedTable.column("update_date", date);
namedTable.column("update_date", new Date());
}
}
......
......@@ -20,6 +20,7 @@ magic-api:
security: # 安全配置
username: admin # 登录用的用户名
password: 123456 # 登录用的密码
sql-column-case: camel # 启用驼峰命名转换
spring:
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