Houjie
2025-05-26 7f99e4a369319397c44767b5e8d558fefa049c4e
Merge remote-tracking branch 'origin/master'
已添加22个文件
已修改8个文件
2923 ■■■■■ 文件已修改
lxzn-module-system/lxzn-system-start/src/main/resources/db/tms_2025/tms-init-20250522.sql 1240 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/controller/InStoreDetailController.java 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/controller/InboundDetailController.java 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/controller/InboundOrderController.java 237 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/InStoreDetail.java 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/InboundDetail.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/InboundOrder.java 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/ToolsConfigProperty.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/dto/InboundOrderFlowDto.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaBladeVo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaCommonToolVo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaMillToolVo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaThreadingToolVo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaTurningToolsVo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/InStoreDetailMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/InboundDetailMapper.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/InboundOrderMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/BaseToolsMapper.xml 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/InStoreDetailMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/InboundDetailMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/InboundOrderMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/IInStoreDetailService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/IInboundDetailService.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/IInboundOrderService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/impl/InStoreDetailServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/impl/InboundDetailServiceImpl.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/impl/InboundOrderServiceImpl.java 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/impl/ToolsClassifyServiceImpl.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/utils/QrCodePrinterUtils.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/utils/QrCodeUtils.java 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-system/lxzn-system-start/src/main/resources/db/tms_2025/tms-init-20250522.sql
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1240 @@
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tools_classify]') AND type in (N'U')) DROP TABLE [dbo].[tools_classify];
CREATE TABLE [dbo].[tools_classify](
    id VARCHAR(32) NOT NULL,
    classify_id VARCHAR(255),
    type_name VARCHAR(128) NOT NULL,
    parent_id VARCHAR(32) NOT NULL,
    leaf_flag VARCHAR(6),
    seq VARCHAR(255),
    status VARCHAR(6),
    rank INT NOT NULL,
    encoding_type VARCHAR(32),
    para_type_flag VARCHAR(32) NOT NULL,
    remark VARCHAR(128),
    tenant_id ,
    created_by VARCHAR(32),
    created_time DATE,
    updated_by VARCHAR(32),
    updated_time DATE,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '工具分类信息表', 'SCHEMA', dbo, 'table', tools_classify, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', tools_classify, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '分类编号', 'SCHEMA', dbo, 'table', tools_classify, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '类型名称', 'SCHEMA', dbo, 'table', tools_classify, 'column', type_name;
EXEC sp_addextendedproperty 'MS_Description', '父类型编号', 'SCHEMA', dbo, 'table', tools_classify, 'column', parent_id;
EXEC sp_addextendedproperty 'MS_Description', '叶子节点标记;1是2否', 'SCHEMA', dbo, 'table', tools_classify, 'column', leaf_flag;
EXEC sp_addextendedproperty 'MS_Description', '显示序号', 'SCHEMA', dbo, 'table', tools_classify, 'column', seq;
EXEC sp_addextendedproperty 'MS_Description', '状态;1.启用;2.关闭', 'SCHEMA', dbo, 'table', tools_classify, 'column', status;
EXEC sp_addextendedproperty 'MS_Description', '层级', 'SCHEMA', dbo, 'table', tools_classify, 'column', rank;
EXEC sp_addextendedproperty 'MS_Description', '工具分类编码方式;1.系统生成;
2.按编码拼接;
3.手工编码', 'SCHEMA', dbo, 'table', tools_classify, 'column', encoding_type;
EXEC sp_addextendedproperty 'MS_Description', '对应参数模板表名称', 'SCHEMA', dbo, 'table', tools_classify, 'column', para_type_flag;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', tools_classify, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', tools_classify, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', tools_classify, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', tools_classify, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', tools_classify, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', tools_classify, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[base_tools]') AND type in (N'U')) DROP TABLE [dbo].[base_tools];
CREATE TABLE [dbo].[base_tools](
    id 32(32) NOT NULL,
    classify_id 32(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    tool_id VARCHAR(32),
    tool_level VARCHAR(16),
    i_count VARCHAR(255),
    sign_code VARCHAR(16),
    chinese_name VARCHAR(128),
    foreign_language_name VARCHAR(128),
    standard_level VARCHAR(16),
    standard_code VARCHAR(32),
    tool_model VARCHAR(255),
    remark VARCHAR(255),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '工具信息表', 'SCHEMA', dbo, 'table', base_tools, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', base_tools, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '分类编号', 'SCHEMA', dbo, 'table', base_tools, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '工具编码', 'SCHEMA', dbo, 'table', base_tools, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', base_tools, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '工具等级;工具精确等级分为3个等级:分别为A、B、C
A类:特别重要,入库的工具是要附实物编码(例如:Q20120918011-0001)
B类:一般重要,入库的工具是不附实物编码(例如:Q20120918011)
Cç±»:不重要,没有特殊规定,航宇暂时没有使用场景', 'SCHEMA', dbo, 'table', base_tools, 'column', tool_level;
EXEC sp_addextendedproperty 'MS_Description', '把号最大值', 'SCHEMA', dbo, 'table', base_tools, 'column', i_count;
EXEC sp_addextendedproperty 'MS_Description', '序号(或企业内码)', 'SCHEMA', dbo, 'table', base_tools, 'column', sign_code;
EXEC sp_addextendedproperty 'MS_Description', '中文名称', 'SCHEMA', dbo, 'table', base_tools, 'column', chinese_name;
EXEC sp_addextendedproperty 'MS_Description', '外文名称', 'SCHEMA', dbo, 'table', base_tools, 'column', foreign_language_name;
EXEC sp_addextendedproperty 'MS_Description', '标注级别', 'SCHEMA', dbo, 'table', base_tools, 'column', standard_level;
EXEC sp_addextendedproperty 'MS_Description', '标准号', 'SCHEMA', dbo, 'table', base_tools, 'column', standard_code;
EXEC sp_addextendedproperty 'MS_Description', '型号/图号', 'SCHEMA', dbo, 'table', base_tools, 'column', tool_model;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', base_tools, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', base_tools, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', base_tools, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', base_tools, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', base_tools, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', base_tools, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[para_hole_tools]') AND type in (N'U')) DROP TABLE [dbo].[para_hole_tools];
CREATE TABLE [dbo].[para_hole_tools](
    id VARCHAR(32) NOT NULL,
    classify_id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    sign_code VARCHAR(16),
    chinese_name VARCHAR(128),
    foreign_language_name VARCHAR(128),
    standard_level VARCHAR(16),
    standard_code VARCHAR(32),
    position_code VARCHAR(255),
    tool_model VARCHAR(255) NOT NULL,
    diameter VARCHAR(128) NOT NULL,
    cone_angle VARCHAR(24),
    edge_length VARCHAR(24) NOT NULL,
    total_length VARCHAR(24) NOT NULL,
    tool_material VARCHAR(64) NOT NULL,
    part_material VARCHAR(64),
    paintcoat_flag VARCHAR(32) NOT NULL,
    tool_pattern VARCHAR(64) NOT NULL,
    handle_specifications VARCHAR(128) NOT NULL,
    cooling_method VARCHAR(64) NOT NULL,
    technical_conditions VARCHAR(128) NOT NULL,
    conditions_info VARCHAR(128),
    brand VARCHAR(64),
    types VARCHAR(64),
    tolerance_class VARCHAR(64),
    flute_form VARCHAR(64),
    handle_form VARCHAR(64),
    blade_count VARCHAR(24),
    small_diameter VARCHAR(16),
    chamfer_angle VARCHAR(16),
    fitter_part VARCHAR(64),
    effective_length VARCHAR(16),
    drill_diameter_range VARCHAR(32),
    knife_diameter VARCHAR(16),
    bore_diameter VARCHAR(16),
    connector_type VARCHAR(16),
    slot_specification VARCHAR(32),
    scope_of_application VARCHAR(32),
    latest_boring_diameter VARCHAR(16),
    max_boring_diameter VARCHAR(16),
    processingmethod VARCHAR(64),
    heads_number VARCHAR(16),
    adapt_holder VARCHAR(64),
    remark VARCHAR(128),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '11孔加工刀具g1', 'SCHEMA', dbo, 'table', para_hole_tools, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具分类编号', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '工具编号-主键', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '序号(或企业内原代码)', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', sign_code;
EXEC sp_addextendedproperty 'MS_Description', '中文名称', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', chinese_name;
EXEC sp_addextendedproperty 'MS_Description', '外文名称', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', foreign_language_name;
EXEC sp_addextendedproperty 'MS_Description', '标准级别', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', standard_level;
EXEC sp_addextendedproperty 'MS_Description', '标准号', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', standard_code;
EXEC sp_addextendedproperty 'MS_Description', '库位号(展示时、可以多个拼接);展示时、可以多个拼接成多个库位号的字符串,进行伪列展示。', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', position_code;
EXEC sp_addextendedproperty 'MS_Description', '型号/图号', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', tool_model;
EXEC sp_addextendedproperty 'MS_Description', '直径', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', diameter;
EXEC sp_addextendedproperty 'MS_Description', '切削刃锥角', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', cone_angle;
EXEC sp_addextendedproperty 'MS_Description', '切削刃长', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', edge_length;
EXEC sp_addextendedproperty 'MS_Description', '刀具总长', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', total_length;
EXEC sp_addextendedproperty 'MS_Description', '刀具材料', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', tool_material;
EXEC sp_addextendedproperty 'MS_Description', '零件材料', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', part_material;
EXEC sp_addextendedproperty 'MS_Description', '是否涂层', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', paintcoat_flag;
EXEC sp_addextendedproperty 'MS_Description', '刀具型式', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', tool_pattern;
EXEC sp_addextendedproperty 'MS_Description', '柄部规格', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', handle_specifications;
EXEC sp_addextendedproperty 'MS_Description', '冷却方式', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', cooling_method;
EXEC sp_addextendedproperty 'MS_Description', '附加技术条件', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', technical_conditions;
EXEC sp_addextendedproperty 'MS_Description', '附加技术条件说明', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', conditions_info;
EXEC sp_addextendedproperty 'MS_Description', '品牌', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', brand;
EXEC sp_addextendedproperty 'MS_Description', '制式', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', types;
EXEC sp_addextendedproperty 'MS_Description', '公差等级', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', tolerance_class;
EXEC sp_addextendedproperty 'MS_Description', '排屑槽形式', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', flute_form;
EXEC sp_addextendedproperty 'MS_Description', '柄部形式', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', handle_form;
EXEC sp_addextendedproperty 'MS_Description', '刃数', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', blade_count;
EXEC sp_addextendedproperty 'MS_Description', '最小直径', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', small_diameter;
EXEC sp_addextendedproperty 'MS_Description', '倒角角度', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', chamfer_angle;
EXEC sp_addextendedproperty 'MS_Description', '适配刀片-刀头-刀杆', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', fitter_part;
EXEC sp_addextendedproperty 'MS_Description', '有效加工长度', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', effective_length;
EXEC sp_addextendedproperty 'MS_Description', '钻头直径范围', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', drill_diameter_range;
EXEC sp_addextendedproperty 'MS_Description', '刀杆直径', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', knife_diameter;
EXEC sp_addextendedproperty 'MS_Description', '孔径', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', bore_diameter;
EXEC sp_addextendedproperty 'MS_Description', '接口形式', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', connector_type;
EXEC sp_addextendedproperty 'MS_Description', '接口槽长规格', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', slot_specification;
EXEC sp_addextendedproperty 'MS_Description', '适用范围', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', scope_of_application;
EXEC sp_addextendedproperty 'MS_Description', '最新镗孔直径', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', latest_boring_diameter;
EXEC sp_addextendedproperty 'MS_Description', '最大镗孔直径', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', max_boring_diameter;
EXEC sp_addextendedproperty 'MS_Description', '加工方式', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', processingmethod;
EXEC sp_addextendedproperty 'MS_Description', '刀头数', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', heads_number;
EXEC sp_addextendedproperty 'MS_Description', '适配刀座', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', adapt_holder;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', para_hole_tools, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[para_threading_tool]') AND type in (N'U')) DROP TABLE [dbo].[para_threading_tool];
CREATE TABLE [dbo].[para_threading_tool](
    id VARCHAR(32) NOT NULL,
    classify_id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    sign_code VARCHAR(16),
    chinese_name VARCHAR(128),
    foreign_language_name VARCHAR(128),
    standard_level VARCHAR(16),
    standard_code VARCHAR(32),
    position_code VARCHAR(255),
    tool_model VARCHAR(255) NOT NULL,
    thread_code VARCHAR(64) NOT NULL,
    pitch VARCHAR(16) NOT NULL,
    rotation_direction VARCHAR(16) NOT NULL,
    tolerancezone_level VARCHAR(16) NOT NULL,
    edge_length VARCHAR(32) NOT NULL,
    total_length VARCHAR(32) NOT NULL,
    tool_material VARCHAR(64) NOT NULL,
    part_material VARCHAR(64),
    paintcoat_flag VARCHAR(32) NOT NULL,
    external_dimensions VARCHAR(64),
    handle_specifications VARCHAR(64) NOT NULL,
    technical_conditions VARCHAR(128) NOT NULL,
    conditions_info VARCHAR(128),
    brand VARCHAR(64),
    types VARCHAR(64),
    screw_hole_type VARCHAR(16),
    cooling_method VARCHAR(64),
    thread_standard VARCHAR(32),
    flute_solt_type VARCHAR(32),
    thread_type VARCHAR(32),
    guiding_size VARCHAR(32),
    connection_aperture VARCHAR(32),
    connecting_keyway VARCHAR(64),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '12螺纹刀具g2', 'SCHEMA', dbo, 'table', para_threading_tool, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具分类编号', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '序号(或企业内原代码)', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', sign_code;
EXEC sp_addextendedproperty 'MS_Description', '中文名称', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', chinese_name;
EXEC sp_addextendedproperty 'MS_Description', '外文名称', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', foreign_language_name;
EXEC sp_addextendedproperty 'MS_Description', '标准级别', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', standard_level;
EXEC sp_addextendedproperty 'MS_Description', '标准号', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', standard_code;
EXEC sp_addextendedproperty 'MS_Description', '库位号;由库区+层+排+列组成,可以是多个库位号以英文点号分割的字符串。', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', position_code;
EXEC sp_addextendedproperty 'MS_Description', '型号/图号', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', tool_model;
EXEC sp_addextendedproperty 'MS_Description', '螺纹代号', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', thread_code;
EXEC sp_addextendedproperty 'MS_Description', '螺距', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', pitch;
EXEC sp_addextendedproperty 'MS_Description', '螺纹旋向', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', rotation_direction;
EXEC sp_addextendedproperty 'MS_Description', '螺纹公差带代号/精度等级', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', tolerancezone_level;
EXEC sp_addextendedproperty 'MS_Description', '切削刃长', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', edge_length;
EXEC sp_addextendedproperty 'MS_Description', '刀具总长', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', total_length;
EXEC sp_addextendedproperty 'MS_Description', '刀具材料', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', tool_material;
EXEC sp_addextendedproperty 'MS_Description', '零件材料', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', part_material;
EXEC sp_addextendedproperty 'MS_Description', '是否涂层', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', paintcoat_flag;
EXEC sp_addextendedproperty 'MS_Description', '外型尺寸', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', external_dimensions;
EXEC sp_addextendedproperty 'MS_Description', '柄部规格', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', handle_specifications;
EXEC sp_addextendedproperty 'MS_Description', '附件技术条件', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', technical_conditions;
EXEC sp_addextendedproperty 'MS_Description', '附件技术条件说明', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', conditions_info;
EXEC sp_addextendedproperty 'MS_Description', '品牌', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', brand;
EXEC sp_addextendedproperty 'MS_Description', '制式', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', types;
EXEC sp_addextendedproperty 'MS_Description', '螺孔类型', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', screw_hole_type;
EXEC sp_addextendedproperty 'MS_Description', '冷却方式', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', cooling_method;
EXEC sp_addextendedproperty 'MS_Description', '螺纹标准', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', thread_standard;
EXEC sp_addextendedproperty 'MS_Description', '排屑槽型', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', flute_solt_type;
EXEC sp_addextendedproperty 'MS_Description', '螺纹类型', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', thread_type;
EXEC sp_addextendedproperty 'MS_Description', '导向尺寸', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', guiding_size;
EXEC sp_addextendedproperty 'MS_Description', '连接孔径', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', connection_aperture;
EXEC sp_addextendedproperty 'MS_Description', '连接键槽', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', connecting_keyway;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', para_threading_tool, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[para_mill_tool]') AND type in (N'U')) DROP TABLE [dbo].[para_mill_tool];
CREATE TABLE [dbo].[para_mill_tool](
    id VARCHAR(32) NOT NULL,
    classify_id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    sign_code VARCHAR(16),
    chinese_name VARCHAR(128),
    foreign_language_name VARCHAR(128),
    standard_level VARCHAR(32),
    standard_code VARCHAR(32),
    position_code VARCHAR(255),
    tool_model VARCHAR(255) NOT NULL,
    diameter VARCHAR(128) NOT NULL,
    nose_angle_r VARCHAR(64) NOT NULL,
    number_of_teeth VARCHAR(64) NOT NULL,
    edge_length VARCHAR(24) NOT NULL,
    total_length VARCHAR(24) NOT NULL,
    tool_material VARCHAR(64) NOT NULL,
    part_material VARCHAR(64),
    paintcoat_flag VARCHAR(32) NOT NULL,
    tool_pattern VARCHAR(64) NOT NULL,
    clamping_specifications VARCHAR(64) NOT NULL,
    cooling_method VARCHAR(64) NOT NULL,
    technical_conditions VARCHAR(128) NOT NULL,
    conditions_info VARCHAR(128),
    brand VARCHAR(64),
    neck_diameter VARCHAR(64),
    handle_form VARCHAR(64),
    nose_angle_c VARCHAR(32),
    angle_inside_r VARCHAR(32),
    small_diameter VARCHAR(32),
    tool_angle VARCHAR(16),
    handle_length VARCHAR(16),
    main_angle_k VARCHAR(16),
    deepest_depth VARCHAR(16),
    adapt_blade VARCHAR(64),
    handle_neck_form VARCHAR(64),
    handle_neck_length VARCHAR(16),
    size_specifications VARCHAR(16),
    milling_head_form VARCHAR(16),
    overhanging_length VARCHAR(16),
    cutting_edge_form VARCHAR(16),
    number_patterns VARCHAR(16),
    pitch VARCHAR(16),
    recently_diameter VARCHAR(16),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '13铣削刀具g3', 'SCHEMA', dbo, 'table', para_mill_tool, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具分类编号', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '主键-刀具编号', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '序号(或企业内原代码)', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', sign_code;
EXEC sp_addextendedproperty 'MS_Description', '中文名称', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', chinese_name;
EXEC sp_addextendedproperty 'MS_Description', '外文名称', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', foreign_language_name;
EXEC sp_addextendedproperty 'MS_Description', '标准级别', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', standard_level;
EXEC sp_addextendedproperty 'MS_Description', '标准号', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', standard_code;
EXEC sp_addextendedproperty 'MS_Description', '库位号;由库区+层+排+列组成,可以是多个库位号以英文点号分割的字符串。', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', position_code;
EXEC sp_addextendedproperty 'MS_Description', '型号/图号', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', tool_model;
EXEC sp_addextendedproperty 'MS_Description', '刀具直径', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', diameter;
EXEC sp_addextendedproperty 'MS_Description', '刀尖角R', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', nose_angle_r;
EXEC sp_addextendedproperty 'MS_Description', '齿数', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', number_of_teeth;
EXEC sp_addextendedproperty 'MS_Description', '切削刃长', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', edge_length;
EXEC sp_addextendedproperty 'MS_Description', '刀具总长', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', total_length;
EXEC sp_addextendedproperty 'MS_Description', '刀具材料', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', tool_material;
EXEC sp_addextendedproperty 'MS_Description', '零件材料', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', part_material;
EXEC sp_addextendedproperty 'MS_Description', '是否涂层', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', paintcoat_flag;
EXEC sp_addextendedproperty 'MS_Description', '刀具型式', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', tool_pattern;
EXEC sp_addextendedproperty 'MS_Description', '装夹规格', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', clamping_specifications;
EXEC sp_addextendedproperty 'MS_Description', '冷却方式', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', cooling_method;
EXEC sp_addextendedproperty 'MS_Description', '附加技术条件', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', technical_conditions;
EXEC sp_addextendedproperty 'MS_Description', '附加技术条件说明', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', conditions_info;
EXEC sp_addextendedproperty 'MS_Description', '品牌', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', brand;
EXEC sp_addextendedproperty 'MS_Description', '颈径', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', neck_diameter;
EXEC sp_addextendedproperty 'MS_Description', '柄部形式', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', handle_form;
EXEC sp_addextendedproperty 'MS_Description', '刀尖角C', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', nose_angle_c;
EXEC sp_addextendedproperty 'MS_Description', '刀尖角内R', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', angle_inside_r;
EXEC sp_addextendedproperty 'MS_Description', '最小直径', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', small_diameter;
EXEC sp_addextendedproperty 'MS_Description', '刀具角度', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', tool_angle;
EXEC sp_addextendedproperty 'MS_Description', '柄长', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', handle_length;
EXEC sp_addextendedproperty 'MS_Description', '主偏角K', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', main_angle_k;
EXEC sp_addextendedproperty 'MS_Description', '最大切深', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', deepest_depth;
EXEC sp_addextendedproperty 'MS_Description', '适配刀片', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', adapt_blade;
EXEC sp_addextendedproperty 'MS_Description', '柄颈形式', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', handle_neck_form;
EXEC sp_addextendedproperty 'MS_Description', '柄颈长度', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', handle_neck_length;
EXEC sp_addextendedproperty 'MS_Description', '接口尺寸规格', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', size_specifications;
EXEC sp_addextendedproperty 'MS_Description', '铣刀头形式', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', milling_head_form;
EXEC sp_addextendedproperty 'MS_Description', '悬伸长度', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', overhanging_length;
EXEC sp_addextendedproperty 'MS_Description', '切削刃形式', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', cutting_edge_form;
EXEC sp_addextendedproperty 'MS_Description', '内外纹数', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', number_patterns;
EXEC sp_addextendedproperty 'MS_Description', '螺距', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', pitch;
EXEC sp_addextendedproperty 'MS_Description', '最近加工直径', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', recently_diameter;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', para_mill_tool, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[para_turning_tools]') AND type in (N'U')) DROP TABLE [dbo].[para_turning_tools];
CREATE TABLE [dbo].[para_turning_tools](
    id VARCHAR(32) NOT NULL,
    classify_id VARCHAR(32),
    tool_code VARCHAR(32) NOT NULL,
    sign_code VARCHAR(16),
    chinese_name VARCHAR(128),
    foreign_language_name VARCHAR(128),
    standard_level VARCHAR(16),
    standard_code VARCHAR(32),
    position_code VARCHAR(255),
    tool_model VARCHAR(255),
    head_specifications VARCHAR(32) NOT NULL,
    matching_number VARCHAR(64) NOT NULL,
    lead_angle VARCHAR(32) NOT NULL,
    cross_sectional_size VARCHAR(16) NOT NULL,
    total_length VARCHAR(32) NOT NULL,
    cutting_direction VARCHAR(24) NOT NULL,
    tool_material VARCHAR(64) NOT NULL,
    part_material VARCHAR(64),
    tool_pattern VARCHAR(64) NOT NULL,
    paintcoat_flag VARCHAR(32) NOT NULL,
    technical_conditions VARCHAR(128) NOT NULL,
    conditions_info VARCHAR(128),
    brand VARCHAR(64),
    types VARCHAR(64),
    knife_size VARCHAR(32),
    cooling_method VARCHAR(64),
    holder_category VARCHAR(64),
    tool_diameter VARCHAR(64),
    fastening_form VARCHAR(64),
    boring_bar_diameter VARCHAR(32),
    blade_length VARCHAR(32),
    blade_shape VARCHAR(24),
    blade_posterior VARCHAR(24),
    bar_direction VARCHAR(64),
    blade_height VARCHAR(32),
    blade_wide VARCHAR(24),
    blade_size VARCHAR(32),
    knife_clip_model VARCHAR(64),
    clamping_method VARCHAR(64),
    slot_width VARCHAR(32),
    small_diameter VARCHAR(32),
    max_diameter VARCHAR(32),
    max_depth VARCHAR(32),
    knife_bar_form VARCHAR(64),
    blade_thickness VARCHAR(32),
    min_diameter VARCHAR(32),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id,tool_code)
);
EXEC sp_addextendedproperty 'MS_Description', '14车削刀具g4', 'SCHEMA', dbo, 'table', para_turning_tools, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具分类编号', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '主键-刀具编号', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '序号(或企业内原代码)', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', sign_code;
EXEC sp_addextendedproperty 'MS_Description', '中文名称', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', chinese_name;
EXEC sp_addextendedproperty 'MS_Description', '外文名称', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', foreign_language_name;
EXEC sp_addextendedproperty 'MS_Description', '标准级别', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', standard_level;
EXEC sp_addextendedproperty 'MS_Description', '标准号', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', standard_code;
EXEC sp_addextendedproperty 'MS_Description', '库位号;由库区+层+排+列组成,可以是多个库位号以英文点号分割的字符串。', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', position_code;
EXEC sp_addextendedproperty 'MS_Description', '型号/图号', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', tool_model;
EXEC sp_addextendedproperty 'MS_Description', '刀头规格', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', head_specifications;
EXEC sp_addextendedproperty 'MS_Description', '配套刀片号', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', matching_number;
EXEC sp_addextendedproperty 'MS_Description', '主偏角', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', lead_angle;
EXEC sp_addextendedproperty 'MS_Description', '刀具截面尺寸', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', cross_sectional_size;
EXEC sp_addextendedproperty 'MS_Description', '刀具总长', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', total_length;
EXEC sp_addextendedproperty 'MS_Description', '切削方向', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', cutting_direction;
EXEC sp_addextendedproperty 'MS_Description', '刀具材料', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', tool_material;
EXEC sp_addextendedproperty 'MS_Description', '零件材料', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', part_material;
EXEC sp_addextendedproperty 'MS_Description', '刀具型式', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', tool_pattern;
EXEC sp_addextendedproperty 'MS_Description', '是否涂层', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', paintcoat_flag;
EXEC sp_addextendedproperty 'MS_Description', '附加技术条件', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', technical_conditions;
EXEC sp_addextendedproperty 'MS_Description', '附加技术条件说明', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', conditions_info;
EXEC sp_addextendedproperty 'MS_Description', '品牌', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', brand;
EXEC sp_addextendedproperty 'MS_Description', '制式', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', types;
EXEC sp_addextendedproperty 'MS_Description', '刀片尺寸', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', knife_size;
EXEC sp_addextendedproperty 'MS_Description', '冷却方式', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', cooling_method;
EXEC sp_addextendedproperty 'MS_Description', '刀杆类别', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', holder_category;
EXEC sp_addextendedproperty 'MS_Description', '刀具直径', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', tool_diameter;
EXEC sp_addextendedproperty 'MS_Description', '接口紧固形式', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', fastening_form;
EXEC sp_addextendedproperty 'MS_Description', '镗杆直径', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', boring_bar_diameter;
EXEC sp_addextendedproperty 'MS_Description', '刀杆长度', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', blade_length;
EXEC sp_addextendedproperty 'MS_Description', '刀片形状', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', blade_shape;
EXEC sp_addextendedproperty 'MS_Description', '刀片后角', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', blade_posterior;
EXEC sp_addextendedproperty 'MS_Description', '刀杆方向', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', bar_direction;
EXEC sp_addextendedproperty 'MS_Description', '刀杆高度', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', blade_height;
EXEC sp_addextendedproperty 'MS_Description', '刀杆宽度', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', blade_wide;
EXEC sp_addextendedproperty 'MS_Description', '刀杆尺寸', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', blade_size;
EXEC sp_addextendedproperty 'MS_Description', '刀夹型号', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', knife_clip_model;
EXEC sp_addextendedproperty 'MS_Description', '刀片装夹方式', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', clamping_method;
EXEC sp_addextendedproperty 'MS_Description', '刀片槽宽', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', slot_width;
EXEC sp_addextendedproperty 'MS_Description', '最小切入直径', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', small_diameter;
EXEC sp_addextendedproperty 'MS_Description', '最大切入直径', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', max_diameter;
EXEC sp_addextendedproperty 'MS_Description', '最大切槽深度', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', max_depth;
EXEC sp_addextendedproperty 'MS_Description', '刀杆形式', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', knife_bar_form;
EXEC sp_addextendedproperty 'MS_Description', '刀板厚度', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', blade_thickness;
EXEC sp_addextendedproperty 'MS_Description', '最小加工直径', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', min_diameter;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', para_turning_tools, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[para_blade]') AND type in (N'U')) DROP TABLE [dbo].[para_blade];
CREATE TABLE [dbo].[para_blade](
    id VARCHAR(32),
    classify_id VARCHAR(32),
    tool_code VARCHAR(32) NOT NULL,
    sign_code VARCHAR(16),
    chinese_name VARCHAR(128),
    foreign_language_name VARCHAR(128),
    standard_level VARCHAR(16),
    standard_code VARCHAR(32),
    position_code VARCHAR(255),
    tool_model VARCHAR(255),
    blade_shape VARCHAR(32) NOT NULL,
    blade_length VARCHAR(24) NOT NULL,
    cutting_edge_count VARCHAR(32) NOT NULL,
    blade_thickness VARCHAR(32) NOT NULL,
    clamping_type VARCHAR(64) NOT NULL,
    nose_angle_r VARCHAR(24) NOT NULL,
    tool_material VARCHAR(64) NOT NULL,
    part_material VARCHAR(64),
    paintcoat_flag VARCHAR(32) NOT NULL,
    technical_conditions VARCHAR(128) NOT NULL,
    conditions_info VARCHAR(128),
    brand VARCHAR(64),
    types VARCHAR(64),
    coating_material VARCHAR(64),
    processing_classify VARCHAR(64),
    blade_posterior VARCHAR(32),
    cutting_direction VARCHAR(32),
    blade_wide VARCHAR(32),
    blade_size VARCHAR(34),
    in_out_thread VARCHAR(32),
    thread_standard VARCHAR(32),
    dental_angle VARCHAR(16),
    pitch VARCHAR(24),
    min_internal_thread VARCHAR(24),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (tool_code)
);
EXEC sp_addextendedproperty 'MS_Description', '20刀片g9', 'SCHEMA', dbo, 'table', para_blade, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', para_blade, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具分类编号', 'SCHEMA', dbo, 'table', para_blade, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '主键-刀具编号', 'SCHEMA', dbo, 'table', para_blade, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '序号(或企业内原代码)', 'SCHEMA', dbo, 'table', para_blade, 'column', sign_code;
EXEC sp_addextendedproperty 'MS_Description', '中文名称', 'SCHEMA', dbo, 'table', para_blade, 'column', chinese_name;
EXEC sp_addextendedproperty 'MS_Description', '外文名称', 'SCHEMA', dbo, 'table', para_blade, 'column', foreign_language_name;
EXEC sp_addextendedproperty 'MS_Description', '标准级别', 'SCHEMA', dbo, 'table', para_blade, 'column', standard_level;
EXEC sp_addextendedproperty 'MS_Description', '标准号', 'SCHEMA', dbo, 'table', para_blade, 'column', standard_code;
EXEC sp_addextendedproperty 'MS_Description', '库位号;由库区+层+排+列组成,可以是多个库位号以英文点号分割的字符串。', 'SCHEMA', dbo, 'table', para_blade, 'column', position_code;
EXEC sp_addextendedproperty 'MS_Description', '型号/图号', 'SCHEMA', dbo, 'table', para_blade, 'column', tool_model;
EXEC sp_addextendedproperty 'MS_Description', '刀片形状', 'SCHEMA', dbo, 'table', para_blade, 'column', blade_shape;
EXEC sp_addextendedproperty 'MS_Description', '刀片长度', 'SCHEMA', dbo, 'table', para_blade, 'column', blade_length;
EXEC sp_addextendedproperty 'MS_Description', '切削刃数', 'SCHEMA', dbo, 'table', para_blade, 'column', cutting_edge_count;
EXEC sp_addextendedproperty 'MS_Description', '刀片厚度', 'SCHEMA', dbo, 'table', para_blade, 'column', blade_thickness;
EXEC sp_addextendedproperty 'MS_Description', '夹固型式', 'SCHEMA', dbo, 'table', para_blade, 'column', clamping_type;
EXEC sp_addextendedproperty 'MS_Description', '刀尖R', 'SCHEMA', dbo, 'table', para_blade, 'column', nose_angle_r;
EXEC sp_addextendedproperty 'MS_Description', '刀片材料', 'SCHEMA', dbo, 'table', para_blade, 'column', tool_material;
EXEC sp_addextendedproperty 'MS_Description', '零件材料', 'SCHEMA', dbo, 'table', para_blade, 'column', part_material;
EXEC sp_addextendedproperty 'MS_Description', '是否涂层', 'SCHEMA', dbo, 'table', para_blade, 'column', paintcoat_flag;
EXEC sp_addextendedproperty 'MS_Description', '附加技术条件', 'SCHEMA', dbo, 'table', para_blade, 'column', technical_conditions;
EXEC sp_addextendedproperty 'MS_Description', '附加技术条件说明', 'SCHEMA', dbo, 'table', para_blade, 'column', conditions_info;
EXEC sp_addextendedproperty 'MS_Description', '品牌', 'SCHEMA', dbo, 'table', para_blade, 'column', brand;
EXEC sp_addextendedproperty 'MS_Description', '制式', 'SCHEMA', dbo, 'table', para_blade, 'column', types;
EXEC sp_addextendedproperty 'MS_Description', '涂层材质', 'SCHEMA', dbo, 'table', para_blade, 'column', coating_material;
EXEC sp_addextendedproperty 'MS_Description', '加工分类', 'SCHEMA', dbo, 'table', para_blade, 'column', processing_classify;
EXEC sp_addextendedproperty 'MS_Description', '刀片后角', 'SCHEMA', dbo, 'table', para_blade, 'column', blade_posterior;
EXEC sp_addextendedproperty 'MS_Description', '切削方向', 'SCHEMA', dbo, 'table', para_blade, 'column', cutting_direction;
EXEC sp_addextendedproperty 'MS_Description', '刀片宽度', 'SCHEMA', dbo, 'table', para_blade, 'column', blade_wide;
EXEC sp_addextendedproperty 'MS_Description', '刀片尺寸', 'SCHEMA', dbo, 'table', para_blade, 'column', blade_size;
EXEC sp_addextendedproperty 'MS_Description', '内外螺纹', 'SCHEMA', dbo, 'table', para_blade, 'column', in_out_thread;
EXEC sp_addextendedproperty 'MS_Description', '螺纹标准', 'SCHEMA', dbo, 'table', para_blade, 'column', thread_standard;
EXEC sp_addextendedproperty 'MS_Description', '牙型角度', 'SCHEMA', dbo, 'table', para_blade, 'column', dental_angle;
EXEC sp_addextendedproperty 'MS_Description', '螺距', 'SCHEMA', dbo, 'table', para_blade, 'column', pitch;
EXEC sp_addextendedproperty 'MS_Description', '最小加工内螺纹公称直径', 'SCHEMA', dbo, 'table', para_blade, 'column', min_internal_thread;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', para_blade, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', para_blade, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', para_blade, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', para_blade, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', para_blade, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[outbound_order]') AND type in (N'U')) DROP TABLE [dbo].[outbound_order];
CREATE TABLE [dbo].[outbound_order](
    id VARCHAR(32) NOT NULL,
    out_storehouse_type VARCHAR(32) NOT NULL,
    is_return INT,
    handler VARCHAR(32) NOT NULL,
    reviewer VARCHAR(32),
    order_status VARCHAR(32) NOT NULL,
    out_status VARCHAR(255),
    audit_date DATETIME,
    approval_opinion VARCHAR(128),
    subject_matter VARCHAR(128),
    outbound_time DATETIME NOT NULL,
    remark VARCHAR(128),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '出库申请单', 'SCHEMA', dbo, 'table', outbound_order, null, null;
EXEC sp_addextendedproperty 'MS_Description', '出库单编号', 'SCHEMA', dbo, 'table', outbound_order, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '出库类型', 'SCHEMA', dbo, 'table', outbound_order, 'column', out_storehouse_type;
EXEC sp_addextendedproperty 'MS_Description', '是否归还;1未归还(默认);2.已归还', 'SCHEMA', dbo, 'table', outbound_order, 'column', is_return;
EXEC sp_addextendedproperty 'MS_Description', '经手人', 'SCHEMA', dbo, 'table', outbound_order, 'column', handler;
EXEC sp_addextendedproperty 'MS_Description', '审核人', 'SCHEMA', dbo, 'table', outbound_order, 'column', reviewer;
EXEC sp_addextendedproperty 'MS_Description', '单子状态', 'SCHEMA', dbo, 'table', outbound_order, 'column', order_status;
EXEC sp_addextendedproperty 'MS_Description', '出库状态;1.未出库;2.部分出库;3.出库完成', 'SCHEMA', dbo, 'table', outbound_order, 'column', out_status;
EXEC sp_addextendedproperty 'MS_Description', '审核时间', 'SCHEMA', dbo, 'table', outbound_order, 'column', audit_date;
EXEC sp_addextendedproperty 'MS_Description', '审核意见', 'SCHEMA', dbo, 'table', outbound_order, 'column', approval_opinion;
EXEC sp_addextendedproperty 'MS_Description', '领用事由', 'SCHEMA', dbo, 'table', outbound_order, 'column', subject_matter;
EXEC sp_addextendedproperty 'MS_Description', '出库时间', 'SCHEMA', dbo, 'table', outbound_order, 'column', outbound_time;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', outbound_order, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', outbound_order, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '操作员', 'SCHEMA', dbo, 'table', outbound_order, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', outbound_order, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', outbound_order, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', outbound_order, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[inbound_order]') AND type in (N'U')) DROP TABLE [dbo].[inbound_order];
CREATE TABLE [dbo].[inbound_order](
    id VARCHAR(32) NOT NULL,
    inbound_time DATETIME(255),
    in_storehouse_type VARCHAR(32) NOT NULL,
    handler VARCHAR(32),
    borrow_num VARCHAR(32),
    reviewer VARCHAR(32),
    approval_date DATETIME,
    approval_opinion VARCHAR(128),
    order_status VARCHAR(32),
    in_status VARCHAR(32),
    application_reason VARCHAR(128),
    remark VARCHAR(128),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '入库申请单', 'SCHEMA', dbo, 'table', inbound_order, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键-入库单号', 'SCHEMA', dbo, 'table', inbound_order, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '入库时间', 'SCHEMA', dbo, 'table', inbound_order, 'column', inbound_time;
EXEC sp_addextendedproperty 'MS_Description', '入库类型', 'SCHEMA', dbo, 'table', inbound_order, 'column', in_storehouse_type;
EXEC sp_addextendedproperty 'MS_Description', '经手人', 'SCHEMA', dbo, 'table', inbound_order, 'column', handler;
EXEC sp_addextendedproperty 'MS_Description', '借用单号', 'SCHEMA', dbo, 'table', inbound_order, 'column', borrow_num;
EXEC sp_addextendedproperty 'MS_Description', '审核人', 'SCHEMA', dbo, 'table', inbound_order, 'column', reviewer;
EXEC sp_addextendedproperty 'MS_Description', '审核时间', 'SCHEMA', dbo, 'table', inbound_order, 'column', approval_date;
EXEC sp_addextendedproperty 'MS_Description', '审核意见', 'SCHEMA', dbo, 'table', inbound_order, 'column', approval_opinion;
EXEC sp_addextendedproperty 'MS_Description', '单子状态', 'SCHEMA', dbo, 'table', inbound_order, 'column', order_status;
EXEC sp_addextendedproperty 'MS_Description', '入库单状态;1.未入库;2.部分入库;3.入库完成', 'SCHEMA', dbo, 'table', inbound_order, 'column', in_status;
EXEC sp_addextendedproperty 'MS_Description', '申请原因', 'SCHEMA', dbo, 'table', inbound_order, 'column', application_reason;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', inbound_order, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', inbound_order, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '操作员', 'SCHEMA', dbo, 'table', inbound_order, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '申请时间', 'SCHEMA', dbo, 'table', inbound_order, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', inbound_order, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', inbound_order, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[outbound_detail]') AND type in (N'U')) DROP TABLE [dbo].[outbound_detail];
CREATE TABLE [dbo].[outbound_detail](
    id VARCHAR(32) NOT NULL,
    out_storehouse_id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    tool_id VARCHAR(32),
    outbound_quantity DECIMAL(64) NOT NULL,
    out_actual_count DECIMAL(64),
    storage_location VARCHAR(64),
    outbound_location VARCHAR(255),
    out_status VARCHAR(32) NOT NULL,
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '出库申请明细', 'SCHEMA', dbo, 'table', outbound_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', outbound_detail, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '出库单号', 'SCHEMA', dbo, 'table', outbound_detail, 'column', out_storehouse_id;
EXEC sp_addextendedproperty 'MS_Description', '刀具编码', 'SCHEMA', dbo, 'table', outbound_detail, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '刀具编号', 'SCHEMA', dbo, 'table', outbound_detail, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '申请出库数量', 'SCHEMA', dbo, 'table', outbound_detail, 'column', outbound_quantity;
EXEC sp_addextendedproperty 'MS_Description', '实际出库数量', 'SCHEMA', dbo, 'table', outbound_detail, 'column', out_actual_count;
EXEC sp_addextendedproperty 'MS_Description', '仓库', 'SCHEMA', dbo, 'table', outbound_detail, 'column', storage_location;
EXEC sp_addextendedproperty 'MS_Description', '出库库位', 'SCHEMA', dbo, 'table', outbound_detail, 'column', outbound_location;
EXEC sp_addextendedproperty 'MS_Description', '出库状态;1.未出库;2.部分出库;3.出库完成', 'SCHEMA', dbo, 'table', outbound_detail, 'column', out_status;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', outbound_detail, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '操作员', 'SCHEMA', dbo, 'table', outbound_detail, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '出库时间', 'SCHEMA', dbo, 'table', outbound_detail, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', outbound_detail, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', outbound_detail, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[inbound_detail]') AND type in (N'U')) DROP TABLE [dbo].[inbound_detail];
CREATE TABLE [dbo].[inbound_detail](
    id VARCHAR(32) NOT NULL,
    goods_shelves_id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    tool_id VARCHAR(32),
    in_storage_quantity DECIMAL(64) NOT NULL,
    in_actual_count DECIMAL(64),
    out_status VARCHAR(32),
    remark VARCHAR(128),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '入库申请明细', 'SCHEMA', dbo, 'table', inbound_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', inbound_detail, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '货架号/存储位置', 'SCHEMA', dbo, 'table', inbound_detail, 'column', goods_shelves_id;
EXEC sp_addextendedproperty 'MS_Description', '工具编码', 'SCHEMA', dbo, 'table', inbound_detail, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', inbound_detail, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '入库数量', 'SCHEMA', dbo, 'table', inbound_detail, 'column', in_storage_quantity;
EXEC sp_addextendedproperty 'MS_Description', '实际入库数量', 'SCHEMA', dbo, 'table', inbound_detail, 'column', in_actual_count;
EXEC sp_addextendedproperty 'MS_Description', '出库状态;1.未入库;2.部分入库;3.入库完成', 'SCHEMA', dbo, 'table', inbound_detail, 'column', out_status;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', inbound_detail, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', inbound_detail, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', inbound_detail, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', inbound_detail, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', inbound_detail, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', inbound_detail, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tools_config_property]') AND type in (N'U')) DROP TABLE [dbo].[tools_config_property];
CREATE TABLE [dbo].[tools_config_property](
    id VARCHAR(32) NOT NULL,
    classify_id VARCHAR(32) NOT NULL,
    chinese_name VARCHAR(128),
    foreign_language_name VARCHAR(128),
    application_type INT NOT NULL,
    standard_level VARCHAR(16),
    standard_code VARCHAR(32),
    tool_model VARCHAR(128) NOT NULL,
    supplier_id VARCHAR(128),
    province_city VARCHAR(255),
    warehouse_id VARCHAR(128),
    position_code VARCHAR(255),
    storage_location VARCHAR(64),
    main_unit VARCHAR(64),
    auxiliary_unit VARCHAR(64),
    main_count VARCHAR(255),
    auxiliary_count VARCHAR(255),
    auxiliary_unit_flag VARCHAR(8),
    price DECIMAL,
    lower_inventory DECIMAL,
    highest_inventory VARCHAR,
    status VARCHAR(6),
    remark VARCHAR(255),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '工具通用性质--参数', 'SCHEMA', dbo, 'table', tools_config_property, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', tools_config_property, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '分类编号', 'SCHEMA', dbo, 'table', tools_config_property, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '中文名称', 'SCHEMA', dbo, 'table', tools_config_property, 'column', chinese_name;
EXEC sp_addextendedproperty 'MS_Description', '英文名称', 'SCHEMA', dbo, 'table', tools_config_property, 'column', foreign_language_name;
EXEC sp_addextendedproperty 'MS_Description', '工具类型;1.通用
2.专用', 'SCHEMA', dbo, 'table', tools_config_property, 'column', application_type;
EXEC sp_addextendedproperty 'MS_Description', '标准级别', 'SCHEMA', dbo, 'table', tools_config_property, 'column', standard_level;
EXEC sp_addextendedproperty 'MS_Description', '标准号', 'SCHEMA', dbo, 'table', tools_config_property, 'column', standard_code;
EXEC sp_addextendedproperty 'MS_Description', '型号/图号', 'SCHEMA', dbo, 'table', tools_config_property, 'column', tool_model;
EXEC sp_addextendedproperty 'MS_Description', '厂家', 'SCHEMA', dbo, 'table', tools_config_property, 'column', supplier_id;
EXEC sp_addextendedproperty 'MS_Description', '仓库省份城市', 'SCHEMA', dbo, 'table', tools_config_property, 'column', province_city;
EXEC sp_addextendedproperty 'MS_Description', '库区/库号', 'SCHEMA', dbo, 'table', tools_config_property, 'column', warehouse_id;
EXEC sp_addextendedproperty 'MS_Description', '库位号;由库区+层+排+列组成,可以是多个库位号以英文点号分割的字符串。', 'SCHEMA', dbo, 'table', tools_config_property, 'column', position_code;
EXEC sp_addextendedproperty 'MS_Description', '存储位置(偏那个厂区的库)', 'SCHEMA', dbo, 'table', tools_config_property, 'column', storage_location;
EXEC sp_addextendedproperty 'MS_Description', '计量主单位', 'SCHEMA', dbo, 'table', tools_config_property, 'column', main_unit;
EXEC sp_addextendedproperty 'MS_Description', '计量辅单位', 'SCHEMA', dbo, 'table', tools_config_property, 'column', auxiliary_unit;
EXEC sp_addextendedproperty 'MS_Description', '计量主单位数量', 'SCHEMA', dbo, 'table', tools_config_property, 'column', main_count;
EXEC sp_addextendedproperty 'MS_Description', '计量辅单位数量', 'SCHEMA', dbo, 'table', tools_config_property, 'column', auxiliary_count;
EXEC sp_addextendedproperty 'MS_Description', '是否有计量辅单位;1,有辅助单位2.无辅助单位', 'SCHEMA', dbo, 'table', tools_config_property, 'column', auxiliary_unit_flag;
EXEC sp_addextendedproperty 'MS_Description', '单价', 'SCHEMA', dbo, 'table', tools_config_property, 'column', price;
EXEC sp_addextendedproperty 'MS_Description', '最低库存', 'SCHEMA', dbo, 'table', tools_config_property, 'column', lower_inventory;
EXEC sp_addextendedproperty 'MS_Description', '最高库存', 'SCHEMA', dbo, 'table', tools_config_property, 'column', highest_inventory;
EXEC sp_addextendedproperty 'MS_Description', '状态;1.启用
2.未启用', 'SCHEMA', dbo, 'table', tools_config_property, 'column', status;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', tools_config_property, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', tools_config_property, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', tools_config_property, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', tools_config_property, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', tools_config_property, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', tools_config_property, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[warehouse]') AND type in (N'U')) DROP TABLE [dbo].[warehouse];
CREATE TABLE [dbo].[warehouse](
    id VARCHAR(32) NOT NULL,
    warehouse_id VARCHAR(255),
    warehouse_name VARCHAR(128),
    parent_id VARCHAR(64),
    seq VARCHAR(255),
    leaf_flag VARCHAR(6),
    status VARCHAR(6),
    remark VARCHAR(128),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '仓库管理', 'SCHEMA', dbo, 'table', warehouse, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', warehouse, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '仓库编号', 'SCHEMA', dbo, 'table', warehouse, 'column', warehouse_id;
EXEC sp_addextendedproperty 'MS_Description', '仓库名称', 'SCHEMA', dbo, 'table', warehouse, 'column', warehouse_name;
EXEC sp_addextendedproperty 'MS_Description', '父节点编号', 'SCHEMA', dbo, 'table', warehouse, 'column', parent_id;
EXEC sp_addextendedproperty 'MS_Description', '展示序号', 'SCHEMA', dbo, 'table', warehouse, 'column', seq;
EXEC sp_addextendedproperty 'MS_Description', '是否叶子节点;1是2否', 'SCHEMA', dbo, 'table', warehouse, 'column', leaf_flag;
EXEC sp_addextendedproperty 'MS_Description', '状态;1.启用;2.停用', 'SCHEMA', dbo, 'table', warehouse, 'column', status;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', warehouse, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', warehouse, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', warehouse, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', warehouse, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', warehouse, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', warehouse, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[goods_shelves]') AND type in (N'U')) DROP TABLE [dbo].[goods_shelves];
CREATE TABLE [dbo].[goods_shelves](
    id VARCHAR(32) NOT NULL,
    warehouse_id VARCHAR(32) NOT NULL,
    location_code VARCHAR(255) NOT NULL,
    storey VARCHAR(32) NOT NULL,
    arrange VARCHAR(32) NOT NULL,
    column_number VARCHAR(32) NOT NULL,
    cells_num VARCHAR(32),
    shelf_number VARCHAR(64),
    shelf_name VARCHAR(64),
    remark VARCHAR(128),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '货架管理', 'SCHEMA', dbo, 'table', goods_shelves, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', goods_shelves, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '仓库编号', 'SCHEMA', dbo, 'table', goods_shelves, 'column', warehouse_id;
EXEC sp_addextendedproperty 'MS_Description', '库位号', 'SCHEMA', dbo, 'table', goods_shelves, 'column', location_code;
EXEC sp_addextendedproperty 'MS_Description', '层数', 'SCHEMA', dbo, 'table', goods_shelves, 'column', storey;
EXEC sp_addextendedproperty 'MS_Description', '排数', 'SCHEMA', dbo, 'table', goods_shelves, 'column', arrange;
EXEC sp_addextendedproperty 'MS_Description', '列数', 'SCHEMA', dbo, 'table', goods_shelves, 'column', column_number;
EXEC sp_addextendedproperty 'MS_Description', '格数;默认值为1', 'SCHEMA', dbo, 'table', goods_shelves, 'column', cells_num;
EXEC sp_addextendedproperty 'MS_Description', '货架编号', 'SCHEMA', dbo, 'table', goods_shelves, 'column', shelf_number;
EXEC sp_addextendedproperty 'MS_Description', '货架名称', 'SCHEMA', dbo, 'table', goods_shelves, 'column', shelf_name;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', goods_shelves, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', goods_shelves, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', goods_shelves, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', goods_shelves, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', goods_shelves, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', goods_shelves, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[in_store_detail]') AND type in (N'U')) DROP TABLE [dbo].[in_store_detail];
CREATE TABLE [dbo].[in_store_detail](
    id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    tool_id VARCHAR(32),
    in_storehouse_type VARCHAR(32),
    goods_shelves_id VARCHAR(32),
    in_number DECIMAL(64),
    in_storehouse_id VARCHAR(32),
    operate_type VARCHAR(64),
    inbound_time DATETIME(24),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '入库明细表-描述刀具存放、发生的数量', 'SCHEMA', dbo, 'table', in_store_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', in_store_detail, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具编码', 'SCHEMA', dbo, 'table', in_store_detail, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', in_store_detail, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '工具入库方式', 'SCHEMA', dbo, 'table', in_store_detail, 'column', in_storehouse_type;
EXEC sp_addextendedproperty 'MS_Description', '库位号', 'SCHEMA', dbo, 'table', in_store_detail, 'column', goods_shelves_id;
EXEC sp_addextendedproperty 'MS_Description', '入库数量', 'SCHEMA', dbo, 'table', in_store_detail, 'column', in_number;
EXEC sp_addextendedproperty 'MS_Description', '入库申请单号', 'SCHEMA', dbo, 'table', in_store_detail, 'column', in_storehouse_id;
EXEC sp_addextendedproperty 'MS_Description', '入库操作方式;1.按申请单
2.手工操作', 'SCHEMA', dbo, 'table', in_store_detail, 'column', operate_type;
EXEC sp_addextendedproperty 'MS_Description', '入库时间', 'SCHEMA', dbo, 'table', in_store_detail, 'column', inbound_time;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', in_store_detail, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', in_store_detail, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', in_store_detail, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', in_store_detail, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', in_store_detail, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[out_store_detail]') AND type in (N'U')) DROP TABLE [dbo].[out_store_detail];
CREATE TABLE [dbo].[out_store_detail](
    id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    tool_id VARCHAR(32),
    out_storehouse_type VARCHAR(32),
    goods_shelves_code VARCHAR(64),
    out_number DECIMAL(64) NOT NULL,
    in_storehouse_id VARCHAR(128),
    operate_type VARCHAR(64),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '描述出库的库位、数量关系表', 'SCHEMA', dbo, 'table', out_store_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', out_store_detail, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具编码', 'SCHEMA', dbo, 'table', out_store_detail, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', out_store_detail, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '出库类型', 'SCHEMA', dbo, 'table', out_store_detail, 'column', out_storehouse_type;
EXEC sp_addextendedproperty 'MS_Description', '库位号', 'SCHEMA', dbo, 'table', out_store_detail, 'column', goods_shelves_code;
EXEC sp_addextendedproperty 'MS_Description', '出库数量', 'SCHEMA', dbo, 'table', out_store_detail, 'column', out_number;
EXEC sp_addextendedproperty 'MS_Description', '出库申请单号', 'SCHEMA', dbo, 'table', out_store_detail, 'column', in_storehouse_id;
EXEC sp_addextendedproperty 'MS_Description', '出库操作方式;1.按申请单
2.手工操作', 'SCHEMA', dbo, 'table', out_store_detail, 'column', operate_type;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', out_store_detail, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', out_store_detail, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', out_store_detail, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', out_store_detail, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', out_store_detail, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[para_common_tool]') AND type in (N'U')) DROP TABLE [dbo].[para_common_tool];
CREATE TABLE [dbo].[para_common_tool](
    id VARCHAR(32) NOT NULL,
    classify_id VARCHAR(32),
    tool_code VARCHAR(32),
    sign_code VARCHAR(16),
    chinese_name VARCHAR(128),
    foreign_language_name VARCHAR(128),
    standard_level VARCHAR(16),
    standard_code VARCHAR(32),
    position_code VARCHAR(255),
    tool_model VARCHAR(255),
    tool_material VARCHAR(255),
    part_material VARCHAR(255),
    remark VARCHAR(255),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '工具标识', 'SCHEMA', dbo, 'table', para_common_tool, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', para_common_tool, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具分类编号', 'SCHEMA', dbo, 'table', para_common_tool, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', para_common_tool, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '序号(或企业内源码)', 'SCHEMA', dbo, 'table', para_common_tool, 'column', sign_code;
EXEC sp_addextendedproperty 'MS_Description', '中文名称', 'SCHEMA', dbo, 'table', para_common_tool, 'column', chinese_name;
EXEC sp_addextendedproperty 'MS_Description', '外文名称', 'SCHEMA', dbo, 'table', para_common_tool, 'column', foreign_language_name;
EXEC sp_addextendedproperty 'MS_Description', '标准级别', 'SCHEMA', dbo, 'table', para_common_tool, 'column', standard_level;
EXEC sp_addextendedproperty 'MS_Description', '标准号', 'SCHEMA', dbo, 'table', para_common_tool, 'column', standard_code;
EXEC sp_addextendedproperty 'MS_Description', '库位号;由库区+层+排+列组成,可以是多个库位号以英文点号分割的字符串。', 'SCHEMA', dbo, 'table', para_common_tool, 'column', position_code;
EXEC sp_addextendedproperty 'MS_Description', '型号/图号', 'SCHEMA', dbo, 'table', para_common_tool, 'column', tool_model;
EXEC sp_addextendedproperty 'MS_Description', '刀具材料', 'SCHEMA', dbo, 'table', para_common_tool, 'column', tool_material;
EXEC sp_addextendedproperty 'MS_Description', '零件材料', 'SCHEMA', dbo, 'table', para_common_tool, 'column', part_material;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', para_common_tool, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', para_common_tool, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', para_common_tool, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', para_common_tool, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', para_common_tool, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', para_common_tool, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tool_sharpening]') AND type in (N'U')) DROP TABLE [dbo].[tool_sharpening];
CREATE TABLE [dbo].[tool_sharpening](
    id VARCHAR(32,32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    tool_id VARCHAR(32,32),
    sharpening_time DATETIME(24) NOT NULL,
    sharpening_result VARCHAR(255),
    responsible_person VARCHAR(24),
    remark VARCHAR(255),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '刀具刃磨', 'SCHEMA', dbo, 'table', tool_sharpening, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具编码', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '刃磨时间', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', sharpening_time;
EXEC sp_addextendedproperty 'MS_Description', '刃磨结果及建议', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', sharpening_result;
EXEC sp_addextendedproperty 'MS_Description', '责任人', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', responsible_person;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', tool_sharpening, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[loss_bound]') AND type in (N'U')) DROP TABLE [dbo].[loss_bound];
CREATE TABLE [dbo].[loss_bound](
    id VARCHAR(32) NOT NULL,
    losser VARCHAR(64),
    handler VARCHAR(64),
    loss_time DATETIME(32),
    reviewer VARCHAR(64),
    approval_date DATETIME(255),
    order_status VARCHAR(32),
    approval_opinion VARCHAR(255),
    loss_reason VARCHAR(255),
    remark VARCHAR(255),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '工具报损单', 'SCHEMA', dbo, 'table', loss_bound, null, null;
EXEC sp_addextendedproperty 'MS_Description', '报损单号', 'SCHEMA', dbo, 'table', loss_bound, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '报损人', 'SCHEMA', dbo, 'table', loss_bound, 'column', losser;
EXEC sp_addextendedproperty 'MS_Description', '经手人', 'SCHEMA', dbo, 'table', loss_bound, 'column', handler;
EXEC sp_addextendedproperty 'MS_Description', '报损时间', 'SCHEMA', dbo, 'table', loss_bound, 'column', loss_time;
EXEC sp_addextendedproperty 'MS_Description', '审核人', 'SCHEMA', dbo, 'table', loss_bound, 'column', reviewer;
EXEC sp_addextendedproperty 'MS_Description', '审核时间', 'SCHEMA', dbo, 'table', loss_bound, 'column', approval_date;
EXEC sp_addextendedproperty 'MS_Description', '单据状态', 'SCHEMA', dbo, 'table', loss_bound, 'column', order_status;
EXEC sp_addextendedproperty 'MS_Description', '审批意见', 'SCHEMA', dbo, 'table', loss_bound, 'column', approval_opinion;
EXEC sp_addextendedproperty 'MS_Description', '损伤原因', 'SCHEMA', dbo, 'table', loss_bound, 'column', loss_reason;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', loss_bound, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', loss_bound, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', loss_bound, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', loss_bound, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', loss_bound, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', loss_bound, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[loss_bound_detail]') AND type in (N'U')) DROP TABLE [dbo].[loss_bound_detail];
CREATE TABLE [dbo].[loss_bound_detail](
    id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    tool_id VARCHAR(128),
    loss_reason VARCHAR(64),
    loss_number DECIMAL(64) NOT NULL,
    goods_shelves_id VARCHAR(64),
    in_store_date DATETIME(255),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '报损单明细', 'SCHEMA', dbo, 'table', loss_bound_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具编码', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '报损原因', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', loss_reason;
EXEC sp_addextendedproperty 'MS_Description', '报损数量', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', loss_number;
EXEC sp_addextendedproperty 'MS_Description', '存储位置(库位号)', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', goods_shelves_id;
EXEC sp_addextendedproperty 'MS_Description', '入库时间', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', in_store_date;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', loss_bound_detail, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[stocktaking_bound]') AND type in (N'U')) DROP TABLE [dbo].[stocktaking_bound];
CREATE TABLE [dbo].[stocktaking_bound](
    id VARCHAR(255) NOT NULL,
    stocktaking_type VARCHAR(255),
    order_code VARCHAR(255),
    handler VARCHAR(255),
    reviewer VARCHAR(255),
    stocktaking_name VARCHAR(255),
    remark VARCHAR(255),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '工具盘点申请单', 'SCHEMA', dbo, 'table', stocktaking_bound, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '盘点类型;1.明盘盘点
2.暗盘盘点', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', stocktaking_type;
EXEC sp_addextendedproperty 'MS_Description', '盘点单号', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', order_code;
EXEC sp_addextendedproperty 'MS_Description', '经手人', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', handler;
EXEC sp_addextendedproperty 'MS_Description', '审核人', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', reviewer;
EXEC sp_addextendedproperty 'MS_Description', '盘点名称', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', stocktaking_name;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', stocktaking_bound, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[stocktaking_bound_detail]') AND type in (N'U')) DROP TABLE [dbo].[stocktaking_bound_detail];
CREATE TABLE [dbo].[stocktaking_bound_detail](
    id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    tool_id VARCHAR(32),
    goods_shelves_id VARCHAR(64),
    book_quantity DATETIME(255),
    available_quantity DATETIME(255),
    practical_quantity DATETIME(255),
    surplus_deficit VARCHAR(36),
    stocktaking_date DATETIME(255),
    remark VARCHAR(218),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '盘点单明细', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具编码', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '库存号', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', goods_shelves_id;
EXEC sp_addextendedproperty 'MS_Description', '账面数量', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', book_quantity;
EXEC sp_addextendedproperty 'MS_Description', '可用数量', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', available_quantity;
EXEC sp_addextendedproperty 'MS_Description', '实盘数量', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', practical_quantity;
EXEC sp_addextendedproperty 'MS_Description', '盘盈盘亏;1.盘盈
2.盘亏', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', surplus_deficit;
EXEC sp_addextendedproperty 'MS_Description', '盘库时间', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', stocktaking_date;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', stocktaking_bound_detail, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[store_early warning]') AND type in (N'U')) DROP TABLE [dbo].[store_early warning];
CREATE TABLE [dbo].[store_early warning](
    id VARCHAR(32) NOT NULL,
    tool_code VARCHAR(32) NOT NULL,
    tool_id VARCHAR(64),
    goods_shelves_id VARCHAR(32),
    lower_inventory DECIMAL(64),
    highest_inventory DECIMAL(64),
    total_count DECIMAL(64),
    available_quantity DECIMAL(64),
    status VARCHAR(255),
    remark VARCHAR(216),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '库存预警', 'SCHEMA', dbo, 'table', store_early warning, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', store_early warning, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '工具编码', 'SCHEMA', dbo, 'table', store_early warning, 'column', tool_code;
EXEC sp_addextendedproperty 'MS_Description', '工具编号', 'SCHEMA', dbo, 'table', store_early warning, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '存储位置', 'SCHEMA', dbo, 'table', store_early warning, 'column', goods_shelves_id;
EXEC sp_addextendedproperty 'MS_Description', '库存下限', 'SCHEMA', dbo, 'table', store_early warning, 'column', lower_inventory;
EXEC sp_addextendedproperty 'MS_Description', '库存上限', 'SCHEMA', dbo, 'table', store_early warning, 'column', highest_inventory;
EXEC sp_addextendedproperty 'MS_Description', '总库存数量', 'SCHEMA', dbo, 'table', store_early warning, 'column', total_count;
EXEC sp_addextendedproperty 'MS_Description', '可用库存数量', 'SCHEMA', dbo, 'table', store_early warning, 'column', available_quantity;
EXEC sp_addextendedproperty 'MS_Description', '状态;1已处理;2.未处理。', 'SCHEMA', dbo, 'table', store_early warning, 'column', status;
EXEC sp_addextendedproperty 'MS_Description', '备注', 'SCHEMA', dbo, 'table', store_early warning, 'column', remark;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', store_early warning, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', store_early warning, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', store_early warning, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', store_early warning, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', store_early warning, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[goods_shelves_mark]') AND type in (N'U')) DROP TABLE [dbo].[goods_shelves_mark];
CREATE TABLE [dbo].[goods_shelves_mark](
    id VARCHAR(32) NOT NULL,
    warehouse_id VARCHAR(32) NOT NULL,
    goods_shelves VARCHAR(32) NOT NULL,
    storey VARCHAR(128) NOT NULL,
    variety VARCHAR(255),
    tenant_id VARCHAR,
    created_by VARCHAR(32),
    created_time DATETIME,
    updated_by VARCHAR(32),
    updated_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '货架层排库存工具特征标注', 'SCHEMA', dbo, 'table', goods_shelves_mark, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '仓库编号', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', warehouse_id;
EXEC sp_addextendedproperty 'MS_Description', '货架编号', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', goods_shelves;
EXEC sp_addextendedproperty 'MS_Description', '层数信息', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', storey;
EXEC sp_addextendedproperty 'MS_Description', '品种-标注存放刀具品种信息', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', variety;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', created_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', created_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', updated_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', goods_shelves_mark, 'column', updated_time;
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tool_ledger]') AND type in (N'U')) DROP TABLE [dbo].[tool_ledger];
CREATE TABLE [dbo].[tool_ledger](
    id VARCHAR(32) NOT NULL,
    classify_id VARCHAR(32),
    tool_id VARCHAR(32),
    total_count VARCHAR(64),
    available_count VARCHAR(64),
    loss_count VARCHAR(64),
    repair_count VARCHAR(64),
    detection_count VARCHAR(64),
    lend_count VARCHAR(64),
    sharpening_count VARCHAR(64),
    tenant_id VARCHAR,
    create_by VARCHAR(32),
    create_time DATETIME,
    update_by VARCHAR(32),
    update_time DATETIME,
    PRIMARY KEY (id)
);
EXEC sp_addextendedproperty 'MS_Description', '工具台账数据表', 'SCHEMA', dbo, 'table', tool_ledger, null, null;
EXEC sp_addextendedproperty 'MS_Description', '主键', 'SCHEMA', dbo, 'table', tool_ledger, 'column', id;
EXEC sp_addextendedproperty 'MS_Description', '分类编码', 'SCHEMA', dbo, 'table', tool_ledger, 'column', classify_id;
EXEC sp_addextendedproperty 'MS_Description', '工具编码', 'SCHEMA', dbo, 'table', tool_ledger, 'column', tool_id;
EXEC sp_addextendedproperty 'MS_Description', '总库存', 'SCHEMA', dbo, 'table', tool_ledger, 'column', total_count;
EXEC sp_addextendedproperty 'MS_Description', '可用库存', 'SCHEMA', dbo, 'table', tool_ledger, 'column', available_count;
EXEC sp_addextendedproperty 'MS_Description', '总报损数量', 'SCHEMA', dbo, 'table', tool_ledger, 'column', loss_count;
EXEC sp_addextendedproperty 'MS_Description', '在修数量', 'SCHEMA', dbo, 'table', tool_ledger, 'column', repair_count;
EXEC sp_addextendedproperty 'MS_Description', '在检数量', 'SCHEMA', dbo, 'table', tool_ledger, 'column', detection_count;
EXEC sp_addextendedproperty 'MS_Description', '在借数量', 'SCHEMA', dbo, 'table', tool_ledger, 'column', lend_count;
EXEC sp_addextendedproperty 'MS_Description', '在磨数量', 'SCHEMA', dbo, 'table', tool_ledger, 'column', sharpening_count;
EXEC sp_addextendedproperty 'MS_Description', '租户号', 'SCHEMA', dbo, 'table', tool_ledger, 'column', tenant_id;
EXEC sp_addextendedproperty 'MS_Description', '创建人', 'SCHEMA', dbo, 'table', tool_ledger, 'column', create_by;
EXEC sp_addextendedproperty 'MS_Description', '创建时间', 'SCHEMA', dbo, 'table', tool_ledger, 'column', create_time;
EXEC sp_addextendedproperty 'MS_Description', '更新人', 'SCHEMA', dbo, 'table', tool_ledger, 'column', update_by;
EXEC sp_addextendedproperty 'MS_Description', '更新时间', 'SCHEMA', dbo, 'table', tool_ledger, 'column', update_time;
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/controller/InStoreDetailController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,177 @@
package org.jeecg.modules.tms.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.tms.entity.InStoreDetail;
import org.jeecg.modules.tms.service.IInStoreDetailService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
 /**
 * @Description: å…¥åº“明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
@Api(tags="入库明细")
@RestController
@RequestMapping("/tms/inStoreDetail")
@Slf4j
public class InStoreDetailController extends JeecgController<InStoreDetail, IInStoreDetailService> {
    @Autowired
    private IInStoreDetailService inStoreDetailService;
    /**
     * åˆ†é¡µåˆ—表查询
     *
     * @param inStoreDetail
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    //@AutoLog(value = "入库明细-分页列表查询")
    @ApiOperation(value="入库明细-分页列表查询", notes="入库明细-分页列表查询")
    @GetMapping(value = "/list")
    public Result<IPage<InStoreDetail>> queryPageList(InStoreDetail inStoreDetail,
                                   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                   HttpServletRequest req) {
        QueryWrapper<InStoreDetail> queryWrapper = QueryGenerator.initQueryWrapper(inStoreDetail, req.getParameterMap());
        Page<InStoreDetail> page = new Page<InStoreDetail>(pageNo, pageSize);
        IPage<InStoreDetail> pageList = inStoreDetailService.page(page, queryWrapper);
        return Result.OK(pageList);
    }
    /**
     *   æ·»åŠ 
     *
     * @param inStoreDetail
     * @return
     */
    @AutoLog(value = "入库明细-添加")
    @ApiOperation(value="入库明细-添加", notes="入库明细-添加")
    //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:add")
    @PostMapping(value = "/add")
    public Result<String> add(@RequestBody InStoreDetail inStoreDetail) {
        inStoreDetailService.save(inStoreDetail);
        return Result.OK("添加成功!");
    }
    /**
     *  ç¼–辑
     *
     * @param inStoreDetail
     * @return
     */
    @AutoLog(value = "入库明细-编辑")
    @ApiOperation(value="入库明细-编辑", notes="入库明细-编辑")
    //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:edit")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
    public Result<String> edit(@RequestBody InStoreDetail inStoreDetail) {
        inStoreDetailService.updateById(inStoreDetail);
        return Result.OK("编辑成功!");
    }
    /**
     *   é€šè¿‡id删除
     *
     * @param id
     * @return
     */
    @AutoLog(value = "入库明细-通过id删除")
    @ApiOperation(value="入库明细-通过id删除", notes="入库明细-通过id删除")
    //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:delete")
    @DeleteMapping(value = "/delete")
    public Result<String> delete(@RequestParam(name="id",required=true) String id) {
        inStoreDetailService.removeById(id);
        return Result.OK("删除成功!");
    }
    /**
     *  æ‰¹é‡åˆ é™¤
     *
     * @param ids
     * @return
     */
    @AutoLog(value = "入库明细-批量删除")
    @ApiOperation(value="入库明细-批量删除", notes="入库明细-批量删除")
    //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:deleteBatch")
    @DeleteMapping(value = "/deleteBatch")
    public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
        this.inStoreDetailService.removeByIds(Arrays.asList(ids.split(",")));
        return Result.OK("批量删除成功!");
    }
    /**
     * é€šè¿‡id查询
     *
     * @param id
     * @return
     */
    //@AutoLog(value = "入库明细-通过id查询")
    @ApiOperation(value="入库明细-通过id查询", notes="入库明细-通过id查询")
    @GetMapping(value = "/queryById")
    public Result<InStoreDetail> queryById(@RequestParam(name="id",required=true) String id) {
        InStoreDetail inStoreDetail = inStoreDetailService.getById(id);
        if(inStoreDetail==null) {
            return Result.error("未找到对应数据");
        }
        return Result.OK(inStoreDetail);
    }
    /**
    * å¯¼å‡ºexcel
    *
    * @param request
    * @param inStoreDetail
    */
    //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:exportXls")
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, InStoreDetail inStoreDetail) {
        return super.exportXls(request, inStoreDetail, InStoreDetail.class, "入库明细");
    }
    /**
      * é€šè¿‡excel导入数据
    *
    * @param request
    * @param response
    * @return
    */
    //@RequiresPermissions("tms_in_store_detail:importExcel")
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, InStoreDetail.class);
    }
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/controller/InboundDetailController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,174 @@
package org.jeecg.modules.tms.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.tms.entity.InboundDetail;
import org.jeecg.modules.tms.service.IInboundDetailService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
 /**
 * @Description: å…¥åº“申请明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
@Api(tags="入库申请明细")
@RestController
@RequestMapping("/tms/inboundDetail")
@Slf4j
public class InboundDetailController extends JeecgController<InboundDetail, IInboundDetailService> {
    @Autowired
    private IInboundDetailService inboundDetailService;
    /**
     * åˆ†é¡µåˆ—表查询
     *
     * @param inboundDetail
     * @param pageNo
     * @param pageSize
     * @param query
     * @return
     */
    //@AutoLog(value = "入库申请明细-分页列表查询")
    @ApiOperation(value="入库申请明细-分页列表查询", notes="入库申请明细-分页列表查询")
    @GetMapping(value = "/list")
    public Result<?> queryPageList(InboundDetail inboundDetail,
                                   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam Map<String, String> query) {
        IPage<Map<String, Object>> pageList = inboundDetailService.findPageList(pageNo, pageSize, query);
        return Result.ok(pageList);
    }
    /**
     *   æ·»åŠ 
     *
     * @param inboundDetail
     * @return
     */
    @AutoLog(value = "入库申请明细-添加")
    @ApiOperation(value="入库申请明细-添加", notes="入库申请明细-添加")
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_detail:add")
    @PostMapping(value = "/add")
    public Result<String> add(@RequestBody InboundDetail inboundDetail) {
        inboundDetailService.save(inboundDetail);
        return Result.OK("添加成功!");
    }
    /**
     *  ç¼–辑
     *
     * @param inboundDetail
     * @return
     */
    @AutoLog(value = "入库申请明细-编辑")
    @ApiOperation(value="入库申请明细-编辑", notes="入库申请明细-编辑")
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_detail:edit")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
    public Result<String> edit(@RequestBody InboundDetail inboundDetail) {
        inboundDetailService.updateById(inboundDetail);
        return Result.OK("编辑成功!");
    }
    /**
     *   é€šè¿‡id删除
     *
     * @param id
     * @return
     */
    @AutoLog(value = "入库申请明细-通过id删除")
    @ApiOperation(value="入库申请明细-通过id删除", notes="入库申请明细-通过id删除")
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_detail:delete")
    @DeleteMapping(value = "/delete")
    public Result<String> delete(@RequestParam(name="id",required=true) String id) {
        inboundDetailService.removeById(id);
        return Result.OK("删除成功!");
    }
    /**
     *  æ‰¹é‡åˆ é™¤
     *
     * @param ids
     * @return
     */
    @AutoLog(value = "入库申请明细-批量删除")
    @ApiOperation(value="入库申请明细-批量删除", notes="入库申请明细-批量删除")
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_detail:deleteBatch")
    @DeleteMapping(value = "/deleteBatch")
    public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
        this.inboundDetailService.removeByIds(Arrays.asList(ids.split(",")));
        return Result.OK("批量删除成功!");
    }
    /**
     * é€šè¿‡id查询
     *
     * @param id
     * @return
     */
    //@AutoLog(value = "入库申请明细-通过id查询")
    @ApiOperation(value="入库申请明细-通过id查询", notes="入库申请明细-通过id查询")
    @GetMapping(value = "/queryById")
    public Result<InboundDetail> queryById(@RequestParam(name="id",required=true) String id) {
        InboundDetail inboundDetail = inboundDetailService.getById(id);
        if(inboundDetail==null) {
            return Result.error("未找到对应数据");
        }
        return Result.OK(inboundDetail);
    }
    /**
    * å¯¼å‡ºexcel
    *
    * @param request
    * @param inboundDetail
    */
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_detail:exportXls")
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, InboundDetail inboundDetail) {
        return super.exportXls(request, inboundDetail, InboundDetail.class, "入库申请明细");
    }
    /**
      * é€šè¿‡excel导入数据
    *
    * @param request
    * @param response
    * @return
    */
    //@RequiresPermissions("tms_inbound_detail:importExcel")
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, InboundDetail.class);
    }
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/controller/InboundOrderController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,237 @@
package org.jeecg.modules.tms.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.system.service.ISysBusinessCodeRuleService;
import org.jeecg.modules.tms.entity.InboundDetail;
import org.jeecg.modules.tms.entity.InboundOrder;
import org.jeecg.modules.tms.entity.dto.InboundOrderFlowDto;
import org.jeecg.modules.tms.entity.dto.OutBoundOrderFlowDto;
import org.jeecg.modules.tms.service.IInboundDetailService;
import org.jeecg.modules.tms.service.IInboundOrderService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
 /**
 * @Description: å…¥åº“申请单
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
@Api(tags="入库申请单")
@RestController
@RequestMapping("/tms/inboundOrder")
@Slf4j
public class InboundOrderController extends JeecgController<InboundOrder, IInboundOrderService> {
    @Autowired
    private IInboundOrderService inboundOrderService;
     @Autowired
     private IInboundDetailService inboundDetailService;
     @Autowired
     private ISysBusinessCodeRuleService businessCodeRuleService;
    /**
     * åˆ†é¡µåˆ—表查询
     *
     * @param inboundOrder
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    //@AutoLog(value = "入库申请单-分页列表查询")
    @ApiOperation(value="入库申请单-分页列表查询", notes="入库申请单-分页列表查询")
    @GetMapping(value = "/list")
    public Result<IPage<InboundOrder>> queryPageList(InboundOrder inboundOrder,
                                   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                   HttpServletRequest req) {
        QueryWrapper<InboundOrder> queryWrapper = QueryGenerator.initQueryWrapper(inboundOrder, req.getParameterMap());
        Page<InboundOrder> page = new Page<InboundOrder>(pageNo, pageSize);
        IPage<InboundOrder> pageList = inboundOrderService.page(page, queryWrapper);
        return Result.OK(pageList);
    }
    /**
     *   æ·»åŠ 
     *
     * @param jSONObject
     * @return
     */
    @AutoLog(value = "入库申请单-添加")
    @ApiOperation(value="入库申请单-添加", notes="入库申请单-添加")
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_order:add")
    @PostMapping(value = "/add")
    public Result<?> add(@RequestBody JSONObject jSONObject) {
        InboundOrder inboundOrder = jSONObject.toJavaObject(InboundOrder.class);
        inboundOrder.setOrderStatus("1");
        inboundOrder.setInStatus("1");
        inboundOrder.setInboundNum(businessCodeRuleService.generateBusinessCodeSeq("InBoundOrder"));
        inboundOrderService.save(inboundOrder);
        // ä¿å­˜å…¥åº“申请单明细数据
        JSONArray jsonArray = jSONObject.getJSONArray("detailData");
        List<InboundDetail> list = jsonArray.toJavaList(InboundDetail.class);
        for (int i = 0; i < list.size(); i++) {
            InboundDetail temp = list.get(i);
            temp.setInStorehouseId(inboundOrder.getId());
            temp.setToolCode(temp.getToolCodeId());
        }
        inboundDetailService.saveBatch(list);
        return Result.OK("添加成功!");
    }
    /**
     *  ç¼–辑
     *
     * @param jSONObject
     * @return
     */
    @AutoLog(value = "入库申请单-编辑")
    @ApiOperation(value="入库申请单-编辑", notes="入库申请单-编辑")
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_order:edit")
    @PostMapping(value = "/edit")
    public Result<?> edit(@RequestBody JSONObject jSONObject) {
        InboundOrder inboundOrder = jSONObject.toJavaObject(InboundOrder.class);
        inboundOrderService.updateById(inboundOrder);
        // åˆ é™¤ç”³è¯·å•明细数据
        inboundDetailService.deleteByInboundOrderId(inboundOrder.getId());
        // ä¿å­˜å…¥åº“申请单明细数据
        JSONArray jsonArray = jSONObject.getJSONArray("detailData");
        List<InboundDetail> list = jsonArray.toJavaList(InboundDetail.class);
        for (int i = 0; i < list.size(); i++) {
            InboundDetail temp = list.get(i);
            temp.setInStorehouseId(inboundOrder.getId());
            temp.setToolCode(temp.getToolCodeId());
        }
        inboundDetailService.saveOrUpdateBatch(list);
        return Result.OK("操作成功!");
    }
    /**
     *   é€šè¿‡id删除
     *
     * @param id
     * @return
     */
    @AutoLog(value = "入库申请单-通过id删除")
    @ApiOperation(value="入库申请单-通过id删除", notes="入库申请单-通过id删除")
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_order:delete")
    @DeleteMapping(value = "/delete")
    public Result<String> delete(@RequestParam(name="id",required=true) String id) {
        inboundOrderService.removeById(id);
        return Result.OK("删除成功!");
    }
    /**
     *  æ‰¹é‡åˆ é™¤
     *
     * @param ids
     * @return
     */
    @AutoLog(value = "入库申请单-批量删除")
    @ApiOperation(value="入库申请单-批量删除", notes="入库申请单-批量删除")
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_order:deleteBatch")
    @DeleteMapping(value = "/deleteBatch")
    public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
        this.inboundOrderService.removeByIds(Arrays.asList(ids.split(",")));
        return Result.OK("批量删除成功!");
    }
    /**
     * é€šè¿‡id查询
     *
     * @param id
     * @return
     */
    //@AutoLog(value = "入库申请单-通过id查询")
    @ApiOperation(value="入库申请单-通过id查询", notes="入库申请单-通过id查询")
    @GetMapping(value = "/queryById")
    public Result<InboundOrder> queryById(@RequestParam(name="id",required=true) String id) {
        InboundOrder inboundOrder = inboundOrderService.getById(id);
        if(inboundOrder==null) {
            return Result.error("未找到对应数据");
        }
        return Result.OK(inboundOrder);
    }
    /**
    * å¯¼å‡ºexcel
    *
    * @param request
    * @param inboundOrder
    */
    //@RequiresPermissions("org.jeecg.modules:tms_inbound_order:exportXls")
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, InboundOrder inboundOrder) {
        return super.exportXls(request, inboundOrder, InboundOrder.class, "入库申请单");
    }
    /**
      * é€šè¿‡excel导入数据
    *
    * @param request
    * @param response
    * @return
    */
    //@RequiresPermissions("tms_inbound_order:importExcel")
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, InboundOrder.class);
    }
     /**
      *  æäº¤
      *
      * @param id
      * @return
      */
     @AutoLog(value = "入库申请单-提交")
     @GetMapping(value = "/submit")
     public Result<String> submit(@RequestParam(name = "id") String id) {
         inboundOrderService.submit(id);
         return Result.OK("提交成功!");
     }
     @AutoLog(value = "审批流程")
     @ApiOperation(value = "入库申请单-审批流程", notes = "入库申请单-审批流程")
     @PostMapping("/approval")
     public Result<?> approval(@RequestBody InboundOrderFlowDto inboundOrderFlowDto) {
         inboundOrderService.approvalProcess(inboundOrderFlowDto);
         return Result.OK("操作成功");
     }
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/InStoreDetail.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,94 @@
package org.jeecg.modules.tms.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * @Description: å…¥åº“明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
@Data
@TableName("tms_in_store_detail")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tms_in_store_detail对象", description="入库明细")
public class InStoreDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    /**工具编码*/
    @Excel(name = "工具编码", width = 15)
    @ApiModelProperty(value = "工具编码")
    private String toolCode;
    /**工具编号*/
    @Excel(name = "工具编号", width = 15)
    @ApiModelProperty(value = "工具编号")
    private String toolId;
    /**工具入库方式*/
    @Excel(name = "工具入库方式", width = 15)
    @ApiModelProperty(value = "工具入库方式")
    private String inStorehouseType;
    /**库位号*/
    @Excel(name = "库位号", width = 15)
    @ApiModelProperty(value = "库位号")
    private String goodsShelvesId;
    /**入库数量*/
    @Excel(name = "入库数量", width = 15)
    @ApiModelProperty(value = "入库数量")
    private BigDecimal inNumber;
    /**入库申请单号*/
    @Excel(name = "入库申请单号", width = 15)
    @ApiModelProperty(value = "入库申请单号")
    private String inStorehouseId;
    /**入库操作方式;1.按申请单
2.手工操作*/
    @Excel(name = "入库操作方式;1.按申请单 2.手工操作", width = 15)
    @ApiModelProperty(value = "入库操作方式;1.按申请单 2.手工操作")
    private java.lang.String operateType;
    /**入库时间*/
    @Excel(name = "入库时间", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "入库时间")
    private Date inboundTime;
    /**租户号*/
    @Excel(name = "租户号", width = 15)
    @ApiModelProperty(value = "租户号")
    private String tenantId;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**创建时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/InboundDetail.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,97 @@
package org.jeecg.modules.tms.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * @Description: å…¥åº“申请明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
@Data
@TableName("tms_inbound_detail")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tms_inbound_detail对象", description="入库申请明细")
public class InboundDetail implements Serializable {
    private static final long serialVersionUID = 1L;
    /**主键*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
    /**入库申请单号*/
    @Excel(name = "入库申请单号", width = 15)
    @ApiModelProperty(value = "入库申请单号")
    private String inStorehouseId;
    /**货架号/存储位置*/
    @Excel(name = "货架号/存储位置", width = 15)
    @ApiModelProperty(value = "货架号/存储位置")
    private String goodsShelvesId;
    /**工具编码*/
    @Excel(name = "工具编码", width = 15)
    @ApiModelProperty(value = "工具编码")
    private String toolCode;
    /**工具编号*/
    @Excel(name = "工具编号", width = 15)
    @ApiModelProperty(value = "工具编号")
    private String toolId;
    /**入库数量*/
    @Excel(name = "入库数量", width = 15)
    @ApiModelProperty(value = "入库数量")
    private BigDecimal inStorageQuantity;
    /**实际入库数量*/
    @Excel(name = "实际入库数量", width = 15)
    @ApiModelProperty(value = "实际入库数量")
    private BigDecimal inActualCount;
    /**备注*/
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;
    /**租户号*/
    @Excel(name = "租户号", width = 15)
    @ApiModelProperty(value = "租户号")
    private String tenantId;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**创建时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    @TableField(exist = false)
    private String toolName;
    @TableField(exist = false)
    private String toolModel;
    @TableField(exist = false)
    private String inStorehouseType;
    @TableField(exist = false)
    private String toolCodeId;
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/InboundOrder.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,116 @@
package org.jeecg.modules.tms.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * @Description: å…¥åº“申请单
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
@Data
@TableName("tms_inbound_order")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tms_inbound_order对象", description="入库申请单")
public class InboundOrder implements Serializable {
    private static final long serialVersionUID = 1L;
    /**主键id*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键id")
    private String id;
    /**入库单编号*/
    @Excel(name = "入库单编号", width = 15)
    @ApiModelProperty(value = "入库单编号")
    private String inboundNum;
    /**入库时间*/
    @Excel(name = "入库时间", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "入库时间")
    private Date inboundTime;
    /**入库类型*/
    @Excel(name = "入库类型", width = 15)
    @ApiModelProperty(value = "入库类型")
    @Dict(dicCode = "in_storehouse_type")
    private String inStorehouseType;
    /**经手人*/
    @Excel(name = "经手人", width = 15)
    @ApiModelProperty(value = "经手人")
    @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname")
    private String handler;
    /**借用单号*/
    @Excel(name = "借用单号", width = 15)
    @ApiModelProperty(value = "借用单号")
    private String borrowNum;
    /**审核人*/
    @Excel(name = "审核人", width = 15)
    @ApiModelProperty(value = "审核人")
    @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname")
    private String reviewer;
    /**审核时间*/
    @Excel(name = "审核时间", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "审核时间")
    private Date approvalDate;
    /**审核意见*/
    @Excel(name = "审核意见", width = 15)
    @ApiModelProperty(value = "审核意见")
    private String approvalOpinion;
    /**单子状态*/
    @Excel(name = "单子状态", width = 15)
    @ApiModelProperty(value = "单子状态")
    @Dict(dicCode = "in_bill_status")
    private String orderStatus;
    /**入库状态*/
    @Excel(name = "入库状态", width = 15)
    @Dict(dicCode = "in_status")
    @ApiModelProperty(value = "入库状态")
    private String inStatus;
    /**申请原因*/
    @Excel(name = "申请原因", width = 15)
    @ApiModelProperty(value = "申请原因")
    private String applicationReason;
    /**备注*/
    @Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;
    /**租户号*/
    @Excel(name = "租户号", width = 15)
    @ApiModelProperty(value = "租户号")
    private String tenantId;
    /**操作员*/
    @ApiModelProperty(value = "操作员")
    private String createBy;
    /**申请时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "申请时间")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/ToolsConfigProperty.java
@@ -55,6 +55,7 @@
    /**工具类型;1.通用 2.专用*/
    @Excel(name = "工具类型;1.通用 2.专用", width = 15)
    @ApiModelProperty(value = "工具类型;1.通用 2.专用")
    @Dict(dicCode = "application_type")
    private java.lang.String applicationType;
    /**标准级别*/
    @Excel(name = "标准级别", width = 15)
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/dto/InboundOrderFlowDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
package org.jeecg.modules.tms.entity.dto;
import lombok.Data;
import org.jeecg.modules.flowable.domain.vo.FlowTaskVo;
@Data
public class InboundOrderFlowDto extends FlowTaskVo {
    //审批状态
    private String status;
    //审批意见
    private String approvalOpinion;
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaBladeVo.java
@@ -59,6 +59,7 @@
    @ApiModelProperty(value = "工具类型;1.通用 2.专用")
    private String applicationType;
    private String applicationTypeName;
    @ApiModelProperty(value = "厂家")
    private String supplierId;
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaCommonToolVo.java
@@ -6,6 +6,7 @@
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import java.io.Serializable;
@@ -56,7 +57,9 @@
    private String positionCode;
    @ApiModelProperty(value = "工具类型;1.通用 2.专用")
    @Dict(dicCode = "application_type")
    private String applicationType;
    private String applicationTypeName;
    @ApiModelProperty(value = "厂家")
    private String supplierId;
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaMillToolVo.java
@@ -59,6 +59,7 @@
    @ApiModelProperty(value = "工具类型;1.通用 2.专用")
    private String applicationType;
    private String applicationTypeName;
    @ApiModelProperty(value = "厂家")
    private String supplierId;
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaThreadingToolVo.java
@@ -59,6 +59,7 @@
    @ApiModelProperty(value = "工具类型;1.通用 2.专用")
    private String applicationType;
    private String applicationTypeName;
    @ApiModelProperty(value = "厂家")
    private String supplierId;
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/entity/vo/ParaTurningToolsVo.java
@@ -59,6 +59,7 @@
    @ApiModelProperty(value = "工具类型;1.通用 2.专用")
    private String applicationType;
    private String applicationTypeName;
    @ApiModelProperty(value = "厂家")
    private String supplierId;
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/InStoreDetailMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package org.jeecg.modules.tms.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.tms.entity.InStoreDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * @Description: å…¥åº“明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
public interface InStoreDetailMapper extends BaseMapper<InStoreDetail> {
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/InboundDetailMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
package org.jeecg.modules.tms.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.tms.entity.InboundDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * @Description: å…¥åº“申请明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
public interface InboundDetailMapper extends BaseMapper<InboundDetail> {
    public IPage<Map<String, Object>> findPageList(IPage<Map> pageData, @Param(Constants.WRAPPER) Wrapper<Map> wrapper);
    @Delete("delete from tms_inbound_detail where in_storehouse_id = #{inboundOrderId}")
    public boolean deleteByInboundOrderId(@Param("inboundOrderId") String inboundOrderId);
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/InboundOrderMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package org.jeecg.modules.tms.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.tms.entity.InboundOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
 * @Description: å…¥åº“申请单
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
public interface InboundOrderMapper extends BaseMapper<InboundOrder> {
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/BaseToolsMapper.xml
@@ -59,43 +59,47 @@
            t2.adapt_holder adaptHolder,
            t2.remark,
            t3.classify_id classifyNum,
            t3.type_name classifyName
            from tms_base_tools t
        left join tms_tools_config_property t1 on t1.tool_code = t.id
        left join tms_para_hole_tools t2 on t2.tool_code = t.id
        left join tms_tools_classify t3 on t3.id = t.classify_id
        ${ew.customSqlSegment}
            t3.type_name classifyName,
            t4.item_text applicationTypeName
        from tms_base_tools t
                 left join tms_tools_config_property t1 on t1.tool_code = t.id
                 left join tms_para_hole_tools t2 on t2.tool_code = t.id
                 left join tms_tools_classify t3 on t3.id = t.classify_id
                 left join (select * from v_sys_dict where dict_code = 'application_type') t4 on t4.item_value = t1.application_type
            ${ew.customSqlSegment}
    </select>
    <select id="paraCommonToolList" resultType="org.jeecg.modules.tms.entity.vo.ParaCommonToolVo">
    select
    t.id,
    t.classify_id classifyId,
    t.tool_code toolCode,
    t.sign_code signCode,
    t.chinese_name chineseName,
    t.foreign_language_name foreignLanguageName,
    t.standard_level standardLevel,
    t.standard_code standardCode,
    t.tool_model toolModel,
    t.parama_table_name paramaTableName,
    t1.application_type applicationType,
    t1.supplier_id supplierId,
    t1.province_city provinceCity,
    t1.position_code positionCode,
    t1.storage_location storageLocation,
    t1.main_unit mainUnit,
    t1.auxiliary_unit auxiliaryUnit,
    t1.auxiliary_unit_flag auxiliaryUnitFlag,
    t1.price,
    t1.lower_inventory lowerInventory,
    t1.highest_inventory highestInventory,
    t3.classify_id classifyNum,
    t3.type_name classifyName
    from tms_base_tools t
    left join tms_tools_config_property t1 on t1.tool_code = t.id
    left join tms_tools_classify t3 on t3.id = t.classify_id
    ${ew.customSqlSegment}
</select>
        select
            t.id,
            t.classify_id classifyId,
            t.tool_code toolCode,
            t.sign_code signCode,
            t.chinese_name chineseName,
            t.foreign_language_name foreignLanguageName,
            t.standard_level standardLevel,
            t.standard_code standardCode,
            t.tool_model toolModel,
            t.parama_table_name paramaTableName,
            t1.application_type applicationType,
            t1.supplier_id supplierId,
            t1.province_city provinceCity,
            t1.position_code positionCode,
            t1.storage_location storageLocation,
            t1.main_unit mainUnit,
            t1.auxiliary_unit auxiliaryUnit,
            t1.auxiliary_unit_flag auxiliaryUnitFlag,
            t1.price,
            t1.lower_inventory lowerInventory,
            t1.highest_inventory highestInventory,
            t3.classify_id classifyNum,
            t3.type_name classifyName,
            t4.item_text applicationTypeName
        from tms_base_tools t
                 left join tms_tools_config_property t1 on t1.tool_code = t.id
                 left join tms_tools_classify t3 on t3.id = t.classify_id
                 left join (select * from v_sys_dict where dict_code = 'application_type') t4 on t4.item_value = t1.application_type
            ${ew.customSqlSegment}
    </select>
    <select id="paraThreadingToolList" resultType="org.jeecg.modules.tms.entity.vo.ParaThreadingToolVo">
        SELECT
            t.id,
@@ -144,12 +148,14 @@
            t2.connection_aperture connectionAperture,
            t2.connecting_keyway connectingKeyway,
            t3.classify_id classifyNum,
            t3.type_name classifyName
            t3.type_name classifyName,
            t4.item_text applicationTypeName
        FROM
            tms_base_tools t
                LEFT JOIN tms_tools_config_property t1 ON t1.tool_code = t.id
                LEFT JOIN tms_para_threading_tool t2 ON t2.tool_code = t.id
                LEFT JOIN tms_tools_classify t3 ON t3.id = t.classify_id
                left join (select * from v_sys_dict where dict_code = 'application_type') t4 on t4.item_value = t1.application_type
            ${ew.customSqlSegment}
    </select>
    <select id="paraMillToolList" resultType="org.jeecg.modules.tms.entity.vo.ParaMillToolVo">
@@ -209,12 +215,14 @@
            t2.pitch,
            t2.recently_diameter recentlyDiameter,
            t3.classify_id classifyNum,
            t3.type_name classifyName
            t3.type_name classifyName,
            t4.item_text applicationTypeName
        FROM
            tms_base_tools t
                LEFT JOIN tms_tools_config_property t1 ON t1.tool_code = t.id
                LEFT JOIN tms_para_mill_tool t2 ON t2.tool_code = t.id
                LEFT JOIN tms_tools_classify t3 ON t3.id = t.classify_id
                left join (select * from v_sys_dict where dict_code = 'application_type') t4 on t4.item_value = t1.application_type
            ${ew.customSqlSegment}
    </select>
    <select id="paraTurningToolsList" resultType="org.jeecg.modules.tms.entity.vo.ParaTurningToolsVo">
@@ -278,12 +286,14 @@
            t2.blade_thickness bladeThickness,
            t2.min_diameter minDiameter,
            t3.classify_id classifyNum,
            t3.type_name classifyName
            t3.type_name classifyName,
            t4.item_text applicationTypeName
        FROM
            tms_base_tools t
                LEFT JOIN tms_tools_config_property t1 ON t1.tool_code = t.id
                LEFT JOIN tms_para_turning_tools t2 ON t2.tool_code = t.id
                LEFT JOIN tms_tools_classify t3 ON t3.id = t.classify_id
                left join (select * from v_sys_dict where dict_code = 'application_type') t4 on t4.item_value = t1.application_type
            ${ew.customSqlSegment}
    </select>
    <select id="paraBladeList" resultType="org.jeecg.modules.tms.entity.vo.ParaBladeVo">
@@ -335,14 +345,17 @@
            t2.pitch,
            t2.min_internal_thread minInternalThread,
            t3.classify_id classifyNum,
            t3.type_name classifyName
            t3.type_name classifyName,
            t4.item_text applicationTypeName
        FROM
            tms_base_tools t
                LEFT JOIN tms_tools_config_property t1 ON t1.tool_code = t.id
                LEFT JOIN tms_para_blade t2 ON t2.tool_code = t.id
                LEFT JOIN tms_tools_classify t3 ON t3.id = t.classify_id
                left join (select * from v_sys_dict where dict_code = 'application_type') t4 on t4.item_value = t1.application_type
            ${ew.customSqlSegment}
    </select>
    <select id="pageWithLedgerAndConfig" resultType="org.jeecg.modules.tms.entity.vo.StocktakingPoundVo">
        SELECT
        t.id,
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/InStoreDetailMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.tms.mapper.InStoreDetailMapper">
</mapper>
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/InboundDetailMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.tms.mapper.InboundDetailMapper">
    <select id="findPageList" resultType="map" parameterType="String">
        select
            t1.id,
            t3.id toolCodeId,
            t1.in_storage_quantity inStorageQuantity,
            t3.tool_code toolCode,
            t3.chinese_name chineseName,
            t3.tool_model toolModel,
            t5.item_text applicationType
            from tms_inbound_detail t1
            left join tms_inbound_order t2 on t1.in_storehouse_id = t2.id
            left join tms_base_tools t3 on t3.id = t1.tool_code
            left join tms_tools_config_property t4 on t4.tool_code = t1.tool_code
            left join (select * from v_sys_dict where dict_code = 'application_type') t5 on t5.item_value = t4.application_type
            ${ew.customSqlSegment}
    </select>
</mapper>
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/mapper/xml/InboundOrderMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.tms.mapper.InboundOrderMapper">
</mapper>
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/IInStoreDetailService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.tms.service;
import org.jeecg.modules.tms.entity.InStoreDetail;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * @Description: å…¥åº“明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
public interface IInStoreDetailService extends IService<InStoreDetail> {
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/IInboundDetailService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,20 @@
package org.jeecg.modules.tms.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jeecg.modules.tms.entity.InboundDetail;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Map;
/**
 * @Description: å…¥åº“申请明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
public interface IInboundDetailService extends IService<InboundDetail> {
    IPage<Map<String, Object>> findPageList(Integer pageNo, Integer pageSize, Map<String, String> query);
    public boolean deleteByInboundOrderId(String inboundOrderId);
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/IInboundOrderService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
package org.jeecg.modules.tms.service;
import org.jeecg.modules.tms.entity.InboundOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.tms.entity.dto.InboundOrderFlowDto;
import org.jeecg.modules.tms.entity.dto.OutBoundOrderFlowDto;
/**
 * @Description: å…¥åº“申请单
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
public interface IInboundOrderService extends IService<InboundOrder> {
    boolean submit(String id);
    void approvalProcess(InboundOrderFlowDto inboundOrderFlowDto);
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/impl/InStoreDetailServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
package org.jeecg.modules.tms.service.impl;
import org.jeecg.modules.tms.entity.InStoreDetail;
import org.jeecg.modules.tms.mapper.InStoreDetailMapper;
import org.jeecg.modules.tms.service.IInStoreDetailService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * @Description: å…¥åº“明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
@Service
public class InStoreDetailServiceImpl extends ServiceImpl<InStoreDetailMapper, InStoreDetail> implements IInStoreDetailService {
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/impl/InboundDetailServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,55 @@
package org.jeecg.modules.tms.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.exception.ExceptionCast;
import org.jeecg.modules.tms.entity.InboundDetail;
import org.jeecg.modules.tms.mapper.InboundDetailMapper;
import org.jeecg.modules.tms.service.IInboundDetailService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @Description: å…¥åº“申请明细
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
@Service
public class InboundDetailServiceImpl extends ServiceImpl<InboundDetailMapper, InboundDetail> implements IInboundDetailService {
    @Override
    public IPage<Map<String, Object>> findPageList(Integer pageNo, Integer pageSize, Map<String, String> query) {
        if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 1) {
            ExceptionCast.cast("参数错误");
        }
        IPage<Map> pageData = new Page<Map>(pageNo, pageSize);
        QueryWrapper<Map> queryWrapper = Wrappers.query();
        if (null != query) {
            String inboundOrderId = query.get("inboundOrderId");
            if (StringUtils.isNotBlank(inboundOrderId)) {
                queryWrapper.eq("t1.in_storehouse_id", inboundOrderId);
            }
            // æŽ’序写法
            List<OrderItem> orderItems = new ArrayList<>();
            orderItems.add(OrderItem.desc("t1.create_time"));
            ((Page<Map>) pageData).setOrders(orderItems);
        }
        return super.getBaseMapper().findPageList(pageData,queryWrapper);
    }
    @Override
    public boolean deleteByInboundOrderId(String inboundOrderId) {
        return this.baseMapper.deleteByInboundOrderId(inboundOrderId);
    }
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/impl/InboundOrderServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,209 @@
package org.jeecg.modules.tms.service.impl;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.flowable.engine.TaskService;
import org.flowable.task.api.Task;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness;
import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService;
import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI;
import org.jeecg.modules.flowable.apithird.service.FlowCommonService;
import org.jeecg.modules.flowable.service.IFlowDefinitionService;
import org.jeecg.modules.flowable.service.IFlowTaskService;
import org.jeecg.modules.tms.entity.InboundOrder;
import org.jeecg.modules.tms.entity.dto.InboundOrderFlowDto;
import org.jeecg.modules.tms.mapper.InboundOrderMapper;
import org.jeecg.modules.tms.service.IInboundOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
 * @Description: å…¥åº“申请单
 * @Author: jeecg-boot
 * @Date:   2025-05-19
 * @Version: V1.0
 */
@Service("IInboundOrderService")
public class InboundOrderServiceImpl extends ServiceImpl<InboundOrderMapper, InboundOrder> implements IInboundOrderService, FlowCallBackServiceI {
    @Autowired
    private FlowCommonService flowCommonService;
    @Autowired
    private IFlowDefinitionService flowDefinitionService;
    @Autowired
    private IFlowTaskService flowTaskService;
    @Autowired
    private TaskService taskService;
    @Autowired
    private IFlowMyBusinessService flowMyBusinessService;
    @Override
    public boolean submit(String id) {
        InboundOrder inboundOrder = this.getById(id);
        //发起审批流程
        this.triggerProcess(inboundOrder);
        //更新入库单审批状态为已提交
        inboundOrder.setOrderStatus("2");
        this.updateById(inboundOrder);
        return true;
    }
    /**
     * è§¦å‘流程
     *
     * @param inboundOrder
     * @return
     */
    public boolean triggerProcess(InboundOrder inboundOrder) {
        flowCommonService.initActBusiness("入库申请单号:" + inboundOrder.getInboundNum()+"发起审批流程",
                inboundOrder.getId(), "IInboundOrderService", "tool_in_storage", null);
        Map<String, Object> variables = new HashMap<>();
        variables.put("dataId", inboundOrder.getId());
        variables.put("organization", "新增入库申请单默认启动流程");
        variables.put("comment", "新增入库申请单默认启动流程");
        variables.put("proofreading", true);
        List<String> usernames = new ArrayList<>();
        usernames.add(inboundOrder.getHandler());
        variables.put("NextAssignee", usernames);
        Result result = flowDefinitionService.startProcessInstanceByKey("tool_in_storage", variables);
        return result.isSuccess();
    }
    @Override
    public void afterFlowHandle(FlowMyBusiness business) {
        business.getTaskNameId();//接下来审批的节点
        business.getValues();//前端传进来的参数
        business.getActStatus();
    }
    @Override
    public Object getBusinessDataById(String dataId) {
        return this.getById(dataId);
    }
    @Override
    public Map<String, Object> flowValuesOfTask(String taskNameId, Map<String, Object> values) {
        return null;
    }
    @Override
    public List<String> flowCandidateUsernamesOfTask(String taskNameId, Map<String, Object> values) {
        //业务是否干预流程,业务干预,流程干预,指定人员进行处理
        //获取下一步处理人
        Object object = values.get("NextAssignee");
        return (List<String>) object;
    }
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void approvalProcess(InboundOrderFlowDto inboundOrderFlowDto) {
        if (StrUtil.isBlank(inboundOrderFlowDto.getTaskId()) || StrUtil.isBlank(inboundOrderFlowDto.getDataId())) {
            throw new JeecgBootException("非法参数!");
        }
        // èŽ·å–å½“å‰ç™»å½•ç”¨æˆ·
        LoginUser user = getCurrentUser();
        if (user == null || StrUtil.isBlank(user.getId())) {
            throw new JeecgBootException("账号不存在");
        }
        //获取入库申请单信息
        InboundOrder inboundOrder = getById(inboundOrderFlowDto.getDataId());
        if (inboundOrder == null) {
            throw new JeecgBootException("未找到对应的出库申请单!");
        }
        //获取流程业务记录
        FlowMyBusiness flowMyBusiness = getFlowMyBusiness(inboundOrderFlowDto.getInstanceId());
        if (flowMyBusiness == null) {
            throw new JeecgBootException("流程记录不存在");
        }
        // æ£€æŸ¥ç”¨æˆ·æ˜¯å¦æœ‰æƒé™æ“ä½œä»»åŠ¡
        if (!isUserAuthorized(flowMyBusiness, user)) {
            throw new JeecgBootException("用户无权操作此任务");
        }
        // è®¤é¢†ä»»åŠ¡
        if (!claimTask(flowMyBusiness.getTaskId(), user)) {
            throw new JeecgBootException("任务不存在、已完成或已被他人认领");
        }
        //设置流程变量
        setupProcessVariables(inboundOrderFlowDto, inboundOrder, user);
        //完成流程任务
        Result result = flowTaskService.complete(inboundOrderFlowDto);
        //根据任务完成结果更新申请单状态
        if (result.isSuccess()) {
            inboundOrder.setOrderStatus(inboundOrderFlowDto.getStatus());
            if ("3".equals(inboundOrderFlowDto.getStatus())) {
                inboundOrder.setInStatus("1");
            }
            inboundOrder.setReviewer(user.getUsername());
            inboundOrder.setApprovalDate(new Date());
            inboundOrder.setApprovalOpinion(inboundOrderFlowDto.getApprovalOpinion());
            updateById(inboundOrder);
        }
    }
    private LoginUser getCurrentUser() {
        // èŽ·å–å½“å‰è®¤è¯çš„ç™»å½•ç”¨æˆ·ä¿¡æ¯
        Subject currentUser = SecurityUtils.getSubject();
        if (currentUser != null && currentUser.isAuthenticated()) {
            Object principal = currentUser.getPrincipal();
            if (principal instanceof LoginUser) {
                return (LoginUser) principal;
            }
        }
        return null;
    }
    private FlowMyBusiness getFlowMyBusiness(String instanceId) {
        List<FlowMyBusiness> businessList = flowMyBusinessService.list(
                new LambdaQueryWrapper<FlowMyBusiness>().eq(FlowMyBusiness::getProcessInstanceId, instanceId));
        return businessList.isEmpty() ? null : businessList.get(0);
    }
    private boolean isUserAuthorized(FlowMyBusiness flowMyBusiness, LoginUser user) {
        List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class);
        return todoUsers != null && todoUsers.contains(user.getUsername());
    }
    private boolean claimTask(String taskId, LoginUser user) {
        Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
        if (task == null) {
            return false;
        }
        if (task.getAssignee() != null && !task.getAssignee().equals(user.getUsername())) {
            return false;
        }
        taskService.claim(taskId, user.getUsername());
        return true;
    }
    private void setupProcessVariables(InboundOrderFlowDto inboundOrderFlowDto, InboundOrder inboundOrder, LoginUser user) {
        if ("2".equals(inboundOrder.getOrderStatus()) && user.getUsername().equals(inboundOrder.getReviewer())) {
            Map<String, Object> values = new HashMap<>();
            values.put("dataId", inboundOrder.getId());
            values.put("organization", inboundOrderFlowDto.getApprovalOpinion());
            values.put("comment", inboundOrderFlowDto.getApprovalOpinion());
            values.put("status", inboundOrderFlowDto.getStatus());
            values.put("NextAssignee", Collections.singletonList(inboundOrder.getReviewer()));
            inboundOrderFlowDto.setValues(values);
        }
    }
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/service/impl/ToolsClassifyServiceImpl.java
@@ -78,7 +78,7 @@
        return this.baseMapper.queryPageList(page, queryWrapper);
    }
    public List<CommonGenericTree> loadTree() {
        List<ToolsClassify> toolsClassifyList = this.list();
        List<ToolsClassify> toolsClassifyList = this.lambdaQuery().orderByAsc(ToolsClassify::getId).list();
        List<CommonGenericTree> commonGenericTreeList = loadTree(toolsClassifyList);
        return commonGenericTreeList;
    }
@@ -88,20 +88,15 @@
        List<CommonGenericTree> list = new ArrayList<>();
        Map<String, CommonGenericTree> map = new HashMap<>();
        CommonGenericTree<ToolsClassify> node = new CommonGenericTree<>();
        node.setKey("-1");
        node.setTitle("工具分类");
        node.setRField1("");
        node.setRField2("");
        node.setEntity(new ToolsClassify().setId("-1").setClassifyId("0").setTypeName("工具分类").setLeafFlag("2"));
        list.add(node);
        if (CollectionUtils.isNotEmpty(toolsClassifyList)) {
            CommonGenericTree<ToolsClassify> tcNode;
            CommonGenericTree<ToolsClassify> childNode;
            for (ToolsClassify tc : toolsClassifyList) {
                if (StrUtils.isBlankOrNull(tc.getParentId()) || tc.getParentId().equals("-1")) {
                ToolsClassify child = tc;
                if (StrUtils.isBlankOrNull(tc.getParentId())) {
                    tcNode = new CommonGenericTree<>();
                    tcNode.setKey(tc.getId());
                    tcNode.setTitle(tc.getClassifyId() + "/" + tc.getTypeName());
                    tcNode.setParentId(node.getKey());
                    tcNode.setIcon("");
                    tcNode.setType(1);
                    tcNode.setValue(tc.getId());
@@ -109,32 +104,23 @@
                    tcNode.setRField1(tc.getClassifyId());
                    tcNode.setRField2(getBaseParent(tc.getId(), 0).getClassifyId());
                    tcNode.setEntity(tc);
                    node.addChildren(tcNode);
                    list.add(tcNode);
                    map.put(tc.getId(), tcNode);
                }
            }
            CommonGenericTree<ToolsClassify> childNode;
            for (ToolsClassify tc : toolsClassifyList) {
                ToolsClassify child = tc;
                if (map.containsKey(child.getParentId())) {
                    if (StrUtils.isBlankOrNull(tc.getParentId()) || tc.getParentId().equals("-1")) {
                        toolsClassify = tc;
                    } else {
                        tcNode = map.get(child.getParentId());
                        childNode = new CommonGenericTree<>();
                        childNode.setKey(tc.getId());
                        childNode.setTitle(tc.getClassifyId() + "/" + tc.getTypeName());
                        childNode.setParentId(tc.getParentId());
                        childNode.setIcon("");
                        childNode.setType(0);
                        childNode.setValue(tc.getId());
                        childNode.setDisabled(CommonConstant.STATUS_0.equals(tc.getStatus()) ? true : false);
                        childNode.setRField1(tc.getClassifyId());
                        childNode.setRField2(getBaseParent(tc.getId(), 0).getClassifyId());
                        childNode.setEntity(tc);
                        tcNode.addChildren(childNode);
                        map.put(child.getId(), childNode);
                    }
                } else {
                    tcNode = map.get(child.getParentId());
                    childNode = new CommonGenericTree<>();
                    childNode.setKey(tc.getId());
                    childNode.setTitle(tc.getClassifyId() + "/" + tc.getTypeName());
                    childNode.setParentId(tc.getParentId());
                    childNode.setIcon("");
                    childNode.setType(0);
                    childNode.setValue(tc.getId());
                    childNode.setDisabled(CommonConstant.STATUS_0.equals(tc.getStatus()) ? true : false);
                    childNode.setRField1(tc.getClassifyId());
                    childNode.setRField2(getBaseParent(tc.getId(), 0).getClassifyId());
                    childNode.setEntity(tc);
                    tcNode.addChildren(childNode);
                    map.put(child.getId(), childNode);
                }
            }
        }
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/utils/QrCodePrinterUtils.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,74 @@
package org.jeecg.modules.tms.utils;
import javax.print.*;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import java.awt.print.*;
import java.awt.image.BufferedImage;
import java.awt.*;
public class QrCodePrinterUtils implements Printable {
    private final BufferedImage image;
    public QrCodePrinterUtils(BufferedImage image) {
        this.image = image;
    }
    /**
     * æ‰“印二维码
     */
    public void print() {
        PrinterJob job = PrinterJob.getPrinterJob();
        job.setPrintable(this);
        // å¼¹å‡ºæ‰“印对话框(可选)
        if (job.printDialog()) {
            try {
                job.print();
            } catch (PrinterException e) {
                System.err.println("打印失败: " + e.getMessage());
            }
        }
    }
    /**
     * å®žçް Printable æŽ¥å£çš„æ‰“印方法
     */
    @Override
    public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) {
        if (pageIndex > 0) {
            return NO_SUCH_PAGE;
        }
        Graphics2D g2d = (Graphics2D) graphics;
        g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
        // è®¡ç®—居中坐标
        double pageWidth = pageFormat.getImageableWidth();
        double pageHeight = pageFormat.getImageableHeight();
        double imgWidth = image.getWidth();
        double imgHeight = image.getHeight();
        double scale = Math.min(pageWidth / imgWidth, pageHeight / imgHeight);
        g2d.scale(scale, scale);
        g2d.drawImage(image, 0, 0, null);
        return PAGE_EXISTS;
    }
    /**
     * ä½¿ç”¨é»˜è®¤æ‰“印机打印,不弹对话框
     */
    public static void noDialogPrint(){
        BufferedImage qrImage = QrCodeUtils.generateQrCode("Silent Print", 300, 300);
        QrCodePrinterUtils printer = new QrCodePrinterUtils(qrImage);
        PrinterJob job = PrinterJob.getPrinterJob();
        job.setPrintable(printer);
        try {
            job.print();
        } catch (PrinterException e) {
            e.printStackTrace();
        }
    }
}
lxzn-module-tms/src/main/java/org/jeecg/modules/tms/utils/QrCodeUtils.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,121 @@
package org.jeecg.modules.tms.utils;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.QRCodeWriter;
import javax.print.*;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Copies;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.print.*;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.util.HashMap;
import java.util.Map;
public class QrCodeUtils {
    /**
     * ç”ŸæˆäºŒç»´ç å›¾ç‰‡
     * @param content äºŒç»´ç å†…容
     * @param width   å›¾ç‰‡å®½åº¦
     * @param height  å›¾ç‰‡é«˜åº¦
     * @return BufferedImage å¯¹è±¡
     */
    public static BufferedImage generateQrCode(String content, int width, int height) {
        try {
            Map<EncodeHintType, Object> hints = new HashMap<>();
            hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
            QRCodeWriter writer = new QRCodeWriter();
            BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, width, height, hints);
            return MatrixToImageWriter.toBufferedImage(bitMatrix);
        } catch (Exception e) {
            throw new RuntimeException("生成二维码失败", e);
        }
    }
    /**
     * æ‰“印二维码
     */
    public static void printBarcode(final BufferedImage image) {
        PrinterJob job = PrinterJob.getPrinterJob();
        // è®¾ç½®æ‰“印页面
        PageFormat pf = job.defaultPage();
        Paper paper = pf.getPaper();
        // è®¾ç½®çº¸å¼ å¤§å°åŒ¹é…æ¡å½¢ç å›¾åƒ
        paper.setSize(image.getWidth(), image.getHeight() + 50);
        paper.setImageableArea(0, 0, image.getWidth(), image.getHeight() + 50);
        pf.setPaper(paper);
        // è®¾ç½®æ‰“印内容
        job.setPrintable(new Printable() {
            @Override
            public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) {
                if (pageIndex > 0) {
                    return NO_SUCH_PAGE;
                }
                Graphics2D g2d = (Graphics2D) graphics;
                g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
                g2d.drawImage(image, 0, 0, null);
                return PAGE_EXISTS;
            }
        }, pf);
        // æ˜¾ç¤ºæ‰“印对话框
        if (job.printDialog()) {
            try {
                job.print();
                JOptionPane.showMessageDialog(null, "打印任务已发送到打印机");
            } catch (PrinterException e) {
                JOptionPane.showMessageDialog(null, "打印失败: " + e.getMessage());
                e.printStackTrace();
            }
        }
    }
    /**
     * é»˜è®¤æ‰“印机打印二维码
     */
    private static void printBarcode2(BufferedImage image) throws Exception {
        // 1. å°†BufferedImage转换为字节数组
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        javax.imageio.ImageIO.write(image, "png", baos);
        byte[] imageData = baos.toByteArray();
        // 2. æŸ¥æ‰¾æ‰“印服务
        PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null);
        if (services.length == 0) {
            throw new Exception("没有找到可用的打印机");
        }
        // 3. é€‰æ‹©é»˜è®¤æ‰“印机(也可以让用户选择)
        PrintService defaultPrinter = PrintServiceLookup.lookupDefaultPrintService();
        if (defaultPrinter == null) {
            defaultPrinter = services[0]; // ä½¿ç”¨ç¬¬ä¸€ä¸ªæ‰¾åˆ°çš„æ‰“印机
        }
        // 4. åˆ›å»ºæ‰“印作业
        DocPrintJob job = defaultPrinter.createPrintJob();
        // 5. è®¾ç½®æ‰“印属性
        PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
        attributes.add(new Copies(1)); // æ‰“印份数
        // 6. åˆ›å»ºæ‰“印文档
        DocFlavor flavor = DocFlavor.INPUT_STREAM.PNG;
        Doc doc = new SimpleDoc(new ByteArrayInputStream(imageData), flavor, null);
        // 7. æ‰§è¡Œæ‰“印
        job.print(doc, attributes);
    }
}