|  | @ -4,6 +4,7 @@ import com.yihu.jw.base.dao.sms.SmsGatewayDao;
 | 
												
													
														
															|  | import com.yihu.jw.base.model.sms.BaseSmsGateway;
 |  | import com.yihu.jw.base.model.sms.BaseSmsGateway;
 | 
												
													
														
															|  | import com.yihu.jw.mysql.query.BaseJpaService;
 |  | import com.yihu.jw.mysql.query.BaseJpaService;
 | 
												
													
														
															|  | import com.yihu.jw.restmodel.base.BaseContants;
 |  | import com.yihu.jw.restmodel.base.BaseContants;
 | 
												
													
														
															|  | 
 |  | import com.yihu.jw.restmodel.base.sms.BaseSmsContants;
 | 
												
													
														
															|  | import com.yihu.jw.restmodel.common.CommonContants;
 |  | import com.yihu.jw.restmodel.common.CommonContants;
 | 
												
													
														
															|  | import com.yihu.jw.restmodel.exception.ApiException;
 |  | import com.yihu.jw.restmodel.exception.ApiException;
 | 
												
													
														
															|  | import org.springframework.beans.factory.annotation.Autowired;
 |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
												
											
												
													
														
															|  | @ -22,14 +23,14 @@ public class SmsGatewayService extends BaseJpaService<BaseSmsGateway, SmsGateway
 | 
												
													
														
															|  |     @Transactional
 |  |     @Transactional
 | 
												
													
														
															|  |     public BaseSmsGateway createSmsGateway(BaseSmsGateway smsGateway) throws ApiException {
 |  |     public BaseSmsGateway createSmsGateway(BaseSmsGateway smsGateway) throws ApiException {
 | 
												
													
														
															|  |         if (StringUtils.isEmpty(smsGateway.getCode())) {
 |  |         if (StringUtils.isEmpty(smsGateway.getCode())) {
 | 
												
													
														
															|  |             throw new ApiException(BaseContants.SmsGateway.message_fail_code_is_null, CommonContants.common_error_params_code);
 |  | 
 | 
												
													
														
															|  | 
 |  |             throw new ApiException(BaseSmsContants.SmsGateway.message_fail_code_is_null, CommonContants.common_error_params_code);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         if (StringUtils.isEmpty(smsGateway.getName())) {
 |  |         if (StringUtils.isEmpty(smsGateway.getName())) {
 | 
												
													
														
															|  |             throw new ApiException(BaseContants.SmsGateway.message_fail_name_is_null, CommonContants.common_error_params_code);
 |  | 
 | 
												
													
														
															|  | 
 |  |             throw new ApiException(BaseSmsContants.SmsGateway.message_fail_name_is_null, CommonContants.common_error_params_code);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         BaseSmsGateway smsGatewayTmp = smsGatewayDao.findByName(smsGateway.getName());
 |  |         BaseSmsGateway smsGatewayTmp = smsGatewayDao.findByName(smsGateway.getName());
 | 
												
													
														
															|  |         if (smsGatewayTmp != null) {
 |  |         if (smsGatewayTmp != null) {
 | 
												
													
														
															|  |             throw new ApiException(BaseContants.SmsGateway.message_fail_name_exist, CommonContants.common_error_params_code);
 |  | 
 | 
												
													
														
															|  | 
 |  |             throw new ApiException(BaseSmsContants.SmsGateway.message_fail_name_exist, CommonContants.common_error_params_code);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         return smsGatewayDao.save(smsGateway);
 |  |         return smsGatewayDao.save(smsGateway);
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
											
												
													
														
															|  | @ -37,17 +38,17 @@ public class SmsGatewayService extends BaseJpaService<BaseSmsGateway, SmsGateway
 | 
												
													
														
															|  |     @Transactional
 |  |     @Transactional
 | 
												
													
														
															|  |     public BaseSmsGateway updateSmsGateway(BaseSmsGateway smsGateway) {
 |  |     public BaseSmsGateway updateSmsGateway(BaseSmsGateway smsGateway) {
 | 
												
													
														
															|  |         if (StringUtils.isEmpty(smsGateway.getCode())) {
 |  |         if (StringUtils.isEmpty(smsGateway.getCode())) {
 | 
												
													
														
															|  |             throw new ApiException(BaseContants.SmsGateway.message_fail_code_is_null, CommonContants.common_error_params_code);
 |  | 
 | 
												
													
														
															|  | 
 |  |             throw new ApiException(BaseSmsContants.SmsGateway.message_fail_code_is_null, CommonContants.common_error_params_code);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         if (StringUtils.isEmpty(smsGateway.getName())) {
 |  |         if (StringUtils.isEmpty(smsGateway.getName())) {
 | 
												
													
														
															|  |             throw new ApiException(BaseContants.SmsGateway.message_fail_name_is_null, CommonContants.common_error_params_code);
 |  | 
 | 
												
													
														
															|  | 
 |  |             throw new ApiException(BaseSmsContants.SmsGateway.message_fail_name_is_null, CommonContants.common_error_params_code);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         if (StringUtils.isEmpty(smsGateway.getId())) {
 |  |         if (StringUtils.isEmpty(smsGateway.getId())) {
 | 
												
													
														
															|  |             throw new ApiException(BaseContants.SmsGateway.message_fail_id_is_null, CommonContants.common_error_params_code);
 |  | 
 | 
												
													
														
															|  | 
 |  |             throw new ApiException(BaseSmsContants.SmsGateway.message_fail_id_is_null, CommonContants.common_error_params_code);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         BaseSmsGateway smsGatewayTmp = smsGatewayDao.findByNameExcludeCode(smsGateway.getName(), smsGateway.getCode());
 |  |         BaseSmsGateway smsGatewayTmp = smsGatewayDao.findByNameExcludeCode(smsGateway.getName(), smsGateway.getCode());
 | 
												
													
														
															|  |         if (smsGatewayTmp != null) {
 |  |         if (smsGatewayTmp != null) {
 | 
												
													
														
															|  |             throw new ApiException(BaseContants.SmsGateway.message_fail_name_exist, CommonContants.common_error_params_code);
 |  | 
 | 
												
													
														
															|  | 
 |  |             throw new ApiException(BaseSmsContants.SmsGateway.message_fail_name_exist, CommonContants.common_error_params_code);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         return smsGatewayDao.save(smsGateway);
 |  |         return smsGatewayDao.save(smsGateway);
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
											
												
													
														
															|  | @ -55,7 +56,7 @@ public class SmsGatewayService extends BaseJpaService<BaseSmsGateway, SmsGateway
 | 
												
													
														
															|  |     public BaseSmsGateway findByCode(String code) {
 |  |     public BaseSmsGateway findByCode(String code) {
 | 
												
													
														
															|  |         BaseSmsGateway smsGateway = smsGatewayDao.findByCode(code);
 |  |         BaseSmsGateway smsGateway = smsGatewayDao.findByCode(code);
 | 
												
													
														
															|  |         if (smsGateway == null) {
 |  |         if (smsGateway == null) {
 | 
												
													
														
															|  |             throw new ApiException(BaseContants.SmsGateway.message_fail_code_no_exist, CommonContants.common_error_params_code);
 |  | 
 | 
												
													
														
															|  | 
 |  |             throw new ApiException(BaseSmsContants.SmsGateway.message_fail_code_no_exist, CommonContants.common_error_params_code);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         return smsGateway;
 |  |         return smsGateway;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
											
												
													
														
															|  | @ -64,7 +65,7 @@ public class SmsGatewayService extends BaseJpaService<BaseSmsGateway, SmsGateway
 | 
												
													
														
															|  |     public void deleteSmsGateway(String code) {
 |  |     public void deleteSmsGateway(String code) {
 | 
												
													
														
															|  |         BaseSmsGateway smsGateway = smsGatewayDao.findByCode(code);
 |  |         BaseSmsGateway smsGateway = smsGatewayDao.findByCode(code);
 | 
												
													
														
															|  |         if (smsGateway == null) {
 |  |         if (smsGateway == null) {
 | 
												
													
														
															|  |             throw new ApiException(BaseContants.SmsGateway.message_fail_code_no_exist, CommonContants.common_error_params_code);
 |  | 
 | 
												
													
														
															|  | 
 |  |             throw new ApiException(BaseSmsContants.SmsGateway.message_fail_code_no_exist, CommonContants.common_error_params_code);
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         smsGateway.setStatus(-1);
 |  |         smsGateway.setStatus(-1);
 | 
												
													
														
															|  |     }
 |  |     }
 |