|
@@ -0,0 +1,76 @@
|
|
|
|
+package com.jjt.biz.vo;
|
|
|
|
+
|
|
|
|
+import io.swagger.annotations.ApiModel;
|
|
|
|
+import io.swagger.annotations.ApiModelProperty;
|
|
|
|
+import lombok.Data;
|
|
|
|
+import lombok.NoArgsConstructor;
|
|
|
|
+
|
|
|
|
+import java.math.BigDecimal;
|
|
|
|
+import java.math.RoundingMode;
|
|
|
|
+import java.util.Random;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * 生产趋势视图
|
|
|
|
+ *
|
|
|
|
+ * @author ruoyi
|
|
|
|
+ * @date 2024-12-30
|
|
|
|
+ */
|
|
|
|
+@ApiModel(value = "YrProdEfficiencyVO", description = "印染生产效率")
|
|
|
|
+@Data
|
|
|
|
+@NoArgsConstructor
|
|
|
|
+public class YrProdEfficiencyVO {
|
|
|
|
+ @ApiModelProperty("产线,如果为0就表示全部")
|
|
|
|
+ private Integer line;
|
|
|
|
+ @ApiModelProperty("产线开机数")
|
|
|
|
+ private Integer open;
|
|
|
|
+ @ApiModelProperty("产线总设备数")
|
|
|
|
+ private Integer total;
|
|
|
|
+ @ApiModelProperty("单位能耗")
|
|
|
|
+ private BigDecimal energy;
|
|
|
|
+ @ApiModelProperty("开机率")
|
|
|
|
+ private BigDecimal ratio;
|
|
|
|
+ @ApiModelProperty("米长")
|
|
|
|
+ private BigDecimal length;
|
|
|
|
+ @ApiModelProperty("重量")
|
|
|
|
+ private BigDecimal weight;
|
|
|
|
+ @ApiModelProperty("A班开机时间")
|
|
|
|
+ private BigDecimal timeA;
|
|
|
|
+ @ApiModelProperty("B班开机时间")
|
|
|
|
+ private BigDecimal timeB;
|
|
|
|
+ @ApiModelProperty("A班米长")
|
|
|
|
+ private BigDecimal lengthA;
|
|
|
|
+ @ApiModelProperty("B班米长")
|
|
|
|
+ private BigDecimal lengthB;
|
|
|
|
+ @ApiModelProperty("A班重量")
|
|
|
|
+ private BigDecimal weightA;
|
|
|
|
+ @ApiModelProperty("B班重量")
|
|
|
|
+ private BigDecimal weightB;
|
|
|
|
+ @ApiModelProperty("A班稼动率")
|
|
|
|
+ private BigDecimal effA;
|
|
|
|
+ @ApiModelProperty("B班稼动率")
|
|
|
|
+ private BigDecimal effB;
|
|
|
|
+
|
|
|
|
+ public YrProdEfficiencyVO(Integer line) {
|
|
|
|
+ this.line = line;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void mock() {
|
|
|
|
+ Integer[] total = {267, 38, 36, 35, 35, 30, 31, 32, 30};
|
|
|
|
+ Integer[] open = {88, 28, 26, 25, 25, 20, 21, 22, 20};
|
|
|
|
+ Random random = new Random();
|
|
|
|
+ this.total = total[line];
|
|
|
|
+ this.open = open[line];
|
|
|
|
+ this.energy = BigDecimal.valueOf(2.5d);
|
|
|
|
+ this.ratio = BigDecimal.valueOf(this.open).divide(BigDecimal.valueOf(this.total), 0, RoundingMode.HALF_UP);
|
|
|
|
+ this.lengthA = BigDecimal.valueOf(3000 + 3000 * random.nextDouble()).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
+ this.lengthB = BigDecimal.valueOf(3000 + 3000 * random.nextDouble()).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
+ this.length = this.lengthA.add(this.lengthB);
|
|
|
|
+ this.weightA = BigDecimal.valueOf(20 + 20 * random.nextDouble()).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
+ this.weightB = BigDecimal.valueOf(20 + 20 * random.nextDouble()).setScale(2, RoundingMode.HALF_UP);
|
|
|
|
+ this.weight = this.weightA.add(this.weightB);
|
|
|
|
+ this.timeA = BigDecimal.valueOf(5 + random.nextInt(7));
|
|
|
|
+ this.timeB = BigDecimal.valueOf(5 + random.nextInt(7));
|
|
|
|
+ this.effA = timeA.divide(BigDecimal.valueOf(12), 2, RoundingMode.HALF_UP);
|
|
|
|
+ this.effB = timeB.divide(BigDecimal.valueOf(12), 2, RoundingMode.HALF_UP);
|
|
|
|
+ }
|
|
|
|
+}
|