| | |
| | | </div> |
| | | <template #footer> |
| | | <div id="dialog-footer"> |
| | | <el-button type="primary" @click="adda = false"> |
| | | 确认 |
| | | </el-button> |
| | | <el-button type="primary" @click="adda = false">确认</el-button> |
| | | <el-button @click="adda = false">取消</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | <version>1.2.33</version> |
| | | </dependency> |
| | | |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.yulichang</groupId>--> |
| | | <!-- <artifactId>mybatis-plus-join</artifactId>--> |
| | | <!-- <version>1.2.4</version>--> |
| | | <!-- </dependency>--> |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.2.4</version> |
| | | <artifactId>mybatis-plus-join-boot-starter</artifactId> |
| | | <version>1.4.12</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | | |
| | |
| | | // 全局配置 |
| | | GlobalConfig gc = new GlobalConfig(); |
| | | gc.setOutputDir("D:\\Documents\\hangzhoumesParent1\\"); |
| | | |
| | | gc.setServiceName("%sService"); //去掉Service接口的首字母I |
| | | gc.setAuthor("zhoush"); |
| | | gc.setOpen(false); |
| | |
| | | // 4、包配置 |
| | | PackageConfig pc = new PackageConfig(); |
| | | pc.setParent("com.mes"); |
| | | pc.setModuleName("userinfo"); //模块名 |
| | | //pc.setModuleName("userinfo"); //模块名 |
| | | pc.setController("controller"); |
| | | pc.setService("service"); |
| | | pc.setMapper("mapper"); |
| | |
| | | // 5、策略配置 |
| | | StrategyConfig strategy = new StrategyConfig(); |
| | | |
| | | strategy.setInclude("up_patten_usage"); |
| | | //strategy.setInclude("up_patten_usage"); |
| | | |
| | | strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | /* |
| | | <dependency> |
| | | <groupId>com.baomidou</groupId> |
| | | <artifactId>mybatis-plus-generator</artifactId> |
| | | <version>3.4.1</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.velocity</groupId> |
| | | <artifactId>velocity-engine-core</artifactId> |
| | | <version>2.0</version> |
| | | </dependency> |
| | | */ |
| | |
| | | <artifactId>junit</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.1.6</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.github.yulichang</groupId>--> |
| | | <!-- <artifactId>mybatis-plus-join-boot-starter</artifactId>--> |
New file |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.common.PlcHomeEdg; |
| | | import org.springframework.boot.ApplicationArguments; |
| | | import org.springframework.boot.ApplicationRunner; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @Order(1) |
| | | |
| | | public class AppRunnerConfig implements ApplicationRunner { |
| | | |
| | | @Override |
| | | public void run(ApplicationArguments args) throws Exception { |
| | | // TODO Auto-generated method stub |
| | | // |
| | | //System.out.println("启动完成"); |
| | | new PlcHomeEdg().start(); |
| | | |
| | | } |
| | | } |
| | |
| | | package com.mes; |
| | | |
| | | import com.mes.common.WebSocketServer; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | import com.mes.edgstoragecage.service.*; |
| | | |
| | |
| | | |
| | | public static void main(String[] args) { |
| | | try { |
| | | SpringApplication.run(CacheGlassModuleApplication.class, args); |
| | | SpringApplication springApplication = new SpringApplication(CacheGlassModuleApplication.class); |
| | | ConfigurableApplicationContext applicationContext = springApplication.run(args); |
| | | WebSocketServer.setApplicationContext(applicationContext); |
| | | //SpringApplication.run(CacheGlassModuleApplication.class, args); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | |
| | | |
| | | public class PLCAutoMes extends Thread { |
| | | |
| | | // // 用于存储应用程序的配置信息 |
| | | // private Configuration config; |
| | | private static InitUtil initUtil; |
| | | // public static PlcParameterObject PlcMesObject; |
| | | // public static PlcParameterObject PlcReadObject; |
| | | // public static PlcParameterObject PlcframeObject; |
| | | |
| | | // // 创建一个自定义的 S7 控制器消息处理器对象 |
| | | // MessageHandler customS7Control = new MessageHandler(); |
| | | |
| | | // 单例实例 |
| | | private static PLCAutoMes instance; |
| | | // private static String PlcMes = PLCAutoMes.class.getResource("/JsonFile/PlcMes.json").getPath(); |
| | | private static String PlcAlbania = PLCAutoMes.class.getResource("/JsonFile/PlcAlbania.json").getPath(); |
| | | // private static String PlcRead = PLCAutoMes.class.getResource("/JsonFile/PlcRead.json").getPath(); |
| | | // private static String Plcframe = PLCAutoMes.class.getResource("/JsonFile/Plcframe.json").getPath(); |
| | | // private static String PlcParameter = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcParameter.json").getPath(); |
| | | |
| | | // private static String PlcSign = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcSign.json").getPath(); |
| | | |
| | | // private static String PlcState = PLCAutomaticParameterSettingReview2.class.getResource("/JsonFile/PlcState.json").getPath(); |
| | | |
| | | // private static String PlcAlarm = PLCAutoMes.class.getResource("/JsonFile/PlcAlarm.json").getPath(); |
| | | // private static String PlcTest = PLCAutoMes.class.getResource("/JsonFile/PlcTest.json").getPath(); |
| | | |
| | | // 调用initword方法 |
| | | |
| | | // public static PlcParameterObject plcParameterObject = initUtil.initword(PlcParameter); |
| | | // public static PlcBitObject plcPlcTest = initUtil.initbit(PlcTest); |
| | | // public static PlcBitObject plcBitObject = initUtil.initbit(PlcSign); |
| | | // public static PlcParameterObject plcStateObject= initUtil.initword(PlcState); |
| | | // public static PlcBitObject plcPlcAlarm = initUtil.initbit(PlcAlarm); |
| | | public static PlcParameterObject PlcMesObject = InitUtil.initword(PlcAlbania); |
| | | // public static PlcParameterObject PlcReadObject = initUtil.initword(PlcRead); |
| | | // public static PlcParameterObject PlcframeObject = initUtil.initword(Plcframe); |
| | | |
| | | // 私有构造函数 |
| | | public PLCAutoMes() throws IOException { |
| | | //config = new Configuration("config.properties"); |
| | | initUtil = new InitUtil(); |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // System.out.println(jsonFilePath); |
| | | |
| | | //readAndUpdateWordValues(PlcReadObject); |
| | | readAndUpdateWordValues(PlcMesObject); |
| | | //readAndUpdateWordValues(PlcframeObject); |
| | | // readAndUpdateWordValues(PlcframeObject); |
| | | |
| | | // readAndUpdateWordValues(plcStateObject); |
| | | // int index = PlcMesObject.getPlcParameter("AddStart").getAddressIndex(); |
| | | // // System.out.println(index); |
| | | // PlcMesObject.getPlcParameter("AddStart").getAddress(index); |
| | | // // System.out.println(PlcMesObject.getPlcParameter("AddStart").getAddress(index)); |
| | | // List<String> addresses = new ArrayList<>(); |
| | | // addresses.add("FeedID"); |
| | | // addresses.add("AddStart"); |
| | | // // System.out.println(addresses); |
| | | // // System.out.println(PlcMesObject.getPlcParameterValues(addresses)); |
| | | // List<String> addresses2 = new ArrayList<>(); |
| | | // addresses2.add("FeedID"); |
| | | // addresses2.add("FeedCarStatus"); |
| | | |
| | | //System.out.println(PlcReadObject.getPlcParameterValues(addresses2)); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | import cn.hutool.json.JSONObject; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | public class PlcHomeEdg extends Thread { |
| | | @Override |
| | | public void run() { |
| | | while (this != null) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | try { |
| | | Thread.sleep(1000); |
| | | // 注入mapper |
| | | // HomeService = WebSocketServer.applicationContext.getBean(HomeService.class); |
| | | // QueueMapper = WebSocketServer.applicationContext.getBean(QueueMapper.class); |
| | | |
| | | |
| | | // //读取DB105区文件 |
| | | // PlcParameterObject plcmes=PLCAutoMes.PlcMesObject; |
| | | // |
| | | // String PlcRequest=plcmes.getPlcParameter("GaToMES").getValue();//请求 |
| | | // String MesSend=plcmes.getPlcParameter("MESToGaStatus").getValue();//发送 |
| | | // double width=Double.valueOf(plcmes.getPlcParameter("width").getValue());//宽 |
| | | // double height=Double.valueOf(plcmes.getPlcParameter("Height").getValue());//高 |
| | | |
| | | //获取测量的长,宽 |
| | | boolean istest = true; |
| | | // String PlcRequest = "1"; |
| | | // String MesSend = "0"; |
| | | // double width = 516; |
| | | // double height = 507; |
| | | //System.out.println(111); |
| | | // //查询当前订单任务 |
| | | //List<FlowCard> OrderTask = storageCageService.SelectOrderTask(); |
| | | //jsonObject.append("OrderTask", OrderTask); |
| | | |
| | | } catch (InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | // jsonObject.append("params", new short[] { 30, 40, }); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("Home"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | if (webserver != null) { |
| | | |
| | | List<String> messages = webserver.getMessages(); |
| | | |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.mes.common; |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.websocket.*; |
| | | import javax.websocket.server.PathParam; |
| | | import javax.websocket.server.ServerEndpoint; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | @ServerEndpoint(value = "/api/talk/{username}") |
| | | @Component("webSocketServer") |
| | | public class WebSocketServer { |
| | | |
| | | |
| | | public static ConfigurableApplicationContext applicationContext; |
| | | |
| | | // 解决无法注入mapper问题 //使用方法 |
| | | // homeMapper=WebSocketServer.applicationContext.getBean(HomeMapper.class); |
| | | public static void setApplicationContext(ConfigurableApplicationContext configurableApplicationContext) { |
| | | WebSocketServer.applicationContext = configurableApplicationContext; |
| | | } |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(WebSocketServer.class); |
| | | private List<String> messages; |
| | | /** |
| | | * 记录当前在线连接数 |
| | | */ |
| | | public static final Map<String, ArrayList<WebSocketServer>> sessionMap = new ConcurrentHashMap<>(); |
| | | |
| | | String username; |
| | | Session session; |
| | | |
| | | public WebSocketServer() { |
| | | this.messages = new ArrayList<>(); |
| | | } |
| | | |
| | | /** |
| | | * 连接建立成功调用的方法 |
| | | */ |
| | | @OnOpen |
| | | public void onOpen(Session session, @PathParam("username") String username) { |
| | | this.username = username; |
| | | this.session = session; |
| | | List<WebSocketServer> webSocketServers = sessionMap.get(username); |
| | | if (webSocketServers == null) { |
| | | ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>(); |
| | | arrayListwebserver.add(this); |
| | | sessionMap.put(username, arrayListwebserver); |
| | | } else { |
| | | webSocketServers.add(this); |
| | | } |
| | | |
| | | log.info("有新用户加入,username={}, 当前在线人数为:{}", username, sessionMap.get(username).size()); |
| | | |
| | | // JSONObject result = new JSONObject(); |
| | | // JSONArray array = new JSONArray(); |
| | | // result.set("users", array); |
| | | // for (Object key : sessionMap.keySet()) { |
| | | // JSONObject jsonObject = new JSONObject(); |
| | | // jsonObject.set("username", key); |
| | | // array.add(jsonObject); |
| | | // } |
| | | |
| | | // sendAllMessage(JSONUtil.toJsonStr(result)); // 后台发送消息给所有的客户端 |
| | | } |
| | | |
| | | /** |
| | | * 连接关闭调用的方法 |
| | | */ |
| | | @OnClose |
| | | public void onClose(Session session, @PathParam("username") String username) { |
| | | List<WebSocketServer> webSocketServers = sessionMap.get(username); |
| | | ArrayList<WebSocketServer> arrayListwebserver = new ArrayList<WebSocketServer>(); |
| | | if (webSocketServers.size() > 1) { |
| | | for (WebSocketServer webSocketServer : webSocketServers) { |
| | | if (webSocketServer != this) { |
| | | arrayListwebserver.add(webSocketServer); |
| | | } |
| | | } |
| | | sessionMap.put(username, arrayListwebserver); |
| | | log.info("移除username={}一名用户session, {}的当前在线人数为:{}", username, username, sessionMap.get(username).size()); |
| | | } else { |
| | | sessionMap.remove(username); |
| | | log.info("移除username={}一名用户session, {}连接关闭, 当前连接数为:{}", username, username, sessionMap.size()); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 收到客户端消息后调用的方法 |
| | | * 后台收到客户端发送过来的消息 |
| | | * onMessage 是一个消息的中转站 |
| | | * 接受 浏览器端 socket.send 发送过来的 json数据 |
| | | * |
| | | * @param message 客户端发送过来的消息 |
| | | */ |
| | | @OnMessage |
| | | public void onMessage(String message, Session session, @PathParam("username") String username) { |
| | | log.info("服务端收到用户username={}的消息:{}", username, message); |
| | | JSONObject obj = JSONUtil.parseObj(message); |
| | | String text = obj.getStr("data"); |
| | | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.set("message", text); |
| | | this.messages.add(text); |
| | | this.sendMessage(jsonObject.toString()); // JSONUtil.toJsonStr(jsonObject) |
| | | |
| | | } |
| | | |
| | | @OnError |
| | | public void onError(Session session, Throwable error) { |
| | | log.error("发生错误"); |
| | | error.printStackTrace(); |
| | | } |
| | | |
| | | /** |
| | | * 服务端发送消息给客户端 |
| | | */ |
| | | public void sendMessage(String message) { |
| | | try { |
| | | // log.info("服务端给客户端[{}]发送消息{}", this.session.getId(), message); |
| | | this.session.getBasicRemote().sendText(message); |
| | | } catch (Exception e) { |
| | | log.error("服务端发送消息给客户端失败", e); |
| | | } |
| | | } |
| | | |
| | | // /** |
| | | // * 服务端发送消息给所有客户端 |
| | | // */ |
| | | // public void sendAllMessage(String message) { |
| | | // try { |
| | | // for (WebSocketServer webSocketServer : sessionMap.values()) { |
| | | // // log.info("服务端给客户端[{}]发送消息{}", this.session.getId(), message); |
| | | // webSocketServer.sendMessage(message); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("服务端发送消息给客户端失败", e); |
| | | // } |
| | | // } |
| | | |
| | | public List<String> getMessages() { |
| | | return messages; |
| | | |
| | | } |
| | | |
| | | public void clearMessages() { |
| | | messages.clear(); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @PostMapping("/selectEdgStorageCage") |
| | | @ResponseBody |
| | | public Result selectEdgStorageCage () { |
| | | List<Map> list=edgStorageCageService.selectEdgStorageCages(); |
| | | List<Map<String, Object>> list=edgStorageCageService.selectEdgStorageCages(); |
| | | return Result.build(200,"成功",list); |
| | | } |
| | | @ApiOperation("添加磨边缓存理片笼信息 功能:笼内绑定玻璃 参数(EdgStorageCage edgStorageCage)") |
| | | @PostMapping("/insertEdgStorageCage") |
| | | @ResponseBody |
| | | public Result insertEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"添加成功",1); |
| | | } |
| | | @ApiOperation("修改磨边缓存理片笼信息 功能:对笼内栅格进行【启用/禁用】/ 【更换】笼内栅格玻璃信息") |
| | | // @ApiOperation("添加磨边缓存理片笼信息 功能:笼内绑定玻璃 参数(EdgStorageCage edgStorageCage)") |
| | | // @PostMapping("/insertEdgStorageCage") |
| | | // @ResponseBody |
| | | // public Result insertEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | // boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | // return Result.build(200,"添加成功",1); |
| | | // } |
| | | @ApiOperation("修改磨边缓存理片笼信息 功能:对笼内栅格进行【启用/禁用】") |
| | | @PostMapping("/updateEdgStorageCage") |
| | | @ResponseBody |
| | | public Result updateEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | return Result.build(200,"更换成功",1); |
| | | } |
| | | @ApiOperation("删除磨边缓存理片笼信息 功能:对笼内栅格玻璃进行【清除】") |
| | | @PostMapping("/deleteEdgStorageCage") |
| | | @ApiOperation("磨边缓存理片笼信息 功能:对笼内栅格玻璃进行【清除/更换/绑定】 EdgStorageCage格子信息,EdgStorageCageDetails 玻璃信息 ") |
| | | @PostMapping("/edgStorageCageGlass") |
| | | @ResponseBody |
| | | public Result deleteEdgStorageCage(@RequestBody EdgStorageCage edgStorageCage, EdgStorageCageDetails edgStorageCageDetails) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCage(edgStorageCage); |
| | | public Result edgStorageCageGlass(@RequestBody EdgStorageCage edgStorageCage,@RequestBody EdgStorageCageDetails edgStorageCageDetails) { |
| | | boolean isSucess=edgStorageCageService.updateEdgStorageCageDetails(edgStorageCage,edgStorageCageDetails); |
| | | return Result.build(200,"删除成功",1); |
| | | } |
| | | |
| | |
| | | * 获取 切割当前版图 |
| | | * @return |
| | | */ |
| | | List<OptimizeDetail> selectCutTerritory(); |
| | | List<Map<String, Object>> selectCutTerritory(); |
| | | |
| | | /** |
| | | * 获取 工程下的当前版图 |
| | | * @param current |
| | | * @return |
| | | */ |
| | | List<OptimizeDetail> selectCurrentCutTerritory(String current); |
| | | List<Map<String, Object>> selectCurrentCutTerritory(String current); |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * 查询笼内空格 |
| | | * @return |
| | | */ |
| | | List<Map> selectCacheEmpty(); |
| | | List<Map<String, Object>> selectCacheEmpty(); |
| | | |
| | | /** |
| | | * 查询笼内出片顺序详情 |
| | | * @return |
| | | */ |
| | | List<Map> selectCacheOut(); |
| | | List<Map<String, Object>> selectCacheOut(); |
| | | |
| | | /** |
| | | * 查询笼内详情 |
| | | * @return |
| | | */ |
| | | List<Map> selectEdgStorageCages(); |
| | | List<Map<String, Object>> selectEdgStorageCages(); |
| | | |
| | | /** |
| | | * 修改理片笼内信息 |
| | | * 修改理片笼信息 |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | boolean updateEdgStorageCage(EdgStorageCage edgStorageCage); |
| | | |
| | | boolean updateEdgStorageCageDetails(EdgStorageCage edgStorageCage, EdgStorageCageDetails edgStorageCageDetails); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.mapper.EdgStorageCageDetailsMapper; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import com.mes.uppattenusage.mapper.UpPattenUsageMapper; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @return |
| | | */ |
| | | public boolean identWorn(String glassId, int ControlsId) { |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new MPJLambdaQueryWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId,glassId)); |
| | | if (edgStorageCageDetails.size() == 1) { |
| | | EdgStorageCageDetails item=edgStorageCageDetails.get(0); |
| | | item.setState(ControlsId); |
| | | baseMapper.update(edgStorageCageDetails.get(0), new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | baseMapper.update(edgStorageCageDetails.get(0), new MPJLambdaWrapper<EdgStorageCageDetails>().selectAll(EdgStorageCageDetails.class).eq(EdgStorageCageDetails::getGlassId,glassId)); |
| | | return true; |
| | | } |
| | | // Sql版本 |
| | | // List<EdgStorageCageDetails> edgStorageCageDetails = baseMapper.selectList(new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | // if (edgStorageCageDetails.size() == 1) { |
| | | // EdgStorageCageDetails item=edgStorageCageDetails.get(0); |
| | | // item.setState(ControlsId); |
| | | // baseMapper.update(edgStorageCageDetails.get(0), new QueryWrapper<EdgStorageCageDetails>().eq("glass_id", glassId)); |
| | | // return true; |
| | | // } |
| | | return false; |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OptimizeDetail> selectCutTerritory() { |
| | | List<UpPattenUsage> upPattenUsage=upPattenUsageMapper.selectList(new QueryWrapper<UpPattenUsage>() |
| | | .eq("state", 1)); |
| | | public List<Map<String, Object>> selectCutTerritory() { |
| | | List<UpPattenUsage> upPattenUsage=upPattenUsageMapper.selectList(new MPJLambdaWrapper<UpPattenUsage>() |
| | | .selectAll(UpPattenUsage.class) |
| | | .eq(UpPattenUsage::getState, 1)); |
| | | |
| | | if(!upPattenUsage.isEmpty()){ |
| | | UpPattenUsage upPattenUsage1=upPattenUsage.get(0); |
| | | return optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>() |
| | | .eq("project_no", upPattenUsage1.getEngineeringId()) |
| | | .eq("stock_id",upPattenUsage1.getLayoutSequence()) |
| | | return optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth,"olWidth") |
| | | .selectAs(OptimizeLayout::getWidth,"olHeight") |
| | | .leftJoin(OptimizeLayout.class,on->on |
| | | .eq(OptimizeLayout::getProjectNo,OptimizeDetail::getProjectNo) |
| | | .eq(OptimizeLayout::getStockId,OptimizeDetail::getStockId)) |
| | | .eq(OptimizeDetail::getProjectNo, upPattenUsage1.getEngineeringId()) |
| | | .eq(OptimizeDetail::getStockId,upPattenUsage1.getLayoutSequence()) |
| | | ); |
| | | |
| | | // Sql版本 |
| | | // return optimizeDetailMapper.selectJoinMaps(new MPJQueryWrapper<OptimizeDetail>().selectAll(OptimizeDetail.class) |
| | | // .select("ol.width as olwidth","ol.height as olheight") |
| | | // .leftJoin("optimize_layout ol on t.project_no=ol.project_no and t.stock_id=ol.stock_id") |
| | | // .eq("t.project_no", upPattenUsage1.getEngineeringId()) |
| | | // .eq("t.stock_id",upPattenUsage1.getLayoutSequence()) |
| | | // ); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OptimizeDetail> selectCurrentCutTerritory(String current) { |
| | | return optimizeDetailMapper.selectList(new QueryWrapper<OptimizeDetail>().eq("project_no", current)); |
| | | public List<Map<String, Object>> selectCurrentCutTerritory(String current) { |
| | | |
| | | return optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth,"olWidth") |
| | | .selectAs(OptimizeLayout::getWidth,"olHeight") |
| | | .leftJoin(OptimizeLayout.class,on->on |
| | | .eq(OptimizeLayout::getProjectNo,OptimizeDetail::getProjectNo) |
| | | .eq(OptimizeLayout::getStockId,OptimizeDetail::getStockId)) |
| | | .eq(OptimizeDetail::getProjectNo, current) |
| | | ); |
| | | //Sql版本 |
| | | // return optimizeDetailMapper.selectJoinMaps(new MPJQueryWrapper<OptimizeDetail>().selectAll(OptimizeDetail.class) |
| | | // .select("ol.width as olwidth","ol.height as olheight") |
| | | // .leftJoin("optimize_layout ol on t.project_no=ol.project_no and t.stock_id=ol.stock_id") |
| | | // .eq("t.project_no",current) |
| | | // ); |
| | | } |
| | | |
| | | ; |
| | | |
| | | |
| | | } |
| | |
| | | package com.mes.edgstoragecage.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map> selectCacheEmpty(){ |
| | | return baseMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | .isNull("escd.slot") |
| | | public List<Map<String, Object>> selectCacheEmpty(){ |
| | | return baseMapper.selectJoinMaps(JoinWrappers.lambda(EdgStorageCage.class).selectAll(EdgStorageCage.class) |
| | | .select(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight,EdgStorageCageDetails::getGlassId) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getDeviceId,EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot)) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | ); |
| | | |
| | | // return baseMapper.selectJoinMaps(new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | // .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | // .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | // .isNull("escd.slot") |
| | | // ); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map> selectCacheOut(){ |
| | | return upPattenUsageMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<UpPattenUsage>().selectAll(UpPattenUsage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .orderByAsc("escd.tempering_layout_id","escd.tempering_feed_sequence") |
| | | public List<Map<String, Object>> selectCacheOut(){ |
| | | |
| | | return upPattenUsageMapper.selectJoinMaps(JoinWrappers.lambda(UpPattenUsage.class).selectAll(UpPattenUsage.class) |
| | | .select(EdgStorageCageDetails::getWidth, EdgStorageCageDetails::getHeight,EdgStorageCageDetails::getGlassId) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getDeviceId,EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot)) |
| | | .isNull(EdgStorageCageDetails::getSlot) |
| | | ); |
| | | // return upPattenUsageMapper.selectJoinMaps(new MPJQueryWrapper<UpPattenUsage>().selectAll(UpPattenUsage.class) |
| | | // .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | // .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | // .isNotNull("escd.slot") |
| | | // .orderByAsc("escd.tempering_layout_id","escd.tempering_feed_sequence") |
| | | // ); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map> selectEdgStorageCages(){ |
| | | return baseMapper.selectJoinList( |
| | | Map.class,new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | public List<Map<String, Object>> selectEdgStorageCages(){ |
| | | return baseMapper.selectJoinMaps(JoinWrappers.lambda(EdgStorageCage.class) |
| | | .selectAll(EdgStorageCage.class) |
| | | .selectAs(EdgStorageCageDetails::getId,"esdId") |
| | | .select(EdgStorageCageDetails::getGlassId,EdgStorageCageDetails::getWidth,EdgStorageCageDetails::getHeight,EdgStorageCageDetails::getId) |
| | | .leftJoin(EdgStorageCageDetails.class,on->on |
| | | .eq(EdgStorageCageDetails::getDeviceId,EdgStorageCage::getDeviceId) |
| | | .eq(EdgStorageCageDetails::getSlot,EdgStorageCage::getSlot)) |
| | | ); |
| | | // return baseMapper.selectJoinMaps(new MPJQueryWrapper<EdgStorageCage>().selectAll(EdgStorageCage.class) |
| | | // .select("escd.glass_id","escd.flow_card_id","escd.width","escd.height") |
| | | // .leftJoin("edg_storage_cage_details escd on t.device_id=escd.device_id and t.slot=escd.slot") |
| | | // ); |
| | | } |
| | | |
| | | /** |
| | | * 修改理片笼内信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * 修改理片笼信息 功能:对笼内栅格玻璃 【启用/禁用】 |
| | | * @param edgStorageCage |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateEdgStorageCage(EdgStorageCage edgStorageCage){ |
| | | baseMapper.updateById(edgStorageCage); |
| | | EdgStorageCage edgItem=baseMapper.selectById(edgStorageCage.getId()); |
| | | edgItem.setEnableState(edgStorageCage.getEnableState()); |
| | | baseMapper.updateById(edgItem); |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | *修改理片笼信息 功能:对笼内栅格玻璃 【添加/删除/更换】 |
| | | * @param edgStorageCage |
| | | * @param edgStorageCageDetails |
| | | * @return |
| | | */ |
| | | @Override |
| | | public boolean updateEdgStorageCageDetails(EdgStorageCage edgStorageCage,EdgStorageCageDetails edgStorageCageDetails){ |
| | | EdgStorageCage edgItem=baseMapper.selectById(edgStorageCage.getId()); |
| | | EdgStorageCageDetails edgDItem=edgStorageCageDetailsMapper.selectById(edgStorageCageDetails.getId()); |
| | | if (edgItem!=null){ |
| | | if(edgDItem==null){ |
| | | //移除玻璃 |
| | | EdgStorageCageDetails result=edgStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getId,edgStorageCageDetails.getId())); |
| | | result.setSlot(0); |
| | | edgStorageCageDetailsMapper.updateById(result); |
| | | }else{ |
| | | //1.绑定新的玻璃 2.更换玻璃 上一片清除 重新绑定 |
| | | EdgStorageCageDetails lastResult=edgStorageCageDetailsMapper.selectOne(new MPJLambdaWrapper<EdgStorageCageDetails>().eq(EdgStorageCageDetails::getSlot,edgStorageCage.getSlot())); |
| | | lastResult.setSlot(0); |
| | | edgStorageCageDetailsMapper.updateById(lastResult); |
| | | EdgStorageCageDetails result=edgStorageCageDetailsMapper.selectById(edgStorageCageDetails.getId()); |
| | | result.setSlot(edgStorageCageDetails.getSlot()); |
| | | edgStorageCageDetailsMapper.updateById(result); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public List<GlassInfo> selectId(String glassId){ |
| | | return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("glass_id",glassId)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<GlassInfo>().selectAll(GlassInfo.class).eq(GlassInfo::getGlassId,glassId)); |
| | | // return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("glass_id",glassId)); |
| | | }; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<GlassInfo> selectFlowCardId(String flowCardId){ |
| | | return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("flow_card_id",flowCardId)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<GlassInfo>().selectAll(GlassInfo.class).eq(GlassInfo::getFlowCardId,flowCardId)); |
| | | //Sql版本 |
| | | // return baseMapper.selectList(new QueryWrapper<GlassInfo>().eq("flow_card_id",flowCardId)); |
| | | }; |
| | | } |
| | |
| | | @PostMapping("/cutTerritory") |
| | | @ResponseBody |
| | | public Result cutTerritory(String current) { |
| | | List<OptimizeDetail> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current); |
| | | List<Map<String, Object>> h = edgStorageCageDetailsService.selectCurrentCutTerritory(current); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | @ApiOperation("识别显示 当前版图 参数()") |
| | | @PostMapping("/currentCutTerritory") |
| | | @ResponseBody |
| | | public Result currentCutTerritory() { |
| | | List<OptimizeDetail> h = edgStorageCageDetailsService.selectCutTerritory(); |
| | | List<Map<String, Object>> h = edgStorageCageDetailsService.selectCutTerritory(); |
| | | return Result.build(200,"成功",h); |
| | | } |
| | | @ApiOperation("识别操作: 破损/拿走 参数(ID,功能[200:拿走,201:破损])") |
| | |
| | | package com.mes.taskcache.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.taskcache.mapper.TaskCacheMapper; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.uppattenusage.entity.UpPattenUsage; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectEdgInfo(String line) { |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_cell",line)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getEndCell,line)); |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_cell",line)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectCacheInfo(){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getTaskStatus,0)); |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectInputTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",1)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getTaskStatus,0).eq(TaskCache::getTaskType,1)); |
| | | |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",1)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectOutTaskCache(){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",2)); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getTaskStatus,0).eq(TaskCache::getTaskType,2)); |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("task_status",0).eq("task_type",2)); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<TaskCache> selectLastOutCacheInfo(String line){ |
| | | return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_xxxxcell",line).eq("task_status",1).orderByDesc("ID")); |
| | | return baseMapper.selectList(new MPJLambdaWrapper<TaskCache>().selectAll(TaskCache.class).eq(TaskCache::getEndCell,line).eq(TaskCache::getTaskStatus,1).orderByDesc(TaskCache::getID)); |
| | | // return baseMapper.selectList(new QueryWrapper<TaskCache>().eq("end_cell",line).eq("task_status",1).orderByDesc("ID")); |
| | | } |
| | | } |
| | |
| | | package com.mes; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJLambdaQueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.toolkit.JoinWrappers; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.edgstoragecage.service.impl.EdgStorageCageServiceImpl; |
| | | import com.mes.pp.entity.OptimizeDetail; |
| | | import com.mes.pp.entity.OptimizeLayout; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | |
| | | |
| | | @Test |
| | | public void testCacheGlass() { |
| | | List<Map> map= edgStorageCageService.selectEdgStorageCages(); |
| | | List<Map<String, Object>> map= edgStorageCageService.selectEdgStorageCages(); |
| | | log.info("笼内信息:{}", Arrays.asList(map)); |
| | | } |
| | | @Test |
| | | public void testselectCacheEmpty() { |
| | | List<Map> map= edgStorageCageService.selectCacheEmpty(); |
| | | public void testSelectCacheEmpty() { |
| | | List<Map<String, Object>> map= edgStorageCageService.selectCacheEmpty(); |
| | | log.info("笼内空格:{}", Arrays.asList(map)); |
| | | } |
| | | @Test |
| | | public void testScan() { |
| | | List<OptimizeDetail> map= edgStorageCageDetailsService.selectCutTerritory(); |
| | | List<Map<String, Object>> map= edgStorageCageDetailsService.selectCutTerritory(); |
| | | log.info("切割当前版图信息:{}", Arrays.asList(map)); |
| | | } |
| | | |
| | |
| | | log.info("切割当前版图信息:{}", Arrays.asList(optimizeDetail)); |
| | | |
| | | } |
| | | @Test |
| | | public void testOptimizeDetail() { |
| | | |
| | | List<Map<String, Object>> map2=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | | .selectAll(OptimizeDetail.class) |
| | | .selectAs(OptimizeLayout::getWidth,"olWidth") |
| | | .selectAs(OptimizeLayout::getWidth,"olHeight") |
| | | .select(OptimizeLayout::getWidth,OptimizeLayout::getHeight) |
| | | .leftJoin(OptimizeLayout.class,on-> on.eq(OptimizeLayout::getProjectNo,OptimizeDetail::getProjectNo) |
| | | .eq(OptimizeLayout::getStockId,OptimizeDetail::getStockId)) |
| | | .eq(OptimizeDetail::getProjectNo,"P24032204" ) |
| | | .eq(OptimizeDetail::getStockId,5) |
| | | ); |
| | | log.info("切割当前版图信息1:{}", Arrays.asList(map2)); |
| | | } |
| | | |
| | | } |
| | |
| | | <artifactId>cacheVerticalGlass</artifactId> |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.1.6</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.1.6</version> |
| | | </dependency> |
| | | </dependencies> |
| | | <properties> |
| | | <maven.compiler.source>8</maven.compiler.source> |
| | |
| | | <scope>compile</scope> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>com.github.yulichang</groupId> |
| | | <artifactId>mybatis-plus-join</artifactId> |
| | | <version>1.2.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.microsoft.sqlserver</groupId> |
| | | <artifactId>sqljdbc4</artifactId> |
| | |
| | | package com.mes.downstorage.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.mes.downstorage.entity.DownStorageCageDetails; |
| | | |
| | |
| | | * @author zhoush |
| | | * @since 2024-03-27 |
| | | */ |
| | | public interface DownStorageCageService extends IService<DownStorageCage> { |
| | | public interface DownStorageCageService extends MPJBaseService<DownStorageCage> { |
| | | public List<Map> gettask(); |
| | | |
| | | // List<Map<String, Object>> selectCacheLeisure(); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.github.yulichang.wrapper.MPJAbstractLambdaWrapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | |
| | | package com.mes.downstorage.service.impl; |
| | | |
| | | |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.downstorage.entity.DownStorageCage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class DownStorageCageServiceImpl extends ServiceImpl<DownStorageCageMapper, DownStorageCage> implements DownStorageCageService { |
| | | public class DownStorageCageServiceImpl extends MPJBaseServiceImpl<DownStorageCageMapper, DownStorageCage> implements DownStorageCageService { |
| | | @Autowired |
| | | private DownStorageCageMapper downStorageCageMapper; |
| | | @Override |
| | |
| | | @Override |
| | | public List<DownStorageCageDetails> getCacheLeisure() { |
| | | log.info(" 查询笼子内空闲"); |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNull("escd.slot") |
| | | .orderByAsc("escd.slot") |
| | | MPJQueryWrapper mpjQueryWrapper = new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNull("escd.slot") |
| | | .orderByAsc("escd.slot"); |
| | | List<DownStorageCageDetails> list = baseMapper.selectJoinList( |
| | | DownStorageCageDetails.class,mpjQueryWrapper |
| | | ); |
| | | return list; |
| | | } |
| | |
| | | @Override |
| | | public List<DownStorageCageDetails> getCacheOut(int start, int end) { |
| | | log.info("根据传入的工位查询符合按照顺序和大小出片的小片"); |
| | | MPJQueryWrapper mpjQueryWrapper =new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") |
| | | .leftJoin("glass_info gi on dw.flow_card_id = gi.flowcard_id and gi.flowcard_id=escd.flow_card_id ") |
| | | .isNotNull("escd.slot") |
| | | .between("dw.workstation_id", start, end) |
| | | .orderByDesc("escd.width") |
| | | .orderByDesc("escd.height"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .leftJoin("down_workstation dw on escd.flow_card_id = dw.flow_card_id") |
| | | .leftJoin("glass_info gi on dw.flow_card_id = gi.flowcard_id and gi.flowcard_id=escd.flow_card_id ") |
| | | .isNotNull("escd.slot") |
| | | .between("dw.workstation_id", start, end) |
| | | .orderByDesc("escd.width") |
| | | .orderByDesc("escd.height") |
| | | DownStorageCageDetails.class, mpjQueryWrapper |
| | | ); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<Map> getCacheInfo() { |
| | | log.info(" 查询笼子内信息"); |
| | | MPJQueryWrapper mpjQueryWrapper =new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .orderByAsc("t.slot"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | Map.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .orderByAsc("t.slot") |
| | | Map.class,mpjQueryWrapper |
| | | ); |
| | | |
| | | } |
| | |
| | | @Override |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByLayoutAndSequence(Integer tempering_layout_id, Integer tempering_feed_sequence, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号 找到相同版图id并且大于前面的顺序的空格"); |
| | | MPJQueryWrapper mpjQueryWrapper =new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .eq("escd.tempering_layout_id", tempering_layout_id) |
| | | .lt("escd.tempering_feed_sequence", tempering_feed_sequence) |
| | | .gt("t.remain_width", width) |
| | | .orderByAsc("escd.tempering_feed_sequence"); |
| | | List<DownStorageCageDetails> list = downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .eq("escd.tempering_layout_id", tempering_layout_id) |
| | | .lt("escd.tempering_feed_sequence", tempering_feed_sequence) |
| | | .gt("t.remain_width", width) |
| | | .orderByAsc("escd.tempering_feed_sequence") |
| | | DownStorageCageDetails.class, mpjQueryWrapper |
| | | ); |
| | | return list; |
| | | } |
| | |
| | | @Override |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByflowcardid(String flowcardid, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号 找到相同流程卡号的空格"); |
| | | |
| | | MPJQueryWrapper mpjQueryWrapper =new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .eq("escd.flow_card_id", flowcardid) |
| | | .gt("t.remain_width", width) |
| | | .orderByAsc("escd.tempering_feed_sequence"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .eq("escd.flow_card_id", flowcardid) |
| | | .gt("t.remain_width", width) |
| | | .orderByAsc("escd.tempering_feed_sequence") |
| | | DownStorageCageDetails.class, mpjQueryWrapper |
| | | ); |
| | | |
| | | } |
| | |
| | | @Override |
| | | public List<DownStorageCageDetails> IsExistIntoCacheByflowcardid(String flowcardid, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号"); |
| | | MPJQueryWrapper mpjQueryWrapper =new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .lt("escd.flow_card_id", flowcardid) |
| | | // 条件 t.remain_width - width > 0 |
| | | .apply("t.remain_width - " + width + " > 0") |
| | | .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .lt("escd.flow_card_id", flowcardid) |
| | | // 条件 t.remain_width - width > 0 |
| | | .apply("t.remain_width - " + width + " > 0") |
| | | .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence") |
| | | DownStorageCageDetails.class,mpjQueryWrapper |
| | | ); |
| | | |
| | | } |
| | |
| | | @Override |
| | | public List<DownStorageCageDetails> getIsExistIntoCacheByLayout(Integer tempering_layout_id, double width) { |
| | | log.info(" 查询可进此片玻璃的栅格号"); |
| | | MPJQueryWrapper mpjQueryWrapper =new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .lt("escd.tempering_layout_id", tempering_layout_id) |
| | | // 条件 t.remain_width - width > 0 |
| | | .apply("t.remain_width - " + width + " > 0") |
| | | .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence"); |
| | | return downStorageCageMapper.selectJoinList( |
| | | DownStorageCageDetails.class, new MPJQueryWrapper<DownStorageCageDetails>() |
| | | .select("escd.*") |
| | | .leftJoin("down_storage_cage_details escd on t.slot = escd.slot") |
| | | .isNotNull("escd.slot") |
| | | .lt("escd.tempering_layout_id", tempering_layout_id) |
| | | // 条件 t.remain_width - width > 0 |
| | | .apply("t.remain_width - " + width + " > 0") |
| | | .orderByDesc("escd.tempering_layout_id, escd.tempering_feed_sequence") |
| | | DownStorageCageDetails.class, mpjQueryWrapper |
| | | ); |
| | | |
| | | } |