123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- 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)
- }
|