package test import ( "time" "github.com/k0kubun/pp/v3" "github.com/sirupsen/logrus" "kpt.xdmy/apiserver/model" "kpt.xdmy/apiserver/model/http" "kpt.xdmy/apiserver/service" ) func TestSap() { // sapMaterial() sapSupplier() // sapAsset() // returnGoog() // useOff() // laidOff() // offlist() // transfer() // order() // refundProof() // useProof() // quitProof() // rejectProof() // laidProof() } func sapSupplier() { var t time.Time t = time.Now() var code string // code = "14.01.06.02.000216" s.SapSupplier(t, code) } func sapAsset() { var t time.Time t = time.Now() var code string // code = "14.01.06.02.000216" s.SapAsset(t, code) } func sapMaterial() { var t time.Time // t = time.Now() var code = "14.01.06.02.000216" s.SapMaterial(t, code) } func transfer() { // p := map[string]interface{}{ // "id": 141, // "statue": 1, // "laidCode": "RK02220914010", // } // p := map[string]interface{}{ // "id": 139, // "laidCode": "RK03220914003", // } // "id": 137, // "laidCode": "RK03220914002", // s.SapTransfer(p) } func useOff() { p := &model.ProofReq{ OrderNumber: "CK01220828003", RowsNumber: []int{1}, NumberType: 3, } r := s.ProofOff(p) pp.Print(r) } func proofOff() { m := new(model.ProofReq) m.OrderNumber = "TH00220822003" m.OrderNumber = "RK00220822001" m.OrderNumber = "CK00220822005" m.OrderNumber = "CK00220822002" //tuiku m.NumberType = 2 m.NumberType = 1 m.NumberType = 3 m.NumberType = 4 rpl := service.ProofList(m) r := rpl.Data.(*model.ProofReq) m.ProofCode = r.ProofCode m.ProofYear = r.ProofYear m.ChargeDate = r.ChargeDate m.OrderNumberId = r.OrderNumberId m.RowsNumber = []int{ 1, } rpo := s.ProofOff(m) logrus.Info(rpo) } func material() { m := &http.MaterialDetail{ Code: "14.01.07.01.000003", Type: "XD08", Group: "14010701", Description: "氧气表_YQY-07型", Unit: "个", UnitNum: "1 ", SwitchUnit: "个", SwitchUnitNum: "1 ", Name: "氧气表", Model: "YQY-07型", Dflag: "", ModifyTime: "20220815", } s.UpdatePart(m) } func quitProof() { p := ` { "deptId": 459, "note": "", "pastureId": 31, "quitDate": "2022-08-27", "quitId": 2567, "useForm": "CK01220827008" }` s.QuitProof(p) } func returnGoog() { p := ` { "id":2765 }` s.RefundProof(p) } func rejectProof() { p := ` { "applicatId": 2567, "departmentId": 459, "empId": 2567, "pastureId": 31, "receiveTime": "2022-08-31", "useForm": "CK01220831007", "useType": 5 }` s.UseProof(p) } func useProof() { p := `{ "receiveTime": "2022-09-20", "departmentId": 61, "useForm": "CK02220921002", "useType": 0 }` s.UseProof(p) } func offlist() { p := new(model.ProofReq) p.OrderNumber = "CK01220828005" p.NumberType = 3 service.ProofList(p) } func refundProof() { p := ` { "id": 2761 }` s.RefundProof(p) } func order() { p := ` { "matchCode": "PD02220914003" }` s.PurchaseOrder(p) } func laidProof() { p := `{ "No1Id": "CG05220831001", "empId": 2825, "laidCode": "RK05220831002", "laidType": 0, "pastureId": 115, "providerId": 2980, "purchaseId": "CG05220831001", "storageTime": "2022-08-31" }` s.LaidProof(p) } func laidOff() { p := &model.ProofReq{ OrderNumber: "RK01220831005", RowsNumber: []int{1}, NumberType: 1, } r := s.ProofOff(p) pp.Print(r) }