commit
7b5679f2b8
@ -303,6 +303,7 @@ func ProcessWorkOrder(c *gin.Context) {
|
|||||||
Circulation string `json:"circulation"` // 流转ID
|
Circulation string `json:"circulation"` // 流转ID
|
||||||
FlowProperties int `json:"flow_properties"` // 流转类型 0 拒绝,1 同意,2 其他
|
FlowProperties int `json:"flow_properties"` // 流转类型 0 拒绝,1 同意,2 其他
|
||||||
Remarks string `json:"remarks"` // 处理的备注信息
|
Remarks string `json:"remarks"` // 处理的备注信息
|
||||||
|
Tpls []map[string]interface{} `json:"tpls"` // 表单数据
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -332,6 +333,7 @@ func ProcessWorkOrder(c *gin.Context) {
|
|||||||
params.Circulation, // 流转标题
|
params.Circulation, // 流转标题
|
||||||
params.FlowProperties, // 流转属性
|
params.FlowProperties, // 流转属性
|
||||||
params.Remarks, // 备注信息
|
params.Remarks, // 备注信息
|
||||||
|
params.Tpls, // 工单数据更新
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
app.Error(c, -1, nil, fmt.Sprintf("处理工单失败,%v", err.Error()))
|
app.Error(c, -1, nil, fmt.Sprintf("处理工单失败,%v", err.Error()))
|
||||||
|
@ -325,6 +325,7 @@ func (h *Handle) HandleWorkOrder(
|
|||||||
circulationValue string,
|
circulationValue string,
|
||||||
flowProperties int,
|
flowProperties int,
|
||||||
remarks string,
|
remarks string,
|
||||||
|
tpls []map[string]interface{},
|
||||||
) (err error) {
|
) (err error) {
|
||||||
h.workOrderId = workOrderId
|
h.workOrderId = workOrderId
|
||||||
h.flowProperties = flowProperties
|
h.flowProperties = flowProperties
|
||||||
@ -626,6 +627,21 @@ func (h *Handle) HandleWorkOrder(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新表单数据
|
||||||
|
for _, t := range tpls {
|
||||||
|
var tplValue []byte
|
||||||
|
tplValue, err = json.Marshal(t["tplValue"])
|
||||||
|
if err != nil {
|
||||||
|
h.tx.Rollback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = h.tx.Model(&process.TplData{}).Where("id = ?", t["tplDataId"]).Update("form_data", tplValue).Error
|
||||||
|
if err != nil {
|
||||||
|
h.tx.Rollback()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 流转历史写入
|
// 流转历史写入
|
||||||
err = orm.Eloquent.Model(&cirHistoryValue).
|
err = orm.Eloquent.Model(&cirHistoryValue).
|
||||||
Where("work_order = ?", workOrderId).
|
Where("work_order = ?", workOrderId).
|
||||||
@ -663,7 +679,6 @@ func (h *Handle) HandleWorkOrder(
|
|||||||
CostDuration: costDurationValue,
|
CostDuration: costDurationValue,
|
||||||
Remarks: remarks,
|
Remarks: remarks,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = h.tx.Create(&cirHistoryData).Error
|
err = h.tx.Create(&cirHistoryData).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
h.tx.Rollback()
|
h.tx.Rollback()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user