From d65cc4cd967d9c8cbdc8a4dd7c803e952f01098f Mon Sep 17 00:00:00 2001
From: wuzeyu <1223318623@qq.com>
Date: 星期三, 28 八月 2024 14:53:35 +0800
Subject: [PATCH] 修改用户登录接口 优化取水口绑定、解绑控制器接口
---
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java | 5 +++++
pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java | 11 ++++++++++-
pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java | 9 +++++++++
pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml | 4 ++++
pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java | 2 ++
5 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java
index 0721be2..1a4779b 100644
--- a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoBa/BaUserMapper.java
@@ -133,4 +133,9 @@
*/
List<Map<String, Object>> getRoleNamesByUserId(@Param("userId") Long userId);
+ /**
+ * 寰楀埌鎵�鏈夋墜鏈哄彿(鐧诲綍璐﹀彿)
+ * @return
+ */
+ List<String> getPhones();
}
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
index dcb0b69..fa6d313 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaUserMapper.xml
@@ -366,4 +366,8 @@
from ba_user
where id = #{id,jdbcType=BIGINT}
</select>
+
+ <select id="getPhones" resultType="java.lang.String">
+ SELECT phone FROM ba_user WHERE deleted = 0 and disabled = 0
+ </select>
</mapper>
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java
index fe3ca1a..8bc4a6b 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-project/src/main/java/com/dy/pipIrrProject/intakeController/IntakeControllerCtrl.java
@@ -104,6 +104,7 @@
prController.setRtuAddr(prControllerTramp.getRtuAddr());
prController.setProtocol(prControllerTramp.getProtocol());
prController.setFindDt(prControllerTramp.getFindDt());
+ prController.setOrgTag(prControllerTramp.getOrgTag());
prController.setAddWays((byte) 1);
prController.setOperator(operator);
Date operateTime = new Date();
@@ -188,6 +189,7 @@
prControllerTramp.setRtuAddr(ControllerList.getRtuAddr());
prControllerTramp.setProtocol(ControllerList.getProtocol());
prControllerTramp.setFindDt(new Date());
+ prControllerTramp.setOrgTag(ControllerList.getOrgTag());
Integer rec_addControllerTramp = Optional.ofNullable(intakeControllerSv.addTrampController(prControllerTramp)).orElse(0);
if (rec_addControllerTramp == 0) {
return BaseResponseUtils.buildFail(ProjectResultCode.ADD_TRAMP_CONTROLLER_FAIL.getMessage());
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java
index b15cb61..47d2e2f 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoCtrl.java
@@ -102,6 +102,9 @@
if(bindingResult != null && bindingResult.hasErrors()){
return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
}
+ if(vo.phone == null || vo.phone.trim().length() == 0){
+ return BaseResponseUtils.buildFail("鎵嬫満鍙蜂笉鑳戒负绌�");
+ }
if(!vo.phone.equals("admin")){
if(vo.phone.length() != 11){
return BaseResponseUtils.buildFail("鎵嬫満鍙凤紙闀垮害涓嶆槸11浣嶏級涓嶆纭�");
@@ -112,6 +115,12 @@
}
//鎶婄粍缁囧崟浣嶆爣绛句綔涓烘暟鎹簮鍚嶇О
DataSourceContext.set(vo.orgTag);
+
+ //寰楀埌鎵�鏈夌敤鎴疯处鍙�
+ List<String> phones = sv.getPhones();
+ if(!phones.contains(vo.phone)){
+ return BaseResponseUtils.buildFail("璐﹀彿涓嶅瓨鍦�");
+ }
String uuid ;
BaUser userPo ;
@@ -136,7 +145,7 @@
uVo.token = uuid ;
return BaseResponseUtils.buildSuccess(uVo);
}else{
- return BaseResponseUtils.buildFail("鐧诲綍澶辫触");
+ return BaseResponseUtils.buildFail("瀵嗙爜閿欒");
}
}
diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java
index 9dd39b3..fbd0ceb 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-sso/src/main/java/com/dy/sso/busi/SsoSv.java
@@ -10,6 +10,8 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+
@Slf4j
@Service
public class SsoSv {
@@ -67,4 +69,11 @@
return null ;
}
+ /**
+ * 寰楀埌鎵�鏈夌敤鎴锋墜鏈哄彿
+ * @return
+ */
+ public List<String> getPhones(){
+ return baUserMapper.getPhones() ;
+ }
}
--
Gitblit v1.8.0