| | |
| | | import com.boying.entity.led.ResultData; |
| | | import com.boying.service.*; |
| | | import com.boying.util.DateUtilOther; |
| | | import com.boying.util.StringUtil; |
| | | import com.google.gson.JsonObject; |
| | | import com.google.gson.JsonParser; |
| | | |
| | | import com.sun.media.jfxmedia.track.Track; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | import javax.servlet.http.HttpServlet; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.sound.sampled.AudioFormat; |
| | | import java.io.*; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | |
| | | private final TicketService ticketService; |
| | | private final CostRuleService costRuleService; |
| | | private final WhiteListService whiteListService; |
| | | private final String LEDURL = "http://localhost:9988/LedShow/IGetResultDataAllLine"; |
| | | private final String LEDURL = "http://192.168.31.212:9988/LedShow/IGetResultDataAllLine"; |
| | | |
| | | /** |
| | | * 回复开闸 |
| | |
| | | .execute() |
| | | .body(); |
| | | ResultData resultData = JSON.parseObject(s1,ResultData.class); |
| | | byte[] dataX = new byte[resultData.getLength()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLength()); |
| | | String data1 = Base64.getMimeEncoder().encodeToString(dataX) + "="; |
| | | data1 = data1.replaceAll("\r\n", ""); |
| | | |
| | | open(request,response,data1);//入场开闸 |
| | | String[] split = resultData.getDatas().split("-"); |
| | | String[] dataX = new String[resultData.getLenth()]; |
| | | System.arraycopy(split,0,dataX,0,resultData.getLenth()); |
| | | String s2 = StringUtil.toStr(dataX); |
| | | byte[] bytes = StringUtil.HexString2Bytes(s2); |
| | | for (byte aByte : bytes) { |
| | | System.out.print(aByte+" "); |
| | | } |
| | | System.out.println(); |
| | | String data1 = new String("gb2312"); |
| | | data1 = Base64.getMimeEncoder().encodeToString(bytes); |
| | | // String data2 = data1.replace("\n", ""); |
| | | String data3 = data1.replaceAll("\r\n", ""); |
| | | System.out.println(); |
| | | System.out.println(data3); |
| | | open(request,response,data3);//入场开闸 |
| | | } |
| | | |
| | | public void inLedFullShow(String ledId, String carNo, Integer parkId,HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | |
| | | .execute() |
| | | .body(); |
| | | ResultData resultData = JSON.parseObject(s1,ResultData.class); |
| | | byte[] dataX = new byte[resultData.getLength()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLength()); |
| | | byte[] dataX = new byte[resultData.getLenth()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLenth()); |
| | | String data1 = Base64.getMimeEncoder().encodeToString(dataX) + "="; |
| | | data1 = data1.replaceAll("\r\n", ""); |
| | | |
| | |
| | | .execute() |
| | | .body(); |
| | | ResultData resultData = JSON.parseObject(s1,ResultData.class); |
| | | byte[] dataX = new byte[resultData.getLength()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLength()); |
| | | byte[] dataX = new byte[resultData.getLenth()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLenth()); |
| | | String data1 = Base64.getMimeEncoder().encodeToString(dataX) + "="; |
| | | data1 = data1.replaceAll("\r\n", ""); |
| | | if(type == 0){ |
| | |
| | | .execute() |
| | | .body(); |
| | | ResultData resultData = JSON.parseObject(s1,ResultData.class); |
| | | byte[] dataX = new byte[resultData.getLength()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLength()); |
| | | byte[] dataX = new byte[resultData.getLenth()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLenth()); |
| | | String data1 = Base64.getMimeEncoder().encodeToString(dataX) + "="; |
| | | data1 = data1.replaceAll("\r\n", ""); |
| | | if(type == 0){ |
| | |
| | | .execute() |
| | | .body(); |
| | | ResultData resultData = JSON.parseObject(s1,ResultData.class); |
| | | byte[] dataX = new byte[resultData.getLength()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLength()); |
| | | byte[] dataX = new byte[resultData.getLenth()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLenth()); |
| | | String data1 = Base64.getMimeEncoder().encodeToString(dataX) + "="; |
| | | data1 = data1.replaceAll("\r\n", ""); |
| | | noOpen(request,response,data1); |
| | |
| | | .execute() |
| | | .body(); |
| | | ResultData resultData = JSON.parseObject(s1,ResultData.class); |
| | | byte[] dataX = new byte[resultData.getLength()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLength()); |
| | | byte[] dataX = new byte[resultData.getLenth()]; |
| | | System.arraycopy(resultData.getDatas(),0,dataX,0,resultData.getLenth()); |
| | | String data1 = Base64.getMimeEncoder().encodeToString(dataX) + "="; |
| | | data1 = data1.replaceAll("\r\n", ""); |
| | | noOpen(request,response,data1); |