作者 Your Name

更新

@@ -11,8 +11,8 @@ type SaveEmployeeProductRecordCmd struct { @@ -11,8 +11,8 @@ type SaveEmployeeProductRecordCmd struct {
11 WorkerId int `cname:"工人ID" json:"workerId" valid:"Required"` 11 WorkerId int `cname:"工人ID" json:"workerId" valid:"Required"`
12 //产量重量 12 //产量重量
13 Weigh float64 `cname:"重量" json:"weigh" valid:"Required" ` 13 Weigh float64 `cname:"重量" json:"weigh" valid:"Required" `
14 - //产品编码  
15 - ProductPlanId int `json:"productCode"` 14 + //计划id
  15 + ProductPlanId int `json:"productPlanId"`
16 // 参与类型 1:正常 2:支援 16 // 参与类型 1:正常 2:支援
17 ParticipateType int `json:"participateType"` 17 ParticipateType int `json:"participateType"`
18 //日期 18 //日期
@@ -27,7 +27,7 @@ type ProductCapacitiesInfo struct { @@ -27,7 +27,7 @@ type ProductCapacitiesInfo struct {
27 WorkerId int `json:"workerId" ` //员工 27 WorkerId int `json:"workerId" ` //员工
28 WorkerName string `json:"workerName"` // 28 WorkerName string `json:"workerName"` //
29 Weigh float64 `json:"weigh"` //产量重量 29 Weigh float64 `json:"weigh"` //产量重量
30 - ProductCode string `json:"productCode"` //产品编码 30 + BatchNumber string `json:"batchNumber"` //批次号
31 ProductName string `json:"productName"` //产品名称 31 ProductName string `json:"productName"` //产品名称
32 ParticipateType int `json:"participateType"` //参与类型 1:正常 2:支援 32 ParticipateType int `json:"participateType"` //参与类型 1:正常 2:支援
33 RecordDate string `json:"recordDate"` //日期 33 RecordDate string `json:"recordDate"` //日期
@@ -18,7 +18,7 @@ func init() { @@ -18,7 +18,7 @@ func init() {
18 web.BConfig.AppName = "project" 18 web.BConfig.AppName = "project"
19 web.BConfig.CopyRequestBody = true 19 web.BConfig.CopyRequestBody = true
20 web.BConfig.RunMode = "dev" 20 web.BConfig.RunMode = "dev"
21 - web.BConfig.Listen.HTTPPort = 8080 21 + web.BConfig.Listen.HTTPPort = 8083
22 web.BConfig.Listen.EnableAdmin = false 22 web.BConfig.Listen.EnableAdmin = false
23 web.BConfig.WebConfig.CommentRouterPath = "/pkg/port/beego/routers" 23 web.BConfig.WebConfig.CommentRouterPath = "/pkg/port/beego/routers"
24 if os.Getenv("RUN_MODE") != "" { 24 if os.Getenv("RUN_MODE") != "" {
@@ -31,7 +31,7 @@ func init() { @@ -31,7 +31,7 @@ func init() {
31 } 31 }
32 } 32 }
33 //https支持 33 //https支持
34 - web.BConfig.Listen.EnableHTTPS = true 34 + web.BConfig.Listen.EnableHTTPS = false
35 web.BConfig.Listen.HTTPSPort = 443 35 web.BConfig.Listen.HTTPSPort = 443
36 36
37 //进程内监控 37 //进程内监控
@@ -6,6 +6,7 @@ import ( @@ -6,6 +6,7 @@ import (
6 "path/filepath" 6 "path/filepath"
7 7
8 "github.com/beego/beego/v2/server/web/context" 8 "github.com/beego/beego/v2/server/web/context"
  9 + "github.com/linmadan/egglib-go/core/application"
9 "github.com/linmadan/egglib-go/utils/excel" 10 "github.com/linmadan/egglib-go/utils/excel"
10 "github.com/linmadan/egglib-go/web/beego" 11 "github.com/linmadan/egglib-go/web/beego"
11 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/ecelData/command" 12 "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/application/ecelData/command"
@@ -41,7 +42,8 @@ func (controller *ExcelDataController) FileImport() { @@ -41,7 +42,8 @@ func (controller *ExcelDataController) FileImport() {
41 excelService := service.NewExcelDataService(nil) 42 excelService := service.NewExcelDataService(nil)
42 r, ext, err = controller.GetFileWithExt() 43 r, ext, err = controller.GetFileWithExt()
43 if err != nil { 44 if err != nil {
44 - controller.Response(nil, err) 45 + e := application.ThrowError(application.BUSINESS_ERROR, err.Error())
  46 + controller.Response(nil, e)
45 return 47 return
46 } 48 }
47 cmd := &command.ImportDataCommand{} 49 cmd := &command.ImportDataCommand{}
@@ -63,7 +65,7 @@ func (controller *ExcelDataController) FileImport() { @@ -63,7 +65,7 @@ func (controller *ExcelDataController) FileImport() {
63 case "ImportAttendance": 65 case "ImportAttendance":
64 data, err = excelService.ImportDataAttendance(cmd) 66 data, err = excelService.ImportDataAttendance(cmd)
65 default: 67 default:
66 - err = fmt.Errorf("导入不存在 Code:%v", cmd.Code) 68 + err = application.ThrowError(application.BUSINESS_ERROR, fmt.Sprintf("导入不存在 Code:%v", cmd.Code))
67 } 69 }
68 controller.Response(data, err) 70 controller.Response(data, err)
69 } 71 }