原材料管理
一. 材料库管理
1. ps_material_base表结构
CREATE TABLE `ps_material_base` (
`id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
`name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '库名称',
`stock` bigint(20) UNSIGNED ZEROFILL NULL DEFAULT NULL COMMENT '库存量',
`entry_time` datetime NULL DEFAULT NULL COMMENT '最后一次入库时间',
`checkout_time` datetime NULL DEFAULT NULL COMMENT '最后一次出库时间',
`keeper` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '管理员',
`create_by` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '材料库' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
2. 材料库列表
请求网址:
http://10.168.2.118:8095/prod-api/equip/materials/materialbase/list?pageNum=1&pageSize=10
请求方法:
GET
二. 材料类型列表
1. ps_material_model表结构
CREATE TABLE `ps_material_model` (
`id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '材料类型ID',
`name` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '材料名称',
`model` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格型号',
`unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位',
`code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '材料编码',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`create_by` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
`picture` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '材料图片',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '材料类型表' ROW_FORMAT = Dynamic;
2. 材料类型列表页面
三. 来料登记
1. ps_income_materials
1.1 表结构
CREATE TABLE `ps_income_materials` (
`id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '记录ID',
`base_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仓库Id',
`base_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仓库名称',
`income_date` date NULL DEFAULT NULL COMMENT '日期',
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '油漆名称',
`batch_number` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '批次号',
`unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位',
`quantity` double NULL DEFAULT NULL COMMENT '数量',
`produce_date` date NULL DEFAULT NULL COMMENT '生产日期',
`has_report` int NULL DEFAULT NULL COMMENT '是否有报告\r\n0:无\r\n1:有',
`report_pic` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '报告照片',
`sender` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '发货人',
`receiver` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '收货人',
`guarantee_date` int NULL DEFAULT NULL COMMENT '保质期',
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`create_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
`update_time` datetime NULL DEFAULT NULL COMMENT '修改时间',
`update_by` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '来料管理表' ROW_FORMAT = Dynamic;
1.2 业务逻辑
来料存储在仓库中,所以来料关联了ps_material_base
仓库表
ps_income_materials.base_id=ps_material_base.id
2. 列表页面
四. 材料盘点
1. ps_material_check
1.1 表结构
CREATE TABLE `ps_material_check` (
`id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
`base_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '所属库',
`model_id` varchar(36) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '材料类型',
`quantity` bigint NULL DEFAULT NULL COMMENT '数量',
`unit` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '单位',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '材料盘点表' ROW_FORMAT = Dynamic;
1.2 业务逻辑
记录每个库中的每个材料的数量