wu
2023-09-06 a8698fd74b7e630820f42eb76bd58ce8d22585d1
更新mes逻辑
2个文件已修改
42 ■■■■■ 已修改文件
springboot-vue3/src/main/java/com/example/springboot/controller/SpianController.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot-vue3/src/main/java/com/example/springboot/controller/SpianController.java
@@ -30,27 +30,39 @@
    //出片任务
@GetMapping("/all2")
    public Result selectdd(String orderid){
        //获取优先出片的位置
         StorageCage cageout=spianMapper.selectOut(orderid);
         //判断玻璃可直接出片时
         //玻璃内外片
         int cage =cageout.getCage();
         int cage =cageout.getCage(); //储存出片位置,笼子格子几号玻璃
         int cell =cageout.getCell();
         int tier =cageout.getTier();
         double width=cageout.getWidth();
         double glasswidth=cageout.getGlassWidth();
         //判断玻璃内外片
         if(tier==2){
             //判断玻璃可直接出片时
                return Result.success("执行出片");  
         }
         else{  
            //获取格子的玻璃数量
           int state= spianMapper.selectGlassState(cage,cell);
            //判断内片是否需要调拨
            if(state==0){
             return Result.success("状态为0,直接出片");  
             }else{
              //玻璃需要调拨时
              //玻璃需要调拨时,判断属于哪个半区的笼子
               if(cage<6){
                StorageCage cagecell= spianMapper.selectGlassCage(cage,glasswidth,0,6);
                //获取调拨位置进行调拨
                return Result.success(cagecell);  //调拨位置的参数内容
                //判断调拨结束后再次出片
               }else{
                StorageCage cagecell= spianMapper.selectGlassCage(cage,glasswidth,5,11);
                //获取调拨位置进行调拨
                StorageCage ca=cagecell;
                return Result.success(cagecell);  //调拨位置的参数内容
                //判断调拨结束后再次出片
               }
               
               return Result.success("状态为1,需要被调拨");
             }
        }
    
@@ -72,13 +84,17 @@
            int cages=spianMapper.selectCage(cage1);
            //判断选中笼子是否有空格
            StorageCage cages1=spianMapper.selectCage1(cage1);
            //有合适空格时进片
            if(cages>1 &&cages1.getTier()!=null){
                //执行进片
                return Result.success(cages1);
            }else{
                //返回不可进片
            }
            
             
        }         
        return Result.success("0");
        return Result.success("不可进片");
      
    }
    
springboot-vue3/src/main/java/com/example/springboot/mapper/SpianMapper.java
@@ -32,14 +32,14 @@
     void insert(StorageTask storageTask);
    
    //出片任务查询
    @Select("select cage,cell,tier from storage_cage as a where a.order_id=#{orderId} and state=1 order by cage desc,tier desc,cell desc LIMIT 1")
    @Select("select cage,cell,tier,glasswidth from storage_cage as a where a.order_id=#{orderId} and state=1 order by cage desc,tier desc,cell desc LIMIT 1")
     StorageCage selectOut(String  orderId);
    //判断出片为1时,是否可直接出片
    @Select("select state from storage_cage where cage=#{cage} and cell=#{cell} and tier=2;")
     int selectGlassState(int  cage,int cell);
     //判断
     @Select("select cage,cell,max(state)as shu from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0;")
     int selectGlassCage(double width,int cage1,int cage2);
     //判断该调拨的笼子
     @Select("select cage,cell,max(state)as shu from storage_cage where width>=#{width} and cage>#{cage1} and cage<#{cage2} GROUP BY cage,cell HAVING shu=0 order by abs(#{cage} - cage) limit 1;")
     StorageCage selectGlassCage(int cage,double width,int cage1,int cage2);
     
    // @Insert("insert into user(name, date, address, user_no) values (#{name}, #{date}, #{address}, #{userNo})")
    // void insert (Spian spian);