| | |
| | | import com.ruoyi.common.core.domain.entity.SysConfig; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.sy.domain.ArdSyUser; |
| | | import com.ruoyi.sy.domain.ArdTankLockState; |
| | | import com.ruoyi.sy.mapper.ArdSyUserMapper; |
| | | import com.ruoyi.sy.mapper.ArdTankWallLockMapper; |
| | | import com.ruoyi.sy.mapper.ArdTankWallLockTemporaryMapper; |
| | |
| | | }else{ |
| | | map.put("onlineTime",ardTankLock.getOnlineTime()); |
| | | } |
| | | if(ardTankLock.getArdTankLockState() != null){//电磁锁状态 |
| | | map.put("ardTankLockState",ardTankLock.getArdTankLockState()); |
| | | }else{ |
| | | ArdTankLockState ardTankLockState = new ArdTankLockState(); |
| | | ardTankLockState.setId(""); |
| | | ardTankLockState.setLockId(""); |
| | | ardTankLockState.setLockNum(""); |
| | | ardTankLockState.setLockState(""); |
| | | ardTankLockState.setLockPositionState(""); |
| | | ardTankLockState.setLockShellState(""); |
| | | ardTankLockState.setRestartState(""); |
| | | ardTankLockState.setBatterVoltage(""); |
| | | ardTankLockState.setPowerVoltage(""); |
| | | ardTankLockState.setUploadTime(""); |
| | | ardTankLockState.setUniqueMark(""); |
| | | ardTankLockState.setLockStateMark(false); |
| | | map.put("ardTankLockState",ardTankLockState); |
| | | } |
| | | Map<String,Object> carMap = ((List<Map<String,Object>>)syResult.get("list")).get(0); |
| | | map.put("carPlate",carMap.get("carPlate")); |
| | | result.add(map); |
| | |
| | | } |
| | | //Set<String> newIdSet = new HashSet();//传参的主键 |
| | | List<Map<String,Object>> lockList = (List<Map<String, Object>>) para.get("lockList"); |
| | | if(lockList.isEmpty()){//数组为空,做删除操作 |
| | | if(ardTankLockOldList.isEmpty()){//若没有挂接,不做操作 |
| | | return 1; |
| | | } |
| | | result = ardTankLockMapper.deleteLockByCarId(carId); |
| | | return result; |
| | | } |
| | | |
| | | List<ArdTankLock> ardTankLocks = new ArrayList(); |
| | | for(Map<String,Object> map : lockList){ |
| | | if(map.get("id") != null){//有主键,做修改操作 |
| | |
| | | ardTankLock.setCarId((String) map.get("carId")); |
| | | ardTankLock.setEnable((String) map.get("enable")); |
| | | result = result + ardTankLockMapper.updateArdTankLock(ardTankLock); |
| | | }else{//无主键,做修改操作 |
| | | }else{//无主键,做新增操作 |
| | | ArdTankLock ardTankLock = new ArdTankLock(); |
| | | ardTankLock.setId(IdUtils.simpleUUID()); |
| | | ardTankLock.setLockNum((String) map.get("lockNum")); |
| | |
| | | mapResult.put("total",total); |
| | | return mapResult; |
| | | } |
| | | |
| | | @Override |
| | | public List<ArdTankLock> getArdTankLockAll() { |
| | | List<ArdTankLock> result = ardTankLockMapper.getAll(); |
| | | return result; |
| | | } |
| | | } |