From 3185048d258d7a709af56333c83e641e46c6f989 Mon Sep 17 00:00:00 2001 From: 18516761980 <4761516tqsxp> Date: 星期二, 24 五月 2022 13:04:30 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/service/impl/BasCrnpServiceImpl.java | 67 +++++++++++++++++++++++++++++++++ 1 files changed, 67 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/zy/asrs/service/impl/BasCrnpServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/BasCrnpServiceImpl.java index 9000b84..2354694 100644 --- a/src/main/java/com/zy/asrs/service/impl/BasCrnpServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/BasCrnpServiceImpl.java @@ -4,14 +4,24 @@ import com.core.common.Cools; import com.core.exception.CoolException; import com.zy.asrs.entity.BasCrnp; +import com.zy.asrs.entity.BasDevp; import com.zy.asrs.mapper.BasCrnpMapper; import com.zy.asrs.service.BasCrnpService; +import com.zy.asrs.service.BasDevpService; +import com.zy.asrs.service.WrkMastService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; @Slf4j @Service("basCrnpService") public class BasCrnpServiceImpl extends ServiceImpl<BasCrnpMapper, BasCrnp> implements BasCrnpService { + + @Autowired + private WrkMastService wrkMastService; + @Autowired + private BasDevpService basDevpService; @Override public BasCrnp checkSiteStatus(Integer crnId) { @@ -36,6 +46,63 @@ return false; } if (pakin) { + //TODO鎺у埗鍏ュ簱鏆傚瓨鏁帮紝闃叉涓诲共閬撳牭濉烇紝2022-5-24 ADD + int staNo = 0; + switch (crnNo){ + case 1: + staNo = 123; + break; + case 2: + staNo = 121; + break; + case 3: + staNo = 119; + break; + case 4: + staNo = 117; + break; + case 5: + staNo = 115; + break; + case 6: + staNo = 113; + break; + case 7: + staNo = 111; + break; + case 8: + staNo = 109; + break; + case 9: + staNo = 107; + break; + case 10: + staNo = 105; + break; + case 11: + staNo = 103; + break; + case 12: + staNo = 101; + break; + } + int maxCount = 2; + BasDevp devp = basDevpService.selectById(staNo); + if(!Cools.isEmpty(devp)){ + maxCount = devp.getInQty(); + } + + int storeCount = wrkMastService.getStoreCount(crnNo); +// int maxCount = bufferCount; +// if(crnNo==1){ +// maxCount = 3; +// } + + if(storeCount >= maxCount){ + log.error("{}鍙峰爢鍨涙満鏆傚瓨鏁板凡婊�!", crnNo); + return false; + } + if ("N".equals(crnp.getInEnable())) { log.error("{}鍙峰爢鍨涙満涓嶅彲鍏�", crnNo); return false; -- Gitblit v1.9.1