12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- 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 "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)
- }
- }
- }
|