|  | @@ -21,6 +21,7 @@ type WorkOrder struct {
 | 
											
												
													
														|  |  	ExecPersonNames       string                                `json:"execPersonsNames"`
 |  |  	ExecPersonNames       string                                `json:"execPersonsNames"`
 | 
											
												
													
														|  |  	ExecDepartmental      string                                `json:"execDepartmental"`
 |  |  	ExecDepartmental      string                                `json:"execDepartmental"`
 | 
											
												
													
														|  |  	ExecDepartmentalNames string                                `json:"execDepartmentalNames"`
 |  |  	ExecDepartmentalNames string                                `json:"execDepartmentalNames"`
 | 
											
												
													
														|  | 
 |  | +	WeekMonthValue        string                                `json:"WeekMonthValue"`
 | 
											
												
													
														|  |  	IsShow                pasturePb.IsShow_Kind                 `json:"isShow"`
 |  |  	IsShow                pasturePb.IsShow_Kind                 `json:"isShow"`
 | 
											
												
													
														|  |  	Photos                string                                `json:"photos"`
 |  |  	Photos                string                                `json:"photos"`
 | 
											
												
													
														|  |  	Remarks               string                                `json:"remarks"`
 |  |  	Remarks               string                                `json:"remarks"`
 | 
											
										
											
												
													
														|  | @@ -61,6 +62,10 @@ func NewWorkOrder(
 | 
											
												
													
														|  |  			execDeptNames = append(execDeptNames, d.Name)
 |  |  			execDeptNames = append(execDeptNames, d.Name)
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  |  	}
 |  |  	}
 | 
											
												
													
														|  | 
 |  | +	weekMonthValue := ""
 | 
											
												
													
														|  | 
 |  | +	if req.Frequency == pasturePb.WorkOrderFrequency_Weekly || req.Frequency == pasturePb.WorkOrderFrequency_Monthly {
 | 
											
												
													
														|  | 
 |  | +		weekMonthValue = util.Int32SliceToString(req.WeekMonthValue, ",")
 | 
											
												
													
														|  | 
 |  | +	}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	return &WorkOrder{
 |  |  	return &WorkOrder{
 | 
											
												
													
														|  |  		Name:                  req.Name,
 |  |  		Name:                  req.Name,
 | 
											
										
											
												
													
														|  | @@ -73,6 +78,7 @@ func NewWorkOrder(
 | 
											
												
													
														|  |  		ExecPersonNames:       strings.Join(execPersonNames, ","),
 |  |  		ExecPersonNames:       strings.Join(execPersonNames, ","),
 | 
											
												
													
														|  |  		ExecDepartmental:      util.Int32SliceToString(req.ExecDepartmental, ","),
 |  |  		ExecDepartmental:      util.Int32SliceToString(req.ExecDepartmental, ","),
 | 
											
												
													
														|  |  		ExecDepartmentalNames: strings.Join(execDeptNames, ","),
 |  |  		ExecDepartmentalNames: strings.Join(execDeptNames, ","),
 | 
											
												
													
														|  | 
 |  | +		WeekMonthValue:        weekMonthValue,
 | 
											
												
													
														|  |  		IsShow:                req.IsShow,
 |  |  		IsShow:                req.IsShow,
 | 
											
												
													
														|  |  		Photos:                strings.Join(req.Photos, ","),
 |  |  		Photos:                strings.Join(req.Photos, ","),
 | 
											
												
													
														|  |  		Frequency:             req.Frequency,
 |  |  		Frequency:             req.Frequency,
 | 
											
										
											
												
													
														|  | @@ -88,10 +94,13 @@ func (w WorkOrderSlice) ToPB(
 | 
											
												
													
														|  |  	priorityMap map[pasturePb.Priority_Kind]string,
 |  |  	priorityMap map[pasturePb.Priority_Kind]string,
 | 
											
												
													
														|  |  	frequencyMap map[pasturePb.WorkOrderFrequency_Kind]string,
 |  |  	frequencyMap map[pasturePb.WorkOrderFrequency_Kind]string,
 | 
											
												
													
														|  |  	subscribeUnitMap map[pasturePb.WorkOrderSubscribeUnit_Kind]string,
 |  |  	subscribeUnitMap map[pasturePb.WorkOrderSubscribeUnit_Kind]string,
 | 
											
												
													
														|  | 
 |  | +	weekMap map[pasturePb.Week_Kind]string,
 | 
											
												
													
														|  | 
 |  | +	monthMap map[int32]string,
 | 
											
												
													
														|  |  ) []*pasturePb.WorkOrderList {
 |  |  ) []*pasturePb.WorkOrderList {
 | 
											
												
													
														|  |  	res := make([]*pasturePb.WorkOrderList, len(w))
 |  |  	res := make([]*pasturePb.WorkOrderList, len(w))
 | 
											
												
													
														|  |  	for i, v := range w {
 |  |  	for i, v := range w {
 | 
											
												
													
														|  | -		execPersons, execDepartmental := make([]int32, 0), make([]int32, 0)
 |  | 
 | 
											
												
													
														|  | 
 |  | +		execPersons, execDepartmental, weekMonthValue := make([]int32, 0), make([]int32, 0), make([]int32, 0)
 | 
											
												
													
														|  | 
 |  | +		weekMonthValueName := make([]string, 0)
 | 
											
												
													
														|  |  		if len(v.ExecPersons) > 0 {
 |  |  		if len(v.ExecPersons) > 0 {
 | 
											
												
													
														|  |  			for _, personId := range strings.Split(v.ExecPersons, ",") {
 |  |  			for _, personId := range strings.Split(v.ExecPersons, ",") {
 | 
											
												
													
														|  |  				p, _ := strconv.Atoi(personId)
 |  |  				p, _ := strconv.Atoi(personId)
 | 
											
										
											
												
													
														|  | @@ -106,6 +115,19 @@ func (w WorkOrderSlice) ToPB(
 | 
											
												
													
														|  |  			}
 |  |  			}
 | 
											
												
													
														|  |  		}
 |  |  		}
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +		if len(v.WeekMonthValue) > 0 {
 | 
											
												
													
														|  | 
 |  | +			for _, week := range strings.Split(v.WeekMonthValue, ",") {
 | 
											
												
													
														|  | 
 |  | +				k, _ := strconv.Atoi(week)
 | 
											
												
													
														|  | 
 |  | +				if v.Frequency == pasturePb.WorkOrderFrequency_Weekly {
 | 
											
												
													
														|  | 
 |  | +					weekMonthValueName = append(weekMonthValueName, weekMap[pasturePb.Week_Kind(k)])
 | 
											
												
													
														|  | 
 |  | +				}
 | 
											
												
													
														|  | 
 |  | +				if v.Frequency == pasturePb.WorkOrderFrequency_Monthly {
 | 
											
												
													
														|  | 
 |  | +					weekMonthValueName = append(weekMonthValueName, monthMap[int32(k)])
 | 
											
												
													
														|  | 
 |  | +				}
 | 
											
												
													
														|  | 
 |  | +				weekMonthValue = append(weekMonthValue, int32(k))
 | 
											
												
													
														|  | 
 |  | +			}
 | 
											
												
													
														|  | 
 |  | +		}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  		res[i] = &pasturePb.WorkOrderList{
 |  |  		res[i] = &pasturePb.WorkOrderList{
 | 
											
												
													
														|  |  			Id:                    int32(v.Id),
 |  |  			Id:                    int32(v.Id),
 | 
											
												
													
														|  |  			Name:                  v.Name,
 |  |  			Name:                  v.Name,
 | 
											
										
											
												
													
														|  | @@ -124,6 +146,8 @@ func (w WorkOrderSlice) ToPB(
 | 
											
												
													
														|  |  			ExecDepartmentalNames: strings.Split(v.ExecDepartmental, ","),
 |  |  			ExecDepartmentalNames: strings.Split(v.ExecDepartmental, ","),
 | 
											
												
													
														|  |  			IsShow:                v.IsShow,
 |  |  			IsShow:                v.IsShow,
 | 
											
												
													
														|  |  			Photos:                strings.Split(v.Photos, ","),
 |  |  			Photos:                strings.Split(v.Photos, ","),
 | 
											
												
													
														|  | 
 |  | +			WeekMonthValue:        weekMonthValue,
 | 
											
												
													
														|  | 
 |  | +			WeekMonthValueName:    weekMonthValueName,
 | 
											
												
													
														|  |  			Remarks:               v.Remarks,
 |  |  			Remarks:               v.Remarks,
 | 
											
												
													
														|  |  			OperatorId:            int32(v.OperationId),
 |  |  			OperatorId:            int32(v.OperationId),
 | 
											
												
													
														|  |  			OperatorName:          v.OperationName,
 |  |  			OperatorName:          v.OperationName,
 |