| | |
| | | thread.start(); |
| | | } |
| | | }; |
| | | lockStateTimer.scheduleAtFixedRate(lockStateTask,date,3000); |
| | | //lockStateTimer.scheduleAtFixedRate(lockStateTask,date,3000); |
| | | lockStateTimer.scheduleAtFixedRate(lockStateTask,date,5000); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Timer lockCheckTimeTimer = new Timer();//定时校准时间 |
| | |
| | | } |
| | | } |
| | | }; |
| | | sendTimer.scheduleAtFixedRate(sendLockStateTask,date,3000); |
| | | //sendTimer.scheduleAtFixedRate(sendLockStateTask,date,3000); |
| | | |
| | | |
| | | } |
| | |
| | | public long getCountByCarIdList(@Param("carIdList") List<String> carIdList); |
| | | |
| | | public List<ArdSyCar> getCarListByDeptIdList(@Param("deptIdList") List<Long> deptIdList); |
| | | |
| | | public List<ArdSyCar> selectArdSyCarAndTankLockByUserId(String userId); |
| | | } |
| | |
| | | public int deleteArdTankLockStateByIds(String[] ids); |
| | | |
| | | public int insertOrUpdateArdTankLockState(ArdTankLockState ardTankLockState); |
| | | |
| | | public ArdTankLockState selectArdTankLockStateByLockIdLimitOne(String lockId); |
| | | } |
| | |
| | | |
| | | String paramsStr = lockNum + "02" + process + checkNum; |
| | | paramsStr = "%7B%22type%22%3A%22ff%22%2C%22dataCnt%22%3A%22" + paramsStr + "%22%7D"; |
| | | System.out.println(paramsStr); |
| | | Map<String,Object> result = sendCmd(syURL, ardSyUser.getUserId(), carId, 199, "DataDownTransfer", paramsStr, sessionId); |
| | | System.out.println("111111111111"); |
| | | System.out.println(result); |
| | | if(((String)result.get("rspCode")).equals("0")){ |
| | | /*ArdTankLockProcessLog ardTankLockProcessLog = new ArdTankLockProcessLog(); |
| | | ArdTankLockProcessLog ardTankLockProcessLog = new ArdTankLockProcessLog(); |
| | | ardTankLockProcessLog.setId(IdUtils.simpleUUID()); |
| | | ardTankLockProcessLog.setLockId(lockId); |
| | | ardTankLockProcessLog.setLockNum(lockNum); |
| | |
| | | ardTankLockProcessLog.setLongitude(lng); |
| | | ardTankLockProcessLog.setLatitude(lat); |
| | | ardTankLockProcessLog.setProcessTime(this.sdf.format(new Date())); |
| | | ardTankLockProcessLogMapper.insertArdTankLockProcessLog(ardTankLockProcessLog);*/ |
| | | ardTankLockProcessLogMapper.insertArdTankLockProcessLog(ardTankLockProcessLog); |
| | | return "发送成功"; |
| | | }else{ |
| | | return "发送失败"; |
| | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.ruoyi.common.core.domain.entity.SysConfig; |
| | | import com.ruoyi.common.utils.uuid.IdUtils; |
| | | import com.ruoyi.sy.domain.ArdSyCar; |
| | | 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; |
| | | import com.ruoyi.sy.mapper.*; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.utils.forest.SYClient; |
| | | import org.apache.commons.codec.digest.DigestUtils; |
| | |
| | | |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.ruoyi.sy.mapper.ArdTankLockMapper; |
| | | import com.ruoyi.sy.domain.ArdTankLock; |
| | | import com.ruoyi.sy.service.IArdTankLockService; |
| | | |
| | |
| | | |
| | | @Resource |
| | | private SysConfigMapper sysConfigMapper; |
| | | |
| | | @Resource |
| | | private ArdSyCarMapper ardSyCarMapper; |
| | | |
| | | @Resource |
| | | private ArdTankLockStateMapper ardTankLockStateMapper; |
| | | |
| | | @Resource |
| | | private SYClient sYClient; |
| | |
| | | |
| | | @Override |
| | | public void sendLockState(String userId, String syUserId, String syPassword) { |
| | | |
| | | |
| | | |
| | | /*List<SysConfig> syURLResult = sysConfigMapper.selectByType("syCarPT"); |
| | | String syURL = ""; |
| | | if(syURLResult.size() != 0){ |
| | |
| | | String passwordMd5 = DigestUtils.md5Hex(syPassword); |
| | | Map<String, Object> LogInResult = sYClient.logIn(syURL, passwordMd5, syUserId); |
| | | String sessionId = (String) LogInResult.get("sessionId"); |
| | | List<ArdTankLock> ardTankLockList = ardTankLockMapper.getLockByCarId(carId); |
| | | Map<String,Object> syResult = sYClient.getCarNearPositionByCarId(syURL, carId, ardSyUser.getUserId(), sessionId);*/ |
| | | Map<String,Object> syResult = sYClient.getCarNearPositionByCarId(syURL, carId, syUserId, sessionId); |
| | | |
| | | List<Map<String,Object>> result = new ArrayList(); |
| | | List<ArdSyCar> ardSyCarResult = ardSyCarMapper.selectArdSyCarAndTankLockByUserId(userId); |
| | | for(ArdSyCar ardSyCar : ardSyCarResult){ |
| | | Map<String,Object> map = new HashMap(); |
| | | map.put("id",ardSyCar.getId()); |
| | | map.put("carId",ardSyCar.getCarId()); |
| | | map.put("carModel",ardSyCar.getCarModel()); |
| | | map.put("carType",ardSyCar.getCarType()); |
| | | map.put("carBrand",ardSyCar.getCarBrand()); |
| | | map.put("deptId",ardSyCar.getDeptId()); |
| | | |
| | | |
| | | |
| | | |
| | | List<ArdTankLock> ardTankLockList = ardSyCar.getArdTankLockList(); |
| | | for(ArdTankLock ardTankLock : ardTankLockList){ |
| | | ArdTankLockState ardTankLockStateResult = ardTankLockStateMapper.selectArdTankLockStateByLockIdLimitOne(ardTankLock.getId()); |
| | | } |
| | | }*/ |
| | | } |
| | | } |
| | |
| | | #{deptId} |
| | | </foreach> |
| | | </select> |
| | | <select id="selectArdSyCarAndTankLockByUserId" resultMap="ArdSyCarLockResult"> |
| | | select "asc".id,"asc".car_id,"asc".car_model,"asc".car_type, |
| | | "asc".car_brand,"asc".dept_id,"asc".car_picture,atl.id as lid, |
| | | atl.lock_num,atl.lock_name,atl.img_position_top,atl.img_position_left, |
| | | atl.car_id as lcar_id,atl.enable,coalesce(atl.restart_state,'') as restart_state, |
| | | coalesce(atl.online_time,'') as online_time |
| | | from ard_sy_car "asc" |
| | | inner join ard_tank_lock atl on "asc".car_id = atl.car_id |
| | | where "asc".dept_id in ( |
| | | with recursive rsd as ( |
| | | select sd.dept_id from sys_dept sd where sd.dept_id = |
| | | (select dept_id from sys_user su where su.user_id = #{userId}) |
| | | union |
| | | select csd.dept_id from sys_dept csd inner join rsd on rsd.dept_id = csd.parent_id |
| | | ) |
| | | select dept_id from rsd) order by "asc".car_id desc,atl.lock_num |
| | | </select> |
| | | </mapper> |
| | |
| | | case atls.lock_state |
| | | when '关锁状态' then false |
| | | when '异常状态' then false |
| | | when '动作状态' then false |
| | | when '开锁状态' then true |
| | | end as lock_state_mark |
| | | from ard_tank_lock atl |
| | |
| | | #{uniqueMark,jdbcType=VARCHAR}) |
| | | on conflict(unique_mark) do update set upload_time=#{uploadTime,jdbcType=VARCHAR} |
| | | </insert> |
| | | |
| | | <select id="selectArdTankLockStateByLockIdLimitOne" parameterType="java.lang.String" resultMap="ArdTankLockStateResult"> |
| | | select atls.id,atls.lock_id,atls.lock_num as slock_num, |
| | | atls.lock_state,atls.lock_position_state,atls.lock_shell_state, |
| | | atls.restart_state as srestart_state,atls.batter_voltage, |
| | | atls.power_voltage,atls.upload_time,atls.unique_mark, |
| | | case atls.lock_state |
| | | when '关锁状态' then false |
| | | when '异常状态' then false |
| | | when '动作状态' then false |
| | | when '开锁状态' then true |
| | | end as lock_state_mark |
| | | from ard_tank_lock_state atls |
| | | where atls.lock_id = #{lockId} order by atls.upload_time desc |
| | | limit 1 |
| | | </select> |
| | | </mapper> |