diff --git a/src/main/java/com/xkrs/controller/ForestRangerController.java b/src/main/java/com/xkrs/controller/ForestRangerController.java index 61103f6..945859a 100644 --- a/src/main/java/com/xkrs/controller/ForestRangerController.java +++ b/src/main/java/com/xkrs/controller/ForestRangerController.java @@ -11,7 +11,7 @@ import java.util.Map; * @author xkrs */ @RestController -public class XkRsForestRangerController { +public class ForestRangerController { @Resource private ForestRangerService forestRangerService; diff --git a/src/main/java/com/xkrs/dao/ForestRangerDao.java b/src/main/java/com/xkrs/dao/ForestRangerDao.java index 67c2bdd..174a473 100644 --- a/src/main/java/com/xkrs/dao/ForestRangerDao.java +++ b/src/main/java/com/xkrs/dao/ForestRangerDao.java @@ -11,7 +11,7 @@ import java.util.List; /** * @author xkrs */ -public interface XkRsForestRangerDao extends JpaRepository, JpaSpecificationExecutor { +public interface ForestRangerDao extends JpaRepository, JpaSpecificationExecutor { /** * 根据市区县编码查询护林员的信息 @@ -27,7 +27,7 @@ public interface XkRsForestRangerDao extends JpaRepository, J * @param rangerPhone */ @Modifying(clearAutomatically=true) - @Query(value = "update xk_forest_ranger set ranger_latitude = ?1,ranger_longitude = ?2 where ranger_phone = ?3",nativeQuery = true) + @Query(value = "update forest_ranger set ranger_latitude = ?1,ranger_longitude = ?2 where ranger_phone = ?3",nativeQuery = true) void updateLatAndLonByPhone(String rangerLatitude,String rangerLongitude,String rangerPhone); /** @@ -36,7 +36,7 @@ public interface XkRsForestRangerDao extends JpaRepository, J * @param rangerType */ @Modifying(clearAutomatically=true) - @Query(value = "update xk_forest_ranger set ranger_type = ?2 where ranger_phone = ?1",nativeQuery = true) + @Query(value = "update forest_ranger set ranger_type = ?2 where ranger_phone = ?1",nativeQuery = true) void updateRangerTypeByPhone(String rangerPhone,String rangerType); /** @@ -58,6 +58,6 @@ public interface XkRsForestRangerDao extends JpaRepository, J * @param rangerCountyCode * @return */ - @Query(value = "select * from xk_forest_ranger where ranger_county_code like CONCAT('%',:rangerCountyCode,'%')",nativeQuery = true) + @Query(value = "select * from forest_ranger where ranger_county_code like CONCAT('%',:rangerCountyCode,'%')",nativeQuery = true) List findAllsByRangerCountyCode(String rangerCountyCode); } diff --git a/src/main/java/com/xkrs/service/ForestRangerService.java b/src/main/java/com/xkrs/service/ForestRangerService.java index bd82611..fef04be 100644 --- a/src/main/java/com/xkrs/service/ForestRangerService.java +++ b/src/main/java/com/xkrs/service/ForestRangerService.java @@ -3,7 +3,7 @@ package com.xkrs.service; /** * @author xkrs */ -public interface XkRsForestRangerService { +public interface ForestRangerService { /** * 根据区县编码查询护林员的信息 diff --git a/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java b/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java index 4e7114c..532a1ea 100644 --- a/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/ForestRangerServiceImpl.java @@ -2,9 +2,9 @@ package com.xkrs.service.impl; import com.xkrs.common.encapsulation.PromptMessageEnum; import com.xkrs.common.tool.TokenUtil; -import com.xkrs.dao.XkRsForestRangerDao; +import com.xkrs.dao.ForestRangerDao; import com.xkrs.model.entity.ForestRanger; -import com.xkrs.service.XkRsForestRangerService; +import com.xkrs.service.ForestRangerService; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; @@ -19,10 +19,10 @@ import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulat * @author xkrs */ @Service -public class XkRsForestRangerServiceImpl implements XkRsForestRangerService { +public class ForestRangerServiceImpl implements ForestRangerService { @Resource - private XkRsForestRangerDao xkRsForestRangerDao; + private ForestRangerDao forestRangerDao; /** * 根据曲线编码查询护林员的信息 @@ -33,7 +33,7 @@ public class XkRsForestRangerServiceImpl implements XkRsForestRangerService { public String findByRangerCountyCode(String rangerCountyCode) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); - ForestRanger byRangerCountyCode = xkRsForestRangerDao.findByRangerCountyCode(rangerCountyCode); + ForestRanger byRangerCountyCode = forestRangerDao.findByRangerCountyCode(rangerCountyCode); if(byRangerCountyCode == null){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"该区县暂时还没有相关护林员的信息",locale); } @@ -51,13 +51,13 @@ public class XkRsForestRangerServiceImpl implements XkRsForestRangerService { Locale locale = LocaleContextHolder.getLocale(); String tokenUserName = TokenUtil.getTokenUserName(token); if("370000".equals(countyCode)){ - List all = xkRsForestRangerDao.findAll(); + List all = forestRangerDao.findAll(); if(all == null || all.size() == 0){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没该省护林员的信息",locale); } return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,all,locale); }else { - List allByRangerCountyCode = xkRsForestRangerDao.findAllsByRangerCountyCode(countyCode); + List allByRangerCountyCode = forestRangerDao.findAllsByRangerCountyCode(countyCode); if(allByRangerCountyCode == null || allByRangerCountyCode.size() == 0){ return outputEncapsulationObject(PromptMessageEnum.DATA_NONE,"暂时还没该市护林员的信息",locale); } @@ -77,7 +77,7 @@ public class XkRsForestRangerServiceImpl implements XkRsForestRangerService { public String updateLatAndLonByPhone(String rangerLatitude, String rangerLongitude, String rangerPhone) { // 获取区域信息 Locale locale = LocaleContextHolder.getLocale(); - xkRsForestRangerDao.updateLatAndLonByPhone(rangerLatitude,rangerLongitude,rangerPhone); + forestRangerDao.updateLatAndLonByPhone(rangerLatitude,rangerLongitude,rangerPhone); return outputEncapsulationObject(PromptMessageEnum.SUCCESS,"操作成功",locale); } }