From 1c07a698ad858a61db69a81467597a1fbb0702eb Mon Sep 17 00:00:00 2001 From: "DESKTOP-4U0TDEF\\20371" <2037158277@qq.com> Date: Fri, 16 Jul 2021 09:20:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8A=A4=E6=9E=97=E5=91=98=E4=BF=A1=E6=81=AF=E5=92=8C=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=89=8B=E6=9C=BA=E5=8F=B7=E4=BF=AE=E6=94=B9=E6=8A=A4?= =?UTF-8?q?=E6=9E=97=E5=91=98=E4=BD=8D=E7=BD=AE=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/controller/ForestRangerController.java | 2 +- src/main/java/com/xkrs/dao/ForestRangerDao.java | 8 ++++---- .../com/xkrs/service/ForestRangerService.java | 2 +- .../service/impl/ForestRangerServiceImpl.java | 16 ++++++++-------- 4 files changed, 14 insertions(+), 14 deletions(-) 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); } }