MesDevice.java 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. package com.jeesite.modules.mes.entity;
  2. import com.jeesite.common.entity.TreeEntity;
  3. import com.jeesite.common.mybatis.annotation.Column;
  4. import com.jeesite.common.mybatis.annotation.JoinTable;
  5. import com.jeesite.common.mybatis.annotation.JoinTable.Type;
  6. import com.jeesite.common.mybatis.annotation.Table;
  7. import com.jeesite.common.mybatis.mapper.query.QueryType;
  8. import com.jeesite.common.utils.excel.annotation.ExcelField;
  9. import com.jeesite.common.utils.excel.annotation.ExcelFields;
  10. import javax.validation.constraints.NotBlank;
  11. import javax.validation.constraints.Size;
  12. /**
  13. * 设备Entity
  14. * @author mes
  15. * @version 2023-07-12
  16. */
  17. @Table(name="mes_device", alias="a", label="设备信息", columns={
  18. @Column(name="tree_code", attrName="treeCode", label="tree_code", isPK=true),
  19. @Column(includeEntity=TreeEntity.class),
  20. @Column(name="status", attrName="status", label="状态", isUpdate=false),
  21. @Column(name="remark", attrName="remark", label="备注"),
  22. @Column(name="create_by", attrName="createBy", label="create_by", isUpdate=false, isQuery=false),
  23. @Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false, isUpdateForce=true),
  24. @Column(name="tree_name", attrName="treeName", label="节点名称", queryType=QueryType.LIKE, isTreeName=true),
  25. @Column(name="update_by", attrName="updateBy", label="update_by", isQuery=false),
  26. @Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false, isUpdateForce=true),
  27. @Column(name="sn", attrName="sn", label="唯一编号"),
  28. @Column(name="ip", attrName="ip", label="IP地址"),
  29. @Column(name="online", attrName="online", label="在线状态0在线1离线", isInsert=false, isUpdate=false, isQuery=false, isUpdateForce=true),
  30. @Column(name="gw", attrName="gw", label="工位"),
  31. @Column(name="line_sn", attrName="lineSn", label="产线编号"),
  32. @Column(name="bc", attrName="bc", label="班次"),
  33. @Column(name="cate_id", attrName="cateId", label="分类"),
  34. @Column(name="work_status", attrName="workStatus", label="设备工作状态"),
  35. @Column(name="work_time", attrName="workTime", label="状态时间"),
  36. @Column(name="device_type", attrName="deviceType", label="设备类型"),
  37. @Column(name="work_type", attrName="workType", label="工作类型"),
  38. @Column(name="interval", attrName="interval", label="生成时间(秒)"),
  39. @Column(name="product_sn", attrName="productSn", label="当前工件"),
  40. @Column(name="device_code", attrName="deviceCode", label="设备识别码"),
  41. }, joinTable={
  42. @JoinTable(type=Type.LEFT_JOIN, entity=MesDeviceCate.class, attrName="this", alias="b",
  43. on="a.cate_id = b.id", columns={
  44. @Column(name="title", attrName="cateName",label="设备分类" ),
  45. }),
  46. },orderBy="a.sn, a.tree_sorts, a.tree_code"
  47. )
  48. public class MesDevice extends TreeEntity<MesDevice> {
  49. private static final long serialVersionUID = 1L;
  50. private String treeCode; // tree_code
  51. private String remark; // 备注
  52. private String treeName; // 节点名称
  53. private String sn; // 唯一编号 (设备识别码)
  54. private String ip; // IP地址
  55. private Integer online; // 在线状态0在线1离线
  56. private String parentSn;
  57. private String gw;
  58. private String bc;
  59. private Integer interval;
  60. private String postion;
  61. private String workStatus;
  62. private String workTime;
  63. private String deviceType;
  64. private String workType;
  65. private String cateId;
  66. private String cateName;
  67. private String productSn;
  68. private String productCate;
  69. private String lineSn;
  70. private String deviceCode;
  71. @ExcelFields({
  72. @ExcelField(title="设备名称", attrName="treeName", align= ExcelField.Align.CENTER, sort=20),
  73. @ExcelField(title="唯一编号", attrName="sn", align= ExcelField.Align.CENTER, sort=30),
  74. @ExcelField(title="设备识别码", attrName="sn", align= ExcelField.Align.CENTER, sort=40),
  75. @ExcelField(title="分类", attrName="cateName", align= ExcelField.Align.CENTER, sort=50),
  76. @ExcelField(title="IP地址", attrName="ip", align= ExcelField.Align.CENTER, sort=60),
  77. @ExcelField(title="产线编号", attrName="lineSn", align= ExcelField.Align.CENTER, sort=70),
  78. @ExcelField(title="工位", attrName="gw", align= ExcelField.Align.CENTER, sort=80),
  79. @ExcelField(title="设备工作状态", attrName="workStatus",dictType="mes_device_work_status", align= ExcelField.Align.CENTER, sort=90),
  80. @ExcelField(title="状态", attrName="workStatus",dictType="mes_device_work_status", align= ExcelField.Align.CENTER, sort=100),
  81. @ExcelField(title="备注", attrName="remark", align= ExcelField.Align.CENTER, sort=110),
  82. })
  83. public String getPostion() {
  84. return postion;
  85. }
  86. public void setPostion(String postion) {
  87. this.postion = postion;
  88. }
  89. public String getWorkStatus() {
  90. return workStatus;
  91. }
  92. public void setWorkStatus(String workStatus) {
  93. this.workStatus = workStatus;
  94. }
  95. public String getWorkTime() {
  96. return workTime;
  97. }
  98. public void setWorkTime(String workTime) {
  99. this.workTime = workTime;
  100. }
  101. public String getDeviceType() {
  102. return deviceType;
  103. }
  104. public void setDeviceType(String deviceType) {
  105. this.deviceType = deviceType;
  106. }
  107. public String getWorkType() {
  108. return workType;
  109. }
  110. public void setWorkType(String workType) {
  111. this.workType = workType;
  112. }
  113. public String getGw() {
  114. return gw;
  115. }
  116. public void setGw(String gw) {
  117. this.gw = gw;
  118. }
  119. public String getBc() {
  120. return bc;
  121. }
  122. public void setBc(String bc) {
  123. this.bc = bc;
  124. }
  125. public String getCateId() {
  126. return cateId;
  127. }
  128. public void setCateId(String cateId) {
  129. this.cateId = cateId;
  130. }
  131. public String getCateName() {
  132. return cateName;
  133. }
  134. public void setCateName(String cateName) {
  135. this.cateName = cateName;
  136. }
  137. /* @ExcelFields({
  138. @ExcelField(title="规格型号", attrName="spec", align=Align.CENTER, sort=30),
  139. @ExcelField(title="制造商", attrName="company", align=Align.CENTER, sort=40),
  140. @ExcelField(title="出场日期", attrName="outdate", align=Align.CENTER, sort=50, dataFormat="yyyy-MM-dd"),
  141. })*/
  142. public MesDevice() {
  143. this(null);
  144. }
  145. public MesDevice(String id){
  146. super(id);
  147. }
  148. @Override
  149. public MesDevice getParent() {
  150. return parent;
  151. }
  152. @Override
  153. public void setParent(MesDevice parent) {
  154. this.parent = parent;
  155. }
  156. public String getTreeCode() {
  157. return treeCode;
  158. }
  159. public void setTreeCode(String treeCode) {
  160. this.treeCode = treeCode;
  161. }
  162. @Size(min=0, max=255, message="备注长度不能超过 255 个字符")
  163. public String getRemark() {
  164. return remark;
  165. }
  166. public void setRemark(String remark) {
  167. this.remark = remark;
  168. }
  169. @NotBlank(message="节点名称不能为空")
  170. @Size(min=0, max=200, message="节点名称长度不能超过 200 个字符")
  171. public String getTreeName() {
  172. return treeName;
  173. }
  174. public void setTreeName(String treeName) {
  175. this.treeName = treeName;
  176. }
  177. @Size(min=0, max=255, message="唯一编号长度不能超过 255 个字符")
  178. public String getSn() {
  179. return sn;
  180. }
  181. public void setSn(String sn) {
  182. this.sn = sn;
  183. }
  184. @Size(min=0, max=255, message="IP地址长度不能超过 255 个字符")
  185. public String getIp() {
  186. return ip;
  187. }
  188. public void setIp(String ip) {
  189. this.ip = ip;
  190. }
  191. public Integer getOnline() {
  192. return online;
  193. }
  194. public void setOnline(Integer online) {
  195. this.online = online;
  196. }
  197. public String getParentSn() {
  198. return parentSn;
  199. }
  200. public void setParentSn(String parentSn) {
  201. this.parentSn = parentSn;
  202. }
  203. public Integer getInterval() {
  204. return interval;
  205. }
  206. public void setInterval(Integer interval) {
  207. this.interval = interval;
  208. }
  209. public String getProductSn() {
  210. return productSn;
  211. }
  212. public void setProductSn(String productSn) {
  213. this.productSn = productSn;
  214. }
  215. public String getProductCate() {
  216. return productCate;
  217. }
  218. public void setProductCate(String productCate) {
  219. this.productCate = productCate;
  220. }
  221. public String getLineSn() {
  222. return lineSn;
  223. }
  224. public void setLineSn(String lineSn) {
  225. this.lineSn = lineSn;
  226. }
  227. public String getDeviceCode() {
  228. return deviceCode;
  229. }
  230. public void setDeviceCode(String deviceCode) {
  231. this.deviceCode = deviceCode;
  232. }
  233. }