#
yxFwq
2024-10-24 e597fc1db67c560adecbd8d1e37d13c8f5a50fe3
src/main/java/com/zy/asrs/service/impl/MainServiceImpl.java
@@ -59,7 +59,8 @@
//    private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}};
    private static final int[][] execute = new int[][]{{1,4},{2,4},{3,4},{4,4},{5,6},{6,6},{7,4},{8,4},{9,3},{10,4},{11,4}};
    private static final Integer jarMaxLoc = 7;
//    private static final Integer jarMaxLoc1 = 7;
    private static  Integer jarMaxLoc = 0;
    private static final Float jarTemperature = 50F;
    @Autowired
    private CommonService commonService;
@@ -5107,12 +5108,16 @@
                                break;
                            }
                            BasJar basJar = basJarMapper.selectById(jarSlave.getId());
                            jarMaxLoc = basJar.getJarCount();
                            if (jarMaxLoc == 0) {
                                break;
                            }
                            int count = basJarMastService.selectCount(new EntityWrapper<BasJarMast>().eq("jar_regin", basJar.getRegion()).lt("status", 17).gt("status", 11));
                            if (count>0){
                                break;
                            }
                            if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)!=0){
                                if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),3)==7){
                                if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 3).equals(jarMaxLoc)){
                                    JarThread jarOtherThread = (JarThread) SlaveConnection.get(SlaveType.Jar, jarSlave.getJarOtherId());
                                    JarProtocol jarOtherProtocol = jarOtherThread.getJarProtocol();
                                    if (jarOtherProtocol == null) {
@@ -5653,7 +5658,7 @@
            List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
                add(4);
            }});
            if (basJarMastList.size() != jarMaxLoc){
            if (basJarMastList.isEmpty()){
                return false;
            }
@@ -5696,8 +5701,15 @@
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
                    return false;
                }
                if (!basJar.getJarCount().equals(jarMaxLoc)){
                    log.error("{}号硫化罐查询设备库存数异常!!!库存待入数:{}",jarProtocol.getJarNo(),basJar.getJarCount());
                jarMaxLoc = basJar.getJarCount();
                if (jarMaxLoc == 0) {
                    return false;
                }
//                if (!basJar.getJarCount().equals(jarMaxLoc)){
//                    log.error("{}号硫化罐查询设备库存数异常!!!库存待入数:{}",jarProtocol.getJarNo(),basJar.getJarCount());
//                    return false;
//                }
                if (basJarMastList.size() != jarMaxLoc){
                    return false;
                }
@@ -5734,14 +5746,14 @@
            List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
                add(6);
            }});
            if (basJarMastList.size() != jarMaxLoc){
                return false;
            }
//            if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=0
//                    && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=7
//                    && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=14){
//                    && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=jarMaxLoc
//                    && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),5)!=jarMaxLoc*2){
//                return false;
//            }
            if (basJarMastList.isEmpty()){
                return false;
            }
            BasJarMast basJarMastSign = basJarMastList.get(0);
            if (Cools.isEmpty(basJarMastSign)){
@@ -5781,6 +5793,13 @@
                BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
                if (Cools.isEmpty(basJar)){
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
                    return false;
                }
                jarMaxLoc = basJar.getJarCount();
                if (jarMaxLoc == 0) {
                    return false;
                }
                if (basJarMastList.size() != jarMaxLoc){
                    return false;
                }
@@ -5829,12 +5848,6 @@
            List<BasJarMast> basJarMastList10 = basJarMastService.getJarMastByJarIdAndStatusList(jarSlave.getId(), new ArrayList<Integer>() {{
                add(10);
            }});
            if (basJarMastList10.size()==jarMaxLoc){
                return false;
            }
            if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0 && basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=7){
                return false;
            }
            BasJarMast jarMastByJarIdMin = basJarMastService.getJarMastByJarIdMin(jarSlave.getId(),8,8);
            if (Cools.isEmpty(jarMastByJarIdMin)){
@@ -5875,6 +5888,17 @@
                BasJar basJar = basJarMapper.selectById(jarProtocol.getJarNo());
                if (Cools.isEmpty(basJar)){
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
                    return false;
                }
                jarMaxLoc = basJar.getJarCount();
                if (jarMaxLoc == 0) {
                    return false;
                }
                if (basJarMastList10.size()==jarMaxLoc){
                    return false;
                }
                if (basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(),4)!=0 && !basJarMastService.selectJarMastOperation(jarSlave.getJarOtherId(), 4).equals(jarMaxLoc)){
                    return false;
                }
@@ -8371,7 +8395,14 @@
                    continue;
                }
                SteProtocol steProtocol = steThread.getSteProtocol();
                if (steProtocol == null || steProtocol.getChargeStatus()!=0) {
                if (steProtocol == null) {
                    continue;
                }
                if (Cools.isEmpty(steProtocol.getChargeStatus())) {
                    log.error("{}号小车,充电状态信息异常,小车信息:{}",steProtocol.getSteNo(),steProtocol.toString());
                    continue;
                }
                if (steProtocol.getChargeStatus()!=0) {
                    continue;
                }
                WrkMastExecute wrkMastExecuteByCharge = wrkMastExecuteService.getWrkMastExecuteByCharge(steSlave.getId());
@@ -8485,7 +8516,14 @@
                    continue;
                }
                SteProtocol steProtocol = steThread.getSteProtocol();
                if (steProtocol == null || steProtocol.getChargeStatus()!=1) {
                if (steProtocol == null) {
                    continue;
                }
                if (Cools.isEmpty(steProtocol.getChargeStatus())) {
                    log.error("{}号小车,充电状态信息异常,小车信息:{}",steProtocol.getSteNo(),steProtocol.toString());
                    continue;
                }
                if (steProtocol.getChargeStatus()!=1) {
                    continue;
                }
@@ -8646,6 +8684,16 @@
                if (basJarMastList.isEmpty()){
                    continue;
                }
                BasJar basJar = basJarMapper.selectById(jarNo);
                if (Cools.isEmpty(basJar)){
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarNo);
                    continue;
                }
                jarMaxLoc = basJar.getJarCount();
                if (jarMaxLoc == 0) {
                    continue;
                }
                if (basJarMastList.size()>0 && basJarMastList.size()<jarMaxLoc){
                    jarNoList.add(jarNo);
                }
@@ -8708,6 +8756,10 @@
                    log.error("{}号硫化罐查询设备档案无信息!!!",jarProtocol.getJarNo());
                    continue;
                }
                jarMaxLoc = basJar.getJarCount();
                if (jarMaxLoc == 0) {
                    continue;
                }
                List<BasJarMast> basJarMastList = basJarMastService.getJarMastByJarIdAndStatusList(jarNo, new ArrayList<Integer>() {{
                    add(0);
                    add(1);
@@ -8715,13 +8767,16 @@
                    add(3);
                    add(4);
                }});
                DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
                Integer count = basJarMastList.size();
                ArrayList<Integer> wrkNoList = new ArrayList<>();
                for (Integer staNoEnt : staNos){
                    DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, 2);
                    StaProtocol staProtocolEnt = devpThread.getStation().get(staNoEnt);
                    if (staProtocolEnt != null && staProtocolEnt.getWorkNo()!=0 && !wrkNoList.contains(staProtocolEnt.getWorkNo())){
                    if (staProtocolEnt == null || (staProtocolEnt.isLoading() && staProtocolEnt.getWorkNo()==0)){
                        log.error("站点异常,计数加一,站点号:"+staNoEnt);
                        count++;
                    } else if (staProtocolEnt != null && staProtocolEnt.getWorkNo()!=0 && !wrkNoList.contains(staProtocolEnt.getWorkNo())){
                        if (staProtocolEnt.getStaNo().equals(basJar.getEntStaNo$())){
                            count++;
                            wrkNoList.add(staProtocolEnt.getWorkNo());