MesDevice.java 7.5 KB

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