| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by Monkey D. Luffy on 2023.07.25 |
| | |
| | | put(1005, 1007);put(1008, 1010);put(1019, 1021);put(1022, 1024);put(1029, 1031); |
| | | put(2001, 2003);put(2007, 2009);put(2013, 2015);put(2019, 2021);put(2025, 2027); |
| | | put(2003, 2003);put(2009, 2009);put(2015, 2015);put(2021, 2021);put(2027, 2027); |
| | | put(1105,1105);put(1104,1105);put(1043,1042);put(1042,1042); |
| | | put(1105,1105);put(1104,1105);put(1043,1042);put(1042,1042);put(1103,1105);put(1044,1042); |
| | | }}; |
| | | public static final Map<Integer, Integer> siteInMap = new HashMap<Integer, Integer>() {{ |
| | | put(1043, 1042);put(1042, 1042);put(1044, 1042);put(1105, 1105);put(1104, 1105); |
| | |
| | | // }}; |
| | | |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") |
| | | @Scheduled(cron = "0/2 * * * * ? ") |
| | | private void execute(){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String currentTime = sdf.format(new Date()); |
| | | for(Integer staNo : STA_WORK_IN){ |
| | | BasDevp basDevp = basDevpService.selectById(staNo); |
| | | basDevp.setDevNo(siteInMap.get(basDevp.getDevNo())); |
| | |
| | | if(Cools.isEmpty(wrkMast)){ |
| | | continue; |
| | | } |
| | | // boolean wrkTypeSign = fullKM(wrkMast); |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | ReturnT<String> result = wrkMastStaInItHandler.start(wrkMast,basDevp,21);//入库 |
| | | if (result.getCode()==200){ |
| | |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | continue; |
| | | } |
| | | |
| | | // if (wrkMast.getWrkSts()!=2 || wrkMast.getIoType()==10){ |
| | | // continue; |
| | | // } |
| | | // boolean wrkTypeSign = fullKM(wrkMast); |
| | | |
| | | if (!Cools.isEmpty(wrkMast)){ |
| | | // if (wrkTypeSign){ |
| | | ReturnT<String> result = wrkMastStaInItHandler.start(wrkMast,basDevp,22);//出库 |
| | | if (result.getCode()==200) { |
| | | continue; |
| | | } else { |
| | | System.out.println(staNo+"失败3!"); |
| | | System.out.println(staNo+"失败2!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | basDevp.setDevNo(siteOutMap.get(basDevp.getDevNo())); |
| | | if (basDevp.getWrkNo() > 10000 && basDevp.getLoading().equals("Y") && basDevp.getAutoing().equals("Y")){ |
| | | ReturnT<String> result = wrkMastStaInItHandler.start(null,basDevp,23);//异常退出 |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", basDevp.getWrkNo())); |
| | | if (Cools.isEmpty(wrkMast)){ |
| | | continue; |
| | | } |
| | | if (result.getCode()==200) { |
| | | System.out.println(staNo + "时间!" + currentTime); |
| | | continue; |
| | | } else { |
| | | System.out.println(staNo+"失败3!"); |