| | |
| | | package com.mes; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.smallbun.screw.core.util.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.md.entity.*; |
| | | import com.mes.md.mapper.*; |
| | | import com.mes.md.service.AccountService; |
| | | import com.mes.md.service.PrimitiveTaskService; |
| | | import com.mes.md.service.ProjectService; |
| | | import com.mes.md.service.TaskingService; |
| | | import com.mes.md.service.*; |
| | | import com.mes.tools.HexConversion; |
| | | import com.mes.utils.HexUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Author : yanzhixin |
| | |
| | | @Autowired |
| | | KBBTLensSortingMapper kBBTLensSortingMapper; |
| | | |
| | | @Autowired |
| | | KBBTProgramsOperationLogBPMapper kBBTProgramsOperationLogBPMapper; |
| | | |
| | | @Autowired |
| | | KBBTProgramsOperationLogBPService kBBTProgramsOperationLogBPService; |
| | | |
| | | @Autowired |
| | | TaskingLogMapper taskingLogMapper; |
| | | |
| | | @Autowired |
| | | TaskingLogService taskingLogService; |
| | | /** |
| | | * 测试 提交报工 以及玻璃数据 |
| | | */ |
| | | @Test |
| | | public void reportTaskingLog() { |
| | | taskingLogService.reportTaskingLog(); |
| | | } |
| | | /** |
| | | * 测试 扫码后库位 |
| | | */ |
| | | @Test |
| | | public void testInset() { |
| | | |
| | | // 从数据库中查询出的对象集合 |
| | | List<Tasking> listTasking = taskingMapper.selectList(new QueryWrapper<Tasking>()); |
| | | List<KBBTProgramsOperationLogBP> abc =kBBTProgramsOperationLogBPMapper.selectList(new QueryWrapper<KBBTProgramsOperationLogBP>()); |
| | | // 判端是否为空 |
| | | if (CollectionUtils.isNotEmpty(listTasking)) { |
| | | // 进行拆解封装 |
| | | List<KBBTProgramsOperationLogBP> stationDictVOS = listTasking.stream().map(item -> { |
| | | KBBTProgramsOperationLogBP newData = new KBBTProgramsOperationLogBP(); |
| | | newData.setGlassId(item.getGlassId()); |
| | | newData.setState(item.getState()); |
| | | newData.setWorkState(item.getWorkState()); |
| | | newData.setGlassState(item.getGlassState()); |
| | | newData.setState(item.getState()); |
| | | newData.setScanId(item.getScanId()); |
| | | newData.setProgramId(item.getProgramId()); |
| | | newData.setBatchNumber(item.getBatchNumber()==null?"":item.getBatchNumber()); |
| | | newData.setTaskType(item.getTaskType()); |
| | | newData.setLength(item.getLength()); |
| | | newData.setWidth(item.getWidth()); |
| | | newData.setThickness(item.getThickness()); |
| | | newData.setDrawingMarking(item.getDrawingMarking()); |
| | | //newData.setIsMarking(item.getIsMarking());//是否打标:0不打标 1打标 |
| | | newData.setIsSilkScreen(item.getIsSilkScreen()); |
| | | newData.setIsWorking(1); |
| | | newData.setSilkScreenX(item.getSilkScreenX()); |
| | | newData.setSilkScreenY(item.getSilkScreenY()); |
| | | newData.setR_1_1(item.getR_1_1()); |
| | | newData.setR_1_2(item.getR_1_2()); |
| | | newData.setR_2_1(item.getR_2_1()); |
| | | newData.setR_2_2(item.getR_2_2()); |
| | | newData.setR_3_1(item.getR_3_1()); |
| | | newData.setR_3_2(item.getR_3_2()); |
| | | newData.setR_4_1(item.getR_4_1()); |
| | | newData.setR_4_2(item.getR_4_2()); |
| | | newData.setCreateDate(new Date()); |
| | | kBBTProgramsOperationLogBPMapper.insert(newData); |
| | | return newData; |
| | | }).collect(Collectors.toList()); |
| | | log.info("保存数据是否成功:{},{}",stationDictVOS); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 测试 扫码后库位 |
| | | */ |
| | | @Test |
| | | public void testStr() { |
| | | |
| | | //创建Calendar实例 |
| | | Calendar cal = Calendar.getInstance(); |
| | | //设置当前时间 |