From 79bb8bc8a239622fe5aa8758306cca3255f70732 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期四, 19 十月 2023 16:47:32 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/service/impl/StaDescServiceImpl.java | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/StaDescServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/StaDescServiceImpl.java
index 38c9dd1..1b995a3 100644
--- a/src/main/java/com/zy/asrs/service/impl/StaDescServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/StaDescServiceImpl.java
@@ -1,6 +1,10 @@
package com.zy.asrs.service.impl;
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
+import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.core.common.Cools;
+import com.core.exception.CoolException;
import com.zy.asrs.entity.StaDesc;
import com.zy.asrs.mapper.StaDescMapper;
import com.zy.asrs.service.StaDescService;
@@ -15,4 +19,44 @@
public List<Integer> queryOutStaNosByLocNo(String locNo, Integer typeNo) {
return this.baseMapper.queryOutStaNosByLocNo(locNo, typeNo);
}
+
+ @Override
+ public StaDesc queryCrnStn(Integer typeNo, Integer crnNo, Integer stnNo) {
+ Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
+ .eq("type_no", typeNo)
+ .eq("stn_no", stnNo)
+ .eq("crn_no", crnNo);
+ StaDesc staDesc = this.selectOne(wrapper);
+ if (staDesc == null) {
+ throw new CoolException("鍑哄簱璺緞涓嶅瓨鍦�");
+ }
+ return staDesc;
+ }
+
+ @Override
+ public StaDesc queryCrnStnAuto(Integer typeNo, Integer crnNo, Integer stnNo) {
+ Wrapper<StaDesc> wrapper = new EntityWrapper<StaDesc>()
+ .eq("type_no", typeNo)
+ .eq("stn_no", stnNo)
+ .eq("crn_no", crnNo);
+ StaDesc staDesc = this.selectOne(wrapper);
+ if (staDesc == null) {
+ wrapper = new EntityWrapper<StaDesc>()
+ .eq("type_no", typeNo)
+ .eq("crn_no", crnNo);
+ List<StaDesc> staDescs = this.selectList(wrapper);
+ if (Cools.isEmpty(staDescs)) {
+ throw new CoolException("鍑哄簱璺緞涓嶅瓨鍦�");
+ }
+ // todo:luxiaotao
+ return staDescs.get(0);
+ }
+ return staDesc;
+ }
+
+ @Override
+ public StaDesc queryCrnStn(Integer crnNo) {
+ return this.baseMapper.queryCrnStn(crnNo);
+ }
+
}
--
Gitblit v1.9.1