From ca1ae93196be366e707647c42e3039512a2cf45f Mon Sep 17 00:00:00 2001
From: wu <731351411@qq.com>
Date: 星期二, 12 十一月 2024 14:00:24 +0800
Subject: [PATCH] 字段显示,结束任务功能更新,界面调整,测量显示
---
springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java | 76 ++++++++++++++++++++++++++++++-------
1 files changed, 61 insertions(+), 15 deletions(-)
diff --git a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
index 4d37809..2164519 100644
--- a/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
+++ b/springboot-vue3/src/main/java/com/example/springboot/mapper/HomeMapper.java
@@ -5,6 +5,7 @@
import com.example.springboot.entity.CarPosition;
import com.example.springboot.entity.Flowcard;
import com.example.springboot.entity.GlassInfo;
+import com.example.springboot.entity.MeasureSetting;
import com.example.springboot.entity.StorageCage;
import com.example.springboot.entity.StorageTask;
import com.example.springboot.entity.alarmmg;
@@ -238,7 +239,7 @@
List<StorageCage> SelectStorageCageInfo();
// 鍒犻櫎鏍煎瓙鍐呯幓鐠冧俊鎭�
- @Update("update storage_cage set films=null,width=5000,glasswidth=null,glassheight=null,glasswidthmm=null,glassheightmm=null,thickness=null,glasstype=null,number=null where cell=#{cell}")
+ @Update("update storage_cage set films=null,width=4300,glasswidth=null,glassheight=null,glasswidthmm=null,glassheightmm=null,thickness=null,glasstype=null,number=null,glass_id=null,flowcard=null,mateid=null where cell=#{cell}")
void DeleteStroageCageByCell(Integer cell);
// 淇敼鏍煎瓙鐜荤拑鏁伴噺
@@ -246,7 +247,7 @@
void updateStroageCageByCell(Integer cell, Integer num);
// 璁$畻鏍煎瓙鍐呭墿浣欏搴�
- @Update("update storage_cage set width=5000-if(glasswidth is null,0,glasswidth+50)*number where cell=#{cell}")
+ @Update("update storage_cage set width=4300-if(glasswidth is null,0,glasswidth+300)*number where cell=#{cell}")
void UpdateStroageCageWidthByCell(Integer cell);
// 鏍规嵁浠诲姟绫诲瀷鑾峰彇浠诲姟
@@ -254,28 +255,37 @@
List<StorageTask> SelectStorageTask(int task_type);
// 鏍规嵁id浠诲姟
- @Select("select * from storage_task where id=#{id}")
- StorageTask SelectStorageTaskById(int id);
+ @Select("select * from storage_task where task_state=0 ORDER BY id asc LIMIT 1")
+ StorageTask SelectStorageTaskById();
// 鏍规嵁鏍煎瓙鏌ヨ鐜荤拑淇℃伅
@Select("select * from storage_cage where cell=#{cell}")
StorageCage SelectStorageByCell(String cell);
+ //鏍规嵁鐜荤拑绫诲瀷鏌ヨ鐜荤拑淇℃伅
+ @Select("select a.shelf_rack as cage,a.load_rack as cell,b.mateid,b.width as glasswidth,b.height as glassheight,b.thickness,b.films from storage_task a left join glassinfo b on a.glasstype=b.glasstype where a.id=#{id} limit 1")
+ StorageCage SelectStorageByCellGlass(Integer id);
// 鎵嬪姩瀹屾垚浠诲姟
- @Select("update storage_task set task_state=1 where id=#{id}")
- void FinishTask(Integer id);
-
- @Select("select gi.* from glassinfo gi inner join flowcard fc on gi.flowcard=fc.flowcard where fc.state!=2 and position(#{width} in gi.width) and position(#{height} in gi.height) and position(#{thickness} in gi.thickness) and position(#{films} in gi.films) group by gi.id")
+ @Select("update storage_task set task_state=#{state} where id=#{id}")
+ void FinishTask(Integer id, int state);
+ //浜哄伐鍖归厤娴嬮噺鏌ヨ
+ @Select("select gi.* from glassinfo gi inner join flowcard fc on gi.flowcard=fc.flowcard where fc.state!=2 and fc.orderstate=1 and position(#{width} in gi.width) and position(#{height} in gi.height) and position(#{thickness} in gi.thickness) and position(#{films} in gi.films) group by gi.id")
List<GlassInfo> SelectGlassInfo(String width, String height, String thickness, String films);
+ // @Select("select b.* from flowcard a left join glassinfo b on a.flowcard=b.flowcard INNER JOIN measuresetting c where a.orderstate=1 and a.state!=2 and b.width BETWEEN #{width} - c.errorwidth AND #{width} + c.errorwidth and b.height BETWEEN #{height} - c.errorheight AND #{height} + c.errorheight and b.films=#{films} and b.thickness=#{thickness}")
+ // List<GlassInfo> SelectGlassInfo(String width, String height, String thickness, String films);
- @Update("update storage_cage set glasstype=#{glassInfo.glasstype},glasswidth=#{glassInfo.width},glassheight=#{glassInfo.height},thickness=#{glassInfo.thickness},films=#{glassInfo.films},number=0 where cell=#{cell}")
+
+ @Update("update storage_cage set glasstype=#{glassInfo.glasstype},mateid=#{glassInfo.mateid},glass_id=#{glassInfo.glassid},flowcard=#{glassInfo.flowcard},glasswidth=#{glassInfo.width},glassheight=#{glassInfo.height},thickness=#{glassInfo.thickness},films=#{glassInfo.films},number=0 where cell=#{cell}")
void StorageCageAddGlass(String cell, GlassInfo glassInfo);
@Select("select * from flowcard where state!=2")
List<Flowcard> SelectOrderTask();
- @Select("select gi.*,sum(sc.number) as cageno from glassinfo gi left join storage_cage sc on gi.glasstype=sc.glasstype where gi.flowcard=#{flowcard} group by gi.id order by gi.mateid,gi.tier")
+ // @Select("select gi.*,sum(sc.number) as cageno from glassinfo gi left join storage_cage sc on gi.glasstype=sc.glasstype where gi.flowcard=#{flowcard} group by gi.id order by gi.mateid,gi.tier")
+ // List<GlassInfo> SelectOrderView(String flowcard);
+ @Select("select gi.id, gi.glasstype, gi.mateid, gi.glassid, gi.tier, gi.films, gi.width, gi.height, gi.thickness, gi.number, gi.finishnumber, gi.sumtier, gi.measurenumber,sum(sc.number) as cageno,IFNULL(c.orderstate,0) as orderstate from glassinfo gi left join storage_cage sc on gi.glasstype=sc.glasstype left join flowcard c on gi.flowcard=c.flowcard where gi.flowcard=#{flowcard} group by gi.id,orderstate order by gi.mateid,gi.tier")
List<GlassInfo> SelectOrderView(String flowcard);
+
@Update("update flowcard set state=#{state},line=#{line} where flowcard=#{flowcard}")
void ClaimTasks(String flowcard, int state, int line);
@@ -287,25 +297,58 @@
@Update("update flowcard set orderstate=#{orderstate} where flowcard=#{flowcard}")
void StartChange(String flowcard,int orderstate);
- @Update("update queue set glassid=concat(#{flowcard},'-',#{tier}),flowcard=#{flowcard},glasswidth=#{width},glassheight=#{height},glasstype=#{glasstype},thickness=#{thickness},state=1 where state<=0")
- void UpdateQueue(String flowcard, double width, double height, Integer glasstype, Double thickness, Integer tier);
+ @Select("select orderstate from flowcard where flowcard=#{flowcard} limit 1")
+ int selectStartChange(String flowcard);
+ // @Delete("DELETE from flowcard where flowcard=#{flowcard}")
+ // int deleteFlowcard(String flowcard);
+
+ // @Delete("DELETE from glassinfo where flowcard=#{flowcard}")
+ // int deleteGlassinfo(String flowcard);
+ @Update("Update flowcard set state=2, flowcard=CONCAT('宸插垹闄�', #{flowcard}),orderstate=0 where flowcard=#{flowcard}")
+ int deleteFlowcard(String flowcard);
+
+ @Update("Update glassinfo set flowcard=CONCAT('宸插垹闄�', #{flowcard}) where flowcard=#{flowcard}")
+ int deleteGlassinfo(String flowcard);
+ //浜哄伐鍖归厤淇敼涓�鏉�
+ @Update("update queue set glassid=concat(#{flowcard},'-',#{tier}),flowcard=#{flowcard},glasswidth=#{width},glassheight=#{height},glasstype=#{glasstype},thickness=#{thickness},mateid=#{mateid},state=1 where state<=0")
+ void UpdateQueue(String flowcard, double width, double height, Integer glasstype, Double thickness, Integer tier,int mateid);
+ //浜哄伐鍖归厤鏂板涓�鏉�
+ @Insert("INSERT INTO queue (flowcard,glassid,glasswidth,glassheight,glasstype,thickness,mateid,state) VALUES (#{flowcard},concat(#{flowcard},'-',#{tier}),#{width},#{height},#{glasstype},#{thickness},#{mateid},1)")
+ int AddQueue(String flowcard, double width, double height, Integer glasstype, Double thickness, Integer tier,int mateid);
+ //鍒ゆ柇娴嬮噺琛ㄦ槸鍚︽湁鍙洿鏀圭殑鏁版嵁
+ @Select("select count(*) from queue where state<1")
+ int SelectQueue();
@Update("update glassinfo set finishnumber=ifnull(finishnumber,0)+1 where flowcard=#{flowcard} and mateid=#{mateid} and tier=#{geTier}")
void AddGlassNo(String flowcard, Integer mateid, Integer geTier);
+ @Update("update glassinfo set finishnumber=ifnull(finishnumber,0)-1 where glasstype=#{glasstype}")
+ void OutGlassNo(Integer glasstype);
// 娣诲姞鍑虹墖闃熷垪
@Insert("INSERT INTO glassinfo (`flowcard`, `glasstype`, `mateid`, `glassid`, `tier`, `films`, `width`, `height`, `thickness`, `number`, `finishnumber`, `sumtier`, `measurenumber`)"
+
- " VALUES (#{flowcard}, #{glasstype}, #{mateid}, #{glassid}, #{tier}, #{films}, #{width}, #{height}, #{thickness}, #{number}, 0, #{sumtier}, 0)")
+ " VALUES (#{flowcard}, #{glasstype}, #{mateid}, #{glassid}, #{tier}, #{films}, CASE WHEN #{width} > #{height} THEN #{width} ELSE #{height} END, CASE WHEN #{height} > #{width} THEN #{width} ELSE #{height} END, #{thickness}, #{number}, 0, #{sumtier}, 0)")
void AddGlassinfo(String flowcard, Integer glasstype, Integer mateid, String glassid, Integer tier, String films,
Double width, Double height, Double thickness, Integer number, Integer sumtier);
// 鏈�澶х幓鐠冪被鍨�
@Select("select max(glasstype)+1 from glassinfo")
Integer SelectMaxType();
+ // 鏈�澶х幓鐠冪被鍨�
+ @Select("select glasstype from glassinfo where CONCAT(width,'_',height,'_',thickness,'_',films,'_',flowcard,'_',mateid)=#{key} limit 1")
+ Integer SelectMaxTypes(String key);
+
+ //鏌ヨ鎵�鏈夌幓鐠冭啘绯诲拰鍘氬害
+ @Select("select films,thickness from glassinfo GROUP BY films,thickness")
+ List<GlassInfo> SelectMeasure();
+ @Select("select*from measuresetting")
+ MeasureSetting SelectMeasureSetting();
+ //鏌ヨ褰撳墠娴嬮噺瀹介珮鍜岃啘绯诲帤搴�
+ @Select("select ifnull(a.glasswidthmm,0) as glasswidthmm,ifnull(a.glassheightmm,0) as glassheightmm,ifnull(b.films,'') as films,ifnull(b.thickness,0) as thickness from queue a INNER JOIN measuresetting b where state!=2 ORDER BY a.id asc LIMIT 1")
+ Map SelectMeasureWidthHeight();
// 鏌ヨ鍏ㄩ儴鐜荤拑绫诲瀷
- @Select("select CONCAT(IFNULL(width,''),'_',IFNULL(height,''),'_',IFNULL(thickness,''),'_',IFNULL(films,'')) as type,glasstype from glassinfo GROUP BY width,height,thickness,films")
+ @Select("select CONCAT(IFNULL(width,''),'_',IFNULL(height,''),'_',IFNULL(thickness,''),'_',IFNULL(films,'')) as type,glasstype from glassinfo GROUP BY width,height,thickness,films,glasstype")
List<Map> SelectType();
// 鏌ヨ鎬诲眰鏁�
@@ -321,9 +364,12 @@
+" select #{flowcard}, 0, #{number}, 0, 0, 0, now() where 0=( select count(*) from flowcard where flowcard=#{flowcard});")
void InsertFlowcard(String flowcard, Integer number);
- @Delete("Delete from queue where glassid=#{glassId}")
+ @Delete("DELETE FROM queue WHERE id = (SELECT id FROM ( SELECT id FROM queue WHERE glasstype = #{glassId} ORDER BY time ASC LIMIT 1) AS temp);")
void DeletequeueByGlassid(String glassId);
@Select("select count(*) from flowcard where line=#{line} and state=1 and flowcard!=#{flowcard}")
int SelectTaskCount(String flowcard,Integer line);
+ //淇敼娴嬮噺璁惧畾鑶滅郴鍜屽帤搴�
+ @Update("UPDATE measuresetting SET `films` = #{films}, `thickness` = #{thickness} WHERE `id` = 1;")
+ int SaveMeasure(String films, Integer thickness);
}
--
Gitblit v1.8.0