正在显示
4 个修改的文件
包含
10 行增加
和
1 行删除
@@ -42,10 +42,12 @@ type CreateProductPlanCommand struct { | @@ -42,10 +42,12 @@ type CreateProductPlanCommand struct { | ||
42 | 42 | ||
43 | func (createProductPlanCommand *CreateProductPlanCommand) Valid(validation *validation.Validation) { | 43 | func (createProductPlanCommand *CreateProductPlanCommand) Valid(validation *validation.Validation) { |
44 | //validation.SetError("CustomValid", "未实现的自定义认证") | 44 | //validation.SetError("CustomValid", "未实现的自定义认证") |
45 | + if createProductPlanCommand.WorkOn > 0 { | ||
45 | if err := domain.ValidWorkOn(createProductPlanCommand.WorkOn); err != nil { | 46 | if err := domain.ValidWorkOn(createProductPlanCommand.WorkOn); err != nil { |
46 | validation.Error(err.Error()) | 47 | validation.Error(err.Error()) |
47 | return | 48 | return |
48 | } | 49 | } |
50 | + } | ||
49 | if t, err := time.Parse("2006-01-02", createProductPlanCommand.ProductDate); err != nil { | 51 | if t, err := time.Parse("2006-01-02", createProductPlanCommand.ProductDate); err != nil { |
50 | validation.Error("时间格式有误" + createProductPlanCommand.ProductDate) | 52 | validation.Error("时间格式有误" + createProductPlanCommand.ProductDate) |
51 | return | 53 | return |
@@ -47,10 +47,12 @@ type UpdateProductPlanCommand struct { | @@ -47,10 +47,12 @@ type UpdateProductPlanCommand struct { | ||
47 | } | 47 | } |
48 | 48 | ||
49 | func (updateProductPlanCommand *UpdateProductPlanCommand) Valid(validation *validation.Validation) { | 49 | func (updateProductPlanCommand *UpdateProductPlanCommand) Valid(validation *validation.Validation) { |
50 | + if updateProductPlanCommand.WorkOn > 0 { | ||
50 | if err := domain.ValidWorkOn(updateProductPlanCommand.WorkOn); err != nil { | 51 | if err := domain.ValidWorkOn(updateProductPlanCommand.WorkOn); err != nil { |
51 | validation.Error(err.Error()) | 52 | validation.Error(err.Error()) |
52 | return | 53 | return |
53 | } | 54 | } |
55 | + } | ||
54 | if t, err := time.Parse("2006-01-02", updateProductPlanCommand.ProductDate); err != nil { | 56 | if t, err := time.Parse("2006-01-02", updateProductPlanCommand.ProductDate); err != nil { |
55 | validation.Error("时间格式有误") | 57 | validation.Error("时间格式有误") |
56 | return | 58 | return |
@@ -29,7 +29,7 @@ type SearchProductPlanQuery struct { | @@ -29,7 +29,7 @@ type SearchProductPlanQuery struct { | ||
29 | // 车间名称 | 29 | // 车间名称 |
30 | WorkshopName string `cname:"车间名称" json:"workshopName"` | 30 | WorkshopName string `cname:"车间名称" json:"workshopName"` |
31 | // 车间ID | 31 | // 车间ID |
32 | - WorkshopId string `cname:"车间ID" json:"workshopId"` | 32 | + WorkshopId int `cname:"车间ID" json:"workshopId"` |
33 | } | 33 | } |
34 | 34 | ||
35 | func (cmd *SearchProductPlanQuery) Valid(validation *validation.Validation) { | 35 | func (cmd *SearchProductPlanQuery) Valid(validation *validation.Validation) { |
@@ -4,6 +4,7 @@ import ( | @@ -4,6 +4,7 @@ import ( | ||
4 | "github.com/linmadan/egglib-go/web/beego" | 4 | "github.com/linmadan/egglib-go/web/beego" |
5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain" | 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain" |
6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/domainService" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/domainService" |
7 | + "gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log" | ||
7 | "strings" | 8 | "strings" |
8 | "time" | 9 | "time" |
9 | ) | 10 | ) |
@@ -29,6 +30,10 @@ func (controller *DeviceZKTecoController) PostCdata() { | @@ -29,6 +30,10 @@ func (controller *DeviceZKTecoController) PostCdata() { | ||
29 | //mBytes, _ := json.Marshal(data) | 30 | //mBytes, _ := json.Marshal(data) |
30 | //redis.GetRedis().LPush(domain.TaskDeviceZkTecoReport(), mBytes) | 31 | //redis.GetRedis().LPush(domain.TaskDeviceZkTecoReport(), mBytes) |
31 | domainService.SendDeviceZkTecoReportJob(data) | 32 | domainService.SendDeviceZkTecoReportJob(data) |
33 | + } else { | ||
34 | + data.ActionTime = time.Now() | ||
35 | + domainService.SendDeviceZkTecoReportJob(data) | ||
36 | + log.Logger.Debug(err.Error() + "data:" + bodyList[1]) | ||
32 | } | 37 | } |
33 | } | 38 | } |
34 | controller.Response(data, nil) | 39 | controller.Response(data, nil) |
-
请 注册 或 登录 后发表评论