# 生产报工

本文档将详细列举当前系统支持生产报工相关的 webhook

# 新建报工

curl 示例请求:

curl --request POST \
  --url 'http://${yourhost}/${yourpath}?businessType=CREATE_JOB_BOOKING' \
  --header 'content-type: application/json' \
  --data '{"requestId":"24852d91-5c43-4f67-99c5-e6e441337749","businessType":1001,"data":{"id":10021,"workOrderCode":"WO-20210111-001","workOrderProcedureCode":"P-1001","workOrderProcedureName":"开料","jobBookingTime":1603780324060,"machineCode":"M-1293","timeSpan":0,"itemCode":"IRON-01012","workOrderProductType":1,"lotCode":"WO-20210111-001-1001","quantity":199.98,"comment":"暂无","assignees":[{"code":"EM-017","name":"张三","type":1}],"operatorCode":"EM-001"}}'

请求报文说明

{
	"requestId": "24852d91-5c43-4f67-99c5-e6e441337749",//请求ID,供日后 DEBUG 用,暂无业务意义
	"businessType": 1001,//业务类型,参考[webhook](/webhook/)定义
	"data": {
		"id": 10021,
		"workOrderCode": "WO-20210111-001", //生产单号
		"workOrderProcedureCode": "P-1001", //报工工序编码
		"workOrderProcedureName": "开料", // 报工工序名称
		"jobBookingTime": 1603780324060, // 报工操作时间
		"machineCode": "M-1293", //报工设备号码
		"timeSpan": 0, //工序用时
		"itemCode": "IRON-01012", //物料编码
		"workOrderProductType": 1, //报工类型 1 普通报工,2 副产品报工
		"lotCode": "WO-20210111-001-1001", //生产批量码
		"quantity": 199.98, // 报工数量(合格品)
		"comment": "暂无", // 备注
		"assignees": [{ // 工序操作人
			"code": "EM-017", // 人员编码
			"name": "张三", // 名称
			"type": 1 // 类型, 1 人员,2 小组
		}],
		"operatorCode": "EM-001" // 报工人编码
	}
}

# 删除报工

curl 示例请求:

curl --request POST \
  --url 'http://${yourhost}/${yourpath}?businessType=DELETE_JOB_BOOKING' \
  --header 'content-type: application/json' \
  --data '{"requestId":"24852d91-5c43-4f67-99c5-e6e441337749","businessType":1002,"data":10021}'

请求报文说明

{
	"requestId": "24852d91-5c43-4f67-99c5-e6e441337749",//请求ID,供日后 DEBUG 用,暂无业务意义
	"businessType": 1002,//业务类型,参考[webhook](/webhook/)定义
	"data": 10021
}