/**
* 新增送样管理
*/
@PreAuthorize("@ss.hasPermi('sampling:notice:add')")
@Log(title = "送样管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody SamplingNotice samplingNotice)
{
String samplingId = "SY" + DateUtils.parseDateToStr("yyyyMMdd", new Date()) + String.format("%04d", new Random().nextInt(9999));
String samplingStage = samplingNotice.getSamplingStage();
samplingNotice.setSamplingId(samplingId);
// 发布状态 0
samplingNotice.setPublishingStatus("0");
// 送样结果 0
samplingNotice.setSamplingStage("0");
// 反馈状态 0
samplingNotice.setFeedbackStatus("0");
return toAjax(samplingNoticeService.insertSamplingNotice(samplingNotice));
}
DROP TABLE IF EXISTS t_sampling_detail
;
CREATE TABLE t_sampling_detail
(
sampling_id
VARCHAR(64) NOT NULL COMMENT ‘送样单编号’,
mat_id
VARCHAR(64) NOT NULL COMMENT ‘物料编号’,
qual_num
INT DEFAULT NULL COMMENT ‘合格数量’,
unqual_num
INT DEFAULT NULL COMMENT ‘不合格数量’,
req_num
INT DEFAULT NULL COMMENT ‘要求数量’,
fb_num
INT DEFAULT NULL COMMENT ‘反馈数量’,
req_date
DATETIME DEFAULT NULL COMMENT ‘要求日期’,
fb_date
DATETIME DEFAULT NULL COMMENT ‘反馈日期’,
sampling_result
VARCHAR(64) DEFAULT NULL COMMENT ‘送样结果(0未维护 1不合格 2合格 3与图纸不符但可用)’,
remark
VARCHAR(4000) DEFAULT NULL COMMENT ‘备注’,
create_time
DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT ‘创建时间’,
create_by
VARCHAR(64) DEFAULT NULL COMMENT ‘创建人’,
update_time
DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT ‘更新时间’,
update_by
VARCHAR(64) DEFAULT NULL COMMENT ‘更新人’,
PRIMARY KEY (sampling_id
,mat_id
),
KEY FK_Reference_10
(mat_id
),
CONSTRAINT FK_Reference_10
FOREIGN KEY (mat_id
) REFERENCES t_material_info
(mat_id
),
CONSTRAINT FK_Reference_9
FOREIGN KEY (sampling_id
) REFERENCES t_sampling_info
(sampling_id
)
)ENGINE=INNODB DEFAULT CHARSET=utf8;