TwinCalcDay.java 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. package com.ruoyi.biz.domain;
  2. import com.fasterxml.jackson.annotation.JsonFormat;
  3. import com.ruoyi.biz.tools.Tools;
  4. import com.ruoyi.common.annotation.Excel;
  5. import com.ruoyi.common.core.domain.BaseEntity;
  6. import com.ruoyi.common.utils.bean.BeanUtils;
  7. import io.swagger.annotations.ApiModel;
  8. import io.swagger.annotations.ApiModelProperty;
  9. import org.apache.commons.lang3.builder.ToStringBuilder;
  10. import org.apache.commons.lang3.builder.ToStringStyle;
  11. import java.math.BigDecimal;
  12. import java.util.Date;
  13. /**
  14. * 日统计数据对象 twin_calc_day
  15. *
  16. * @author ruoyi
  17. * @date 2024-05-22
  18. */
  19. @ApiModel(value = "ITwinCalcDay", description = "日统计数据")
  20. public class TwinCalcDay extends BaseEntity {
  21. private static final long serialVersionUID = 1L;
  22. /**
  23. * ID
  24. */
  25. private Long id;
  26. /**
  27. * 时间
  28. */
  29. @JsonFormat(pattern = "yyyy-MM-dd")
  30. @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd")
  31. @ApiModelProperty("时间")
  32. private Date time;
  33. /**
  34. * 总米长
  35. */
  36. @Excel(name = "总米长")
  37. @ApiModelProperty("总米长")
  38. private BigDecimal length;
  39. /**
  40. * 总重量
  41. */
  42. @Excel(name = "总重量")
  43. @ApiModelProperty("总重量")
  44. private BigDecimal weight;
  45. /**
  46. * 稼动率
  47. */
  48. @Excel(name = "稼动率")
  49. @ApiModelProperty("稼动率")
  50. private BigDecimal efficiency;
  51. /**
  52. * 总电量
  53. */
  54. @Excel(name = "总电量")
  55. @ApiModelProperty("总电量")
  56. private BigDecimal kwh;
  57. /**
  58. * 告警数量
  59. */
  60. @Excel(name = "告警数量")
  61. @ApiModelProperty("告警数量")
  62. private Long alarm;
  63. /**
  64. * A班米长
  65. */
  66. @Excel(name = "A班米长")
  67. @ApiModelProperty("A班米长")
  68. private BigDecimal lengthA;
  69. /**
  70. * A班重量
  71. */
  72. @Excel(name = "A班重量")
  73. @ApiModelProperty("A班重量")
  74. private BigDecimal weightA;
  75. /**
  76. * A班稼动率
  77. */
  78. @Excel(name = "A班稼动率")
  79. @ApiModelProperty("A班稼动率")
  80. private BigDecimal efficiencyA;
  81. /**
  82. * A班开机时间
  83. */
  84. @Excel(name = "A班开机时间")
  85. @ApiModelProperty("A班开机时间")
  86. private BigDecimal openTimeA;
  87. /**
  88. * A班停机时间
  89. */
  90. @Excel(name = "A班停机时间")
  91. @ApiModelProperty("A班停机时间")
  92. private BigDecimal closeTimeA;
  93. /**
  94. * A班电量
  95. */
  96. @Excel(name = "A班电量")
  97. @ApiModelProperty("A班电量")
  98. private BigDecimal kwhA;
  99. /**
  100. * A班停经片停机
  101. */
  102. @Excel(name = "A班停经片停机")
  103. @ApiModelProperty("A班停经片停机")
  104. private Long stop1A;
  105. /**
  106. * A班CCD停机
  107. */
  108. @Excel(name = "A班CCD停机")
  109. @ApiModelProperty("A班CCD停机")
  110. private Long stop2A;
  111. /**
  112. * A班人工停机
  113. */
  114. @Excel(name = "A班人工停机")
  115. @ApiModelProperty("A班人工停机")
  116. private Long stop3A;
  117. /**
  118. * B班米长
  119. */
  120. @Excel(name = "B班米长")
  121. @ApiModelProperty("B班米长")
  122. private BigDecimal lengthB;
  123. /**
  124. * B班重量
  125. */
  126. @Excel(name = "B班重量")
  127. @ApiModelProperty("B班重量")
  128. private BigDecimal weightB;
  129. /**
  130. * B班稼动率
  131. */
  132. @Excel(name = "B班稼动率")
  133. @ApiModelProperty("B班稼动率")
  134. private BigDecimal efficiencyB;
  135. /**
  136. * B班开机时间
  137. */
  138. @Excel(name = "B班开机时间")
  139. @ApiModelProperty("B班开机时间")
  140. private BigDecimal openTimeB;
  141. /**
  142. * B班停机时间
  143. */
  144. @Excel(name = "B班停机时间")
  145. @ApiModelProperty("B班停机时间")
  146. private BigDecimal closeTimeB;
  147. /**
  148. * B班电量
  149. */
  150. @Excel(name = "B班电量")
  151. @ApiModelProperty("B班电量")
  152. private BigDecimal kwhB;
  153. /**
  154. * B班停经片停机
  155. */
  156. @Excel(name = "B班停经片停机")
  157. @ApiModelProperty("B班停经片停机")
  158. private Long stop1B;
  159. /**
  160. * B班CCD停机
  161. */
  162. @Excel(name = "B班CCD停机")
  163. @ApiModelProperty("B班CCD停机")
  164. private Long stop2B;
  165. /**
  166. * B班人工停机
  167. */
  168. @Excel(name = "B班人工停机")
  169. @ApiModelProperty("B班人工停机")
  170. private Long stop3B;
  171. /**
  172. * 创建人
  173. */
  174. @Excel(name = "创建人")
  175. @ApiModelProperty("创建人")
  176. private String createdBy;
  177. /**
  178. * 创建时间
  179. */
  180. @JsonFormat(pattern = "yyyy-MM-dd")
  181. @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
  182. @ApiModelProperty("创建时间")
  183. private Date createdTime;
  184. /**
  185. * 更新人
  186. */
  187. @Excel(name = "更新人")
  188. @ApiModelProperty("更新人")
  189. private String updatedBy;
  190. /**
  191. * 更新时间
  192. */
  193. @JsonFormat(pattern = "yyyy-MM-dd")
  194. @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
  195. @ApiModelProperty("更新时间")
  196. private Date updatedTime;
  197. /**
  198. * 从calc2hr转换为当前对象
  199. *
  200. * @param calc2hr 2小时统计的对象
  201. */
  202. public void convert(TwinCalc2hr calc2hr) {
  203. BeanUtils.copyProperties(calc2hr, this);
  204. this.time = calc2hr.getDataDate();
  205. // this.kwh = this.kwhA.add(this.kwhB);
  206. this.weight = this.weightA.add(this.weightB);
  207. this.length = this.lengthA.add(this.lengthB);
  208. this.efficiencyA = Tools.calcPercent(this.openTimeA, this.closeTimeA);
  209. this.efficiencyB = Tools.calcPercent(this.openTimeB, this.closeTimeB);
  210. BigDecimal totalOpenTime = this.openTimeA.add(this.openTimeB);
  211. BigDecimal totalCloseTime = this.closeTimeA.add(this.closeTimeB);
  212. this.efficiency = Tools.calcPercent(totalOpenTime, totalCloseTime);
  213. }
  214. public void setId(Long id) {
  215. this.id = id;
  216. }
  217. public Long getId() {
  218. return id;
  219. }
  220. public void setTime(Date time) {
  221. this.time = time;
  222. }
  223. public Date getTime() {
  224. return time;
  225. }
  226. public void setLength(BigDecimal length) {
  227. this.length = length;
  228. }
  229. public BigDecimal getLength() {
  230. return length;
  231. }
  232. public void setWeight(BigDecimal weight) {
  233. this.weight = weight;
  234. }
  235. public BigDecimal getWeight() {
  236. return weight;
  237. }
  238. public void setEfficiency(BigDecimal efficiency) {
  239. this.efficiency = efficiency;
  240. }
  241. public BigDecimal getEfficiency() {
  242. return efficiency;
  243. }
  244. public void setKwh(BigDecimal kwh) {
  245. this.kwh = kwh;
  246. }
  247. public BigDecimal getKwh() {
  248. return kwh;
  249. }
  250. public void setAlarm(Long alarm) {
  251. this.alarm = alarm;
  252. }
  253. public Long getAlarm() {
  254. return alarm;
  255. }
  256. public void setLengthA(BigDecimal lengthA) {
  257. this.lengthA = lengthA;
  258. }
  259. public BigDecimal getLengthA() {
  260. return lengthA;
  261. }
  262. public void setWeightA(BigDecimal weightA) {
  263. this.weightA = weightA;
  264. }
  265. public BigDecimal getWeightA() {
  266. return weightA;
  267. }
  268. public void setEfficiencyA(BigDecimal efficiencyA) {
  269. this.efficiencyA = efficiencyA;
  270. }
  271. public BigDecimal getEfficiencyA() {
  272. return efficiencyA;
  273. }
  274. public void setOpenTimeA(BigDecimal openTimeA) {
  275. this.openTimeA = openTimeA;
  276. }
  277. public BigDecimal getOpenTimeA() {
  278. return openTimeA;
  279. }
  280. public void setCloseTimeA(BigDecimal closeTimeA) {
  281. this.closeTimeA = closeTimeA;
  282. }
  283. public BigDecimal getCloseTimeA() {
  284. return closeTimeA;
  285. }
  286. public void setKwhA(BigDecimal kwhA) {
  287. this.kwhA = kwhA;
  288. }
  289. public BigDecimal getKwhA() {
  290. return kwhA;
  291. }
  292. public void setStop1A(Long stop1A) {
  293. this.stop1A = stop1A;
  294. }
  295. public Long getStop1A() {
  296. return stop1A;
  297. }
  298. public void setStop2A(Long stop2A) {
  299. this.stop2A = stop2A;
  300. }
  301. public Long getStop2A() {
  302. return stop2A;
  303. }
  304. public void setStop3A(Long stop3A) {
  305. this.stop3A = stop3A;
  306. }
  307. public Long getStop3A() {
  308. return stop3A;
  309. }
  310. public void setLengthB(BigDecimal lengthB) {
  311. this.lengthB = lengthB;
  312. }
  313. public BigDecimal getLengthB() {
  314. return lengthB;
  315. }
  316. public void setWeightB(BigDecimal weightB) {
  317. this.weightB = weightB;
  318. }
  319. public BigDecimal getWeightB() {
  320. return weightB;
  321. }
  322. public void setEfficiencyB(BigDecimal efficiencyB) {
  323. this.efficiencyB = efficiencyB;
  324. }
  325. public BigDecimal getEfficiencyB() {
  326. return efficiencyB;
  327. }
  328. public void setOpenTimeB(BigDecimal openTimeB) {
  329. this.openTimeB = openTimeB;
  330. }
  331. public BigDecimal getOpenTimeB() {
  332. return openTimeB;
  333. }
  334. public void setCloseTimeB(BigDecimal closeTimeB) {
  335. this.closeTimeB = closeTimeB;
  336. }
  337. public BigDecimal getCloseTimeB() {
  338. return closeTimeB;
  339. }
  340. public void setKwhB(BigDecimal kwhB) {
  341. this.kwhB = kwhB;
  342. }
  343. public BigDecimal getKwhB() {
  344. return kwhB;
  345. }
  346. public void setStop1B(Long stop1B) {
  347. this.stop1B = stop1B;
  348. }
  349. public Long getStop1B() {
  350. return stop1B;
  351. }
  352. public void setStop2B(Long stop2B) {
  353. this.stop2B = stop2B;
  354. }
  355. public Long getStop2B() {
  356. return stop2B;
  357. }
  358. public void setStop3B(Long stop3B) {
  359. this.stop3B = stop3B;
  360. }
  361. public Long getStop3B() {
  362. return stop3B;
  363. }
  364. public void setCreatedBy(String createdBy) {
  365. this.createdBy = createdBy;
  366. }
  367. public String getCreatedBy() {
  368. return createdBy;
  369. }
  370. public void setCreatedTime(Date createdTime) {
  371. this.createdTime = createdTime;
  372. }
  373. public Date getCreatedTime() {
  374. return createdTime;
  375. }
  376. public void setUpdatedBy(String updatedBy) {
  377. this.updatedBy = updatedBy;
  378. }
  379. public String getUpdatedBy() {
  380. return updatedBy;
  381. }
  382. public void setUpdatedTime(Date updatedTime) {
  383. this.updatedTime = updatedTime;
  384. }
  385. public Date getUpdatedTime() {
  386. return updatedTime;
  387. }
  388. @Override
  389. public String toString() {
  390. return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
  391. .append("id", getId())
  392. .append("time", getTime())
  393. .append("length", getLength())
  394. .append("weight", getWeight())
  395. .append("efficiency", getEfficiency())
  396. .append("kwh", getKwh())
  397. .append("alarm", getAlarm())
  398. .append("lengthA", getLengthA())
  399. .append("weightA", getWeightA())
  400. .append("efficiencyA", getEfficiencyA())
  401. .append("openTimeA", getOpenTimeA())
  402. .append("closeTimeA", getCloseTimeA())
  403. .append("kwhA", getKwhA())
  404. .append("stop1A", getStop1A())
  405. .append("stop2A", getStop2A())
  406. .append("stop3A", getStop3A())
  407. .append("lengthB", getLengthB())
  408. .append("weightB", getWeightB())
  409. .append("efficiencyB", getEfficiencyB())
  410. .append("openTimeB", getOpenTimeB())
  411. .append("closeTimeB", getCloseTimeB())
  412. .append("kwhB", getKwhB())
  413. .append("stop1B", getStop1B())
  414. .append("stop2B", getStop2B())
  415. .append("stop3B", getStop3B())
  416. .append("createdBy", getCreatedBy())
  417. .append("createdTime", getCreatedTime())
  418. .append("updatedBy", getUpdatedBy())
  419. .append("updatedTime", getUpdatedTime())
  420. .append("remark", getRemark())
  421. .toString();
  422. }
  423. }