liujiandao
2024-03-28 778fd95e00e9a68b0e0e67c5d7d07d94ba365dd4
修改crm状态
2个文件已修改
16 ■■■■■ 已修改文件
controllers/operation.go 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/operation.go 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation.go
@@ -716,8 +716,12 @@
func UpdatePurchaseStatus(source, number string) {
    if source == "SRM_PURCHASE" {
        count, err := models.NewOperationSearch().SetSourceNumber(number).SetStatus(constvar.OperationStatus_Ready).Count()
        if err != nil || count > 0 {
            return
        }
        cl := purchase_wms.NewPurchaseServiceClient(init_client.SrmConn)
        _, err := cl.UpdatePurchaseStatus(context.Background(), &purchase_wms.UpdatePurchaseStatusRequest{Number: number})
        _, err = cl.UpdatePurchaseStatus(context.Background(), &purchase_wms.UpdatePurchaseStatusRequest{Number: number})
        if err != nil {
            logx.Errorf("grpc dial UpdatePurchaseStatus service error: %v", err)
        }
models/operation.go
@@ -364,3 +364,13 @@
    }
    return int(total), nil
}
func (slf *OperationSearch) Count() (int64, error) {
    var (
        total int64
        db    = slf.build()
    )
    err := db.Count(&total).Error
    return total, err
}