| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.md.entity.*; |
| | | import com.mes.md.mapper.AccountMapper; |
| | | import com.mes.md.mapper.KBBTJPDrawingBPMapper; |
| | | import com.mes.md.mapper.MachineMapper; |
| | | import com.mes.md.mapper.PrimitiveTaskMapper; |
| | | import com.mes.md.mapper.*; |
| | | import com.mes.md.service.AccountService; |
| | | import com.mes.md.service.PrimitiveTaskService; |
| | | import com.mes.md.service.ProjectService; |
| | |
| | | import java.net.Socket; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Author : yanzhixin |
| | |
| | | @Autowired |
| | | MachineMapper machineMapper; |
| | | |
| | | @Autowired |
| | | TaskingMapper taskingMapper; |
| | | |
| | | @Autowired |
| | | KBBTLensSortingMapper kBBTLensSortingMapper; |
| | | |
| | | /** |
| | | * 测试 扫码后库位 |
| | | */ |
| | | @Test |
| | | public void testStr() { |
| | | String str=new String("4、发送任务 任务数据:{}, ".getBytes(),StandardCharsets.UTF_8); |
| | | int a=1; |
| | | log.info(str,1); |
| | | |
| | | //创建Calendar实例 |
| | | Calendar cal = Calendar.getInstance(); |
| | | //设置当前时间 |
| | | cal.setTime(new Date()); |
| | | cal.add(Calendar.DATE, -3); |
| | | int deleteCount=taskingMapper.deleteJoin(new MPJLambdaWrapper<Tasking>() |
| | | .selectAll(Tasking.class) |
| | | .le(Tasking::getOperationRecordTime,cal.getTime())); |
| | | |
| | | log.info("{},删除数据:{}",cal.getTime(),deleteCount); |
| | | } |
| | | |
| | | @Test |
| | | public void testSaoMa3() { |
| | | try { |
| | | // 创建TCP客户端并连接到服务器 |
| | | String serverAddress = "192.168.1.8"; |
| | | int serverPort = 2001; |
| | | Socket clientSocket = new Socket(serverAddress, serverPort); |
| | | // 创建输入流和输出流 |
| | | InputStream inputStream = clientSocket.getInputStream(); |
| | | OutputStream outputStream = clientSocket.getOutputStream(); |
| | | // 发送数据给服务器 |
| | | String message = "start"; |
| | | outputStream.write(message.getBytes()); |
| | | // 读取服务器响应的数据 |
| | | byte[] buffer = new byte[1024]; |
| | | int bytesRead = inputStream.read(buffer); |
| | | String receivedMessage = new String(buffer, 0, bytesRead); |
| | | System.out.println("收到服务器响应:" + receivedMessage); |
| | | // 关闭连接 |
| | | clientSocket.close(); |
| | | }catch (Exception e){ |
| | | log.info("扫码异常"); |
| | | } |
| | | int deleteCount=taskingMapper.deleteJoin(new MPJLambdaWrapper<Tasking>() |
| | | .selectAll(Tasking.class) |
| | | .innerJoin(LineConfiguration.class,LineConfiguration::getId,Tasking::getLineConfigurationId) |
| | | .innerJoin(Machine.class,Machine::getId,LineConfiguration::getMachineId) |
| | | .eq(LineConfiguration::getMachineId,24L) |
| | | .eq(Tasking::getGlassState,"正常") |
| | | .eq(Tasking::getState,"线上") |
| | | .ne(Tasking::getWorkState,"完工")); |
| | | log.info("{}",deleteCount); |
| | | } |
| | | |
| | | @Test |