|  | @@ -60,7 +60,7 @@ func (s *ruleService) AutoCode(bid int, pid int, codeType string) (string, strin
 | 
	
		
			
				|  |  |  	rule := s.daoRule.FindByPidWithBid(pid, bid)
 | 
	
		
			
				|  |  |  	if codeType == "safeRule" {
 | 
	
		
			
				|  |  |  		if rule.SafeRule == "" {
 | 
	
		
			
				|  |  | -			return "", "", errors.New("该标段未设置编号规则!")
 | 
	
		
			
				|  |  | +			return "", "", errors.New("该标段未设置编号规则")
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		var code viewmodels.RuleCode
 | 
	
		
			
				|  |  |  		err := json.Unmarshal([]byte(rule.SafeRule), &code)
 | 
	
	
		
			
				|  | @@ -71,7 +71,7 @@ func (s *ruleService) AutoCode(bid int, pid int, codeType string) (string, strin
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	} else if codeType == "contractReturnRule" {
 | 
	
		
			
				|  |  |  		if rule.ContractReturnRule == "" {
 | 
	
		
			
				|  |  | -			return "", "", errors.New("该标段未设置编号规则!")
 | 
	
		
			
				|  |  | +			return "", "", errors.New("该标段未设置编号规则")
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		var code viewmodels.RuleCode
 | 
	
		
			
				|  |  |  		err := json.Unmarshal([]byte(rule.ContractReturnRule), &code)
 | 
	
	
		
			
				|  | @@ -83,7 +83,7 @@ func (s *ruleService) AutoCode(bid int, pid int, codeType string) (string, strin
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	} else if codeType == "contractPaidRule" {
 | 
	
		
			
				|  |  |  		if rule.ContractPaidRule == "" {
 | 
	
		
			
				|  |  | -			return "", "", errors.New("该标段未设置编号规则!")
 | 
	
		
			
				|  |  | +			return "", "", errors.New("该标段未设置编号规则")
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		var code viewmodels.RuleCode
 | 
	
		
			
				|  |  |  		err := json.Unmarshal([]byte(rule.ContractPaidRule), &code)
 | 
	
	
		
			
				|  | @@ -94,7 +94,7 @@ func (s *ruleService) AutoCode(bid int, pid int, codeType string) (string, strin
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	} else if codeType == "contractPaidRule" {
 | 
	
		
			
				|  |  |  		if rule.ContractPaidRule == "" {
 | 
	
		
			
				|  |  | -			return "", "", errors.New("该标段未设置编号规则!")
 | 
	
		
			
				|  |  | +			return "", "", errors.New("该标段未设置编号规则")
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		var code viewmodels.RuleCode
 | 
	
		
			
				|  |  |  		err := json.Unmarshal([]byte(rule.ContractPaidRule), &code)
 | 
	
	
		
			
				|  | @@ -105,7 +105,7 @@ func (s *ruleService) AutoCode(bid int, pid int, codeType string) (string, strin
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	} else if codeType == "contractPaidRule" {
 | 
	
		
			
				|  |  |  		if rule.ContractPaidRule == "" {
 | 
	
		
			
				|  |  | -			return "", "", errors.New("该标段未设置编号规则!")
 | 
	
		
			
				|  |  | +			return "", "", errors.New("该标段未设置编号规则")
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		var code viewmodels.RuleCode
 | 
	
		
			
				|  |  |  		err := json.Unmarshal([]byte(rule.ContractPaidRule), &code)
 | 
	
	
		
			
				|  | @@ -115,7 +115,7 @@ func (s *ruleService) AutoCode(bid int, pid int, codeType string) (string, strin
 | 
	
		
			
				|  |  |  		return rule.ContractPaidRule, newCode, err
 | 
	
		
			
				|  |  |  	} else {
 | 
	
		
			
				|  |  |  		if rule.QualityRule == "" {
 | 
	
		
			
				|  |  | -			return "", "", errors.New("该标段未设置编号规则!")
 | 
	
		
			
				|  |  | +			return "", "", errors.New("该标段未设置编号规则")
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		var code viewmodels.RuleCode
 | 
	
		
			
				|  |  |  		err := json.Unmarshal([]byte(rule.QualityRule), &code)
 | 
	
	
		
			
				|  | @@ -124,7 +124,6 @@ func (s *ruleService) AutoCode(bid int, pid int, codeType string) (string, strin
 | 
	
		
			
				|  |  |  		newCode := utils.CreateRuleCode(int64(k), total, len(code.Code))
 | 
	
		
			
				|  |  |  		return rule.QualityRule, newCode, err
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  | -	return "", "", errors.New("生成code失败")
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  func (s *ruleService) ValidRule(ctx iris.Context) (viewmodels.ValidField, error) {
 |