作者 yangfu

fix: 查询修改

@@ -92,18 +92,20 @@ func (cmd *HistoryProductRecordQuery) Valid(validation *validation.Validation) { @@ -92,18 +92,20 @@ func (cmd *HistoryProductRecordQuery) Valid(validation *validation.Validation) {
92 cmd.ProductBeginTime = t 92 cmd.ProductBeginTime = t
93 cmd.ProductEndTime = t.AddDate(0, 0, 1) 93 cmd.ProductEndTime = t.AddDate(0, 0, 1)
94 } 94 }
95 - if cmd.Status == domain.ProductRecordNotApprove {  
96 - cmd.Status = domain.ProductRecordNotApprove  
97 - if xtime.IsZero(cmd.ProductBeginTime) || xtime.BeforeEqual(cmd.ProductBeginTime, xtime.BeginningOfDay()) {  
98 - cmd.ProductBeginTime = xtime.BeginningOfDay()  
99 - }  
100 - } else if cmd.Status == domain.ProductRecordLogged {  
101 - cmd.Status = domain.ProductRecordNotApprove  
102 - if len(cmd.Date) == 0 && xtime.IsZero(cmd.ProductEndTime) {  
103 - cmd.ProductEndTime = xtime.BeginningOfDay()  
104 - }  
105 - if len(cmd.Date) > 0 && !xtime.BeforeEqual(cmd.ProductEndTime, xtime.BeginningOfDay()) {  
106 - cmd.Status = domain.ProductRecordLogged 95 + if cmd.ProductRecordType == domain.RecordTypeReceiveMaterial && cmd.ProductRecordType == domain.RecordTypeReturnMaterial {
  96 + if cmd.Status == domain.ProductRecordNotApprove {
  97 + cmd.Status = domain.ProductRecordNotApprove
  98 + if xtime.IsZero(cmd.ProductBeginTime) || xtime.BeforeEqual(cmd.ProductBeginTime, xtime.BeginningOfDay()) {
  99 + cmd.ProductBeginTime = xtime.BeginningOfDay()
  100 + }
  101 + } else if cmd.Status == domain.ProductRecordLogged {
  102 + cmd.Status = domain.ProductRecordNotApprove
  103 + if len(cmd.Date) == 0 && xtime.IsZero(cmd.ProductEndTime) {
  104 + cmd.ProductEndTime = xtime.BeginningOfDay()
  105 + }
  106 + if len(cmd.Date) > 0 && !xtime.BeforeEqual(cmd.ProductEndTime, xtime.BeginningOfDay()) {
  107 + cmd.Status = domain.ProductRecordLogged
  108 + }
107 } 109 }
108 } 110 }
109 } 111 }