123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package api
- import (
- "kpt.xdmy/apiserver/service"
- "kpt.xdmy/pkg/log"
- )
- var svc *service.Service
- func Init(s *service.Service) {
- svc = s
- }
- func NextService(p []map[string]interface{}) {
- for _, v := range p {
- if v["name"] == nil || v["parammaps"] == nil {
- continue
- }
- pf := v["parammaps"].(map[string]interface{})
- sqlname := v["name"].(string)
- switch sqlname {
- case "updatebigbuydetailenable", "createBuydetailBySG":
- log.Info(v)
- //采购:线下(申购配单)、线上(申购)
- svc.PurchaseOrder(pf)
- case "insertBigPartlaid":
- log.Info(v)
- laidType := pf["laidType"].(float64)
- switch laidType {
- case 0:
- // 入库-申购、采购(申购、线上、寄售)
- svc.LaidProof(pf)
- }
- case "insertBigPartUse":
- log.Info(v)
- useType := pf["useType"].(float64)
- // 领用、手动、报废:0、1、5
- switch useType {
- case 0, 1, 5:
- svc.UseProof(pf)
- }
- case "updatePartRepertoryTHS":
- log.Info(v)
- // 退货
- svc.RefundProof(pf)
- case "insertBigPartquit":
- log.Info(v)
- // 退库
- svc.QuitProof(pf)
- case "updateBigPartTransfer":
- // 调拨
- log.Info(v)
- // svc.ApiTransfer(pf)
- }
- }
- }
|