作者 yangfu

fix:1.考勤修改

... ... @@ -42,9 +42,11 @@ type CreateProductPlanCommand struct {
func (createProductPlanCommand *CreateProductPlanCommand) Valid(validation *validation.Validation) {
//validation.SetError("CustomValid", "未实现的自定义认证")
if err := domain.ValidWorkOn(createProductPlanCommand.WorkOn); err != nil {
validation.Error(err.Error())
return
if createProductPlanCommand.WorkOn > 0 {
if err := domain.ValidWorkOn(createProductPlanCommand.WorkOn); err != nil {
validation.Error(err.Error())
return
}
}
if t, err := time.Parse("2006-01-02", createProductPlanCommand.ProductDate); err != nil {
validation.Error("时间格式有误" + createProductPlanCommand.ProductDate)
... ...
... ... @@ -47,9 +47,11 @@ type UpdateProductPlanCommand struct {
}
func (updateProductPlanCommand *UpdateProductPlanCommand) Valid(validation *validation.Validation) {
if err := domain.ValidWorkOn(updateProductPlanCommand.WorkOn); err != nil {
validation.Error(err.Error())
return
if updateProductPlanCommand.WorkOn > 0 {
if err := domain.ValidWorkOn(updateProductPlanCommand.WorkOn); err != nil {
validation.Error(err.Error())
return
}
}
if t, err := time.Parse("2006-01-02", updateProductPlanCommand.ProductDate); err != nil {
validation.Error("时间格式有误")
... ...
... ... @@ -29,7 +29,7 @@ type SearchProductPlanQuery struct {
// 车间名称
WorkshopName string `cname:"车间名称" json:"workshopName"`
// 车间ID
WorkshopId string `cname:"车间ID" json:"workshopId"`
WorkshopId int `cname:"车间ID" json:"workshopId"`
}
func (cmd *SearchProductPlanQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -4,6 +4,7 @@ import (
"github.com/linmadan/egglib-go/web/beego"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/domain"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/infrastructure/domainService"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-manufacture/pkg/log"
"strings"
"time"
)
... ... @@ -29,6 +30,10 @@ func (controller *DeviceZKTecoController) PostCdata() {
//mBytes, _ := json.Marshal(data)
//redis.GetRedis().LPush(domain.TaskDeviceZkTecoReport(), mBytes)
domainService.SendDeviceZkTecoReportJob(data)
} else {
data.ActionTime = time.Now()
domainService.SendDeviceZkTecoReportJob(data)
log.Logger.Debug(err.Error() + "data:" + bodyList[1])
}
}
controller.Response(data, nil)
... ...