企业微信推送接口、能源单耗

master
Yangwl 6 months ago
parent efca5b85b2
commit c64daab55f

@ -11,7 +11,7 @@ import java.util.Date;
public class ReportOrderEnergyDTO extends BaseEntity {
private String workorderId;
@Excel(name = "单号")
@Excel(name = "单号")
private String workorderCode;
@Excel(name = "产线编码")
private String workorderName;
@ -19,8 +19,14 @@ public class ReportOrderEnergyDTO extends BaseEntity {
private String equipmentName;
@Excel(name = "产品编码")
private String productCode;
@Excel(name = "品类")
private String category;
@Excel(name = "产品名称")
private String productName;
@Excel(name = "产线组长")
private String lineLeader;
@Excel(name = "规格")
private int umrez;
@Excel(name = "生产数量(箱)")
private int totalQuantityFeedback;
@Excel(name = "电表编号")
@ -66,6 +72,40 @@ public class ReportOrderEnergyDTO extends BaseEntity {
}
@Excel(name = "能耗KW·h")
private BigDecimal kw;
@Excel(name = "单箱电耗(电量/产能)")
private BigDecimal singleKw;
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
public String getLineLeader() {
return lineLeader;
}
public void setLineLeader(String lineLeader) {
this.lineLeader = lineLeader;
}
public int getUmrez() {
return umrez;
}
public void setUmrez(int umrez) {
this.umrez = umrez;
}
public BigDecimal getSingleKw() {
return singleKw;
}
public void setSingleKw(BigDecimal singleKw) {
this.singleKw = singleKw;
}
public BigDecimal getKw() {
return kw;

@ -1037,6 +1037,9 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService {
reportOrderEnergyDTOList.get(i).setEndKW(recordDnbInstantList.get(1).getZxyg());
reportOrderEnergyDTOList.get(i).setMultiplier(recordDnbInstantList.get(0).getCt());
reportOrderEnergyDTOList.get(i).setKw(kw);
BigDecimal totalQuantityFeedbackBD = new BigDecimal(reportOrderEnergyDTOList.get(i).getTotalQuantityFeedback());
reportOrderEnergyDTOList.get(i).setSingleKw(kw.divide(totalQuantityFeedbackBD, BigDecimal.ROUND_HALF_UP));
}
}
}

@ -55,6 +55,9 @@
<result property="productCode" column="product_code"/>
<result property="productDate" column="product_date"/>
<result property="productName" column="product_name"/>
<result property="umrez" column="umrez"/>
<result property="category" column="category"/>
<result property="lineLeader" column="line_leader"/>
<result property="totalQuantityFeedback" column="total_quantity_feedback"/>
<result property="electricityNo" column="electricity_no"/>
<result property="startWorkTime" column="start_work_time"/>
@ -261,29 +264,26 @@
order by m.parentName, m.monitor_name
</select>
<select id="OrderEnergyList" resultMap="ReportOrderEnergyDTOResult">
SELECT
pow.workorder_code_sap as workorder_code,
pow.workorder_name,
be.equipment_name,
pow.product_code,
pow.product_date,
pow.product_name,
mrw_summary.total_quantity_feedback,
pow.start_work_time,
pow.end_work_time,
be.attr2 AS electricity_no
FROM
pro_order_workorder pow
LEFT JOIN base_equipment be ON pow.workorder_name = be.equipment_code
LEFT JOIN (
SELECT
workorder_code,
SUM(quantity_feedback) AS total_quantity_feedback
FROM
mes_report_work
GROUP BY
workorder_code
) mrw_summary ON pow.workorder_code = mrw_summary.workorder_code
SELECT
pow.workorder_code_sap AS workorder_code,
pow.workorder_name,
be.equipment_name,
RIGHT ( pow.product_code, 11 ) AS product_code,
pow.product_date,
pow.product_name,
bp.umrez,
bpa.category,
mrw_summary.total_quantity_feedback,
mrw_summary.create_by as line_leader,
pow.start_work_time,
pow.end_work_time,
be.attr2 AS electricity_no
FROM
pro_order_workorder pow
LEFT JOIN base_equipment be ON pow.workorder_name = be.equipment_code
LEFT JOIN ( SELECT workorder_code, create_by, SUM ( quantity_feedback ) AS total_quantity_feedback FROM mes_report_work GROUP BY workorder_code, create_by ) mrw_summary ON pow.workorder_code = mrw_summary.workorder_code
LEFT JOIN base_product_attached bpa ON bpa.product_code = RIGHT ( pow.product_code, 11 )
LEFT JOIN base_product bp ON bp.product_code = pow.product_code
<where>
<if test="electricityNo != null and electricityNo != ''">and be.attr2 = #{electricityNo}</if>
<if test="workorderName != null and workorderName != ''">and pow.workorder_name like concat('%', #{workorderName}, '%')</if>
@ -292,7 +292,7 @@
and pow.product_date between #{params.beginTime} and #{params.endTime}
</if>
AND pow.status = 'w3'
AND pow.parent_order = '0';
AND pow.parent_order = '0'
</where>
</select>

@ -32,5 +32,4 @@ public class H5ApiController {
List<H5> list = h5ApiService.dailyProductDetil(workTime);
return list;
}
}

@ -6,8 +6,8 @@ public class H5 {
private String productName;
private String category;
private String specifications;
private String StandardStaffing;
private String actualEmployment;
private int StandardStaffing;
private int actualEmployment;
private String productionDuration;
private int planProduction;
private int production;
@ -83,19 +83,19 @@ public class H5 {
this.specifications = specifications;
}
public String getStandardStaffing() {
public int getStandardStaffing() {
return StandardStaffing;
}
public void setStandardStaffing(String standardStaffing) {
public void setStandardStaffing(int standardStaffing) {
StandardStaffing = standardStaffing;
}
public String getActualEmployment() {
public int getActualEmployment() {
return actualEmployment;
}
public void setActualEmployment(String actualEmployment) {
public void setActualEmployment(int actualEmployment) {
this.actualEmployment = actualEmployment;
}

@ -40,7 +40,7 @@
FORMAT(ROUND(
CASE
WHEN MAX(A.use_man) = 0 OR SUM(A.work_time) = 0 THEN NULL
ELSE SUM(mrw.quantity_feedback) / MAX(A.use_man) / SUM(A.work_time)
ELSE (SUM(mrw.quantity_feedback)) / MAX(A.use_man) / (MAX(A.work_time))
END,
1
), '0.#') AS actualEfficiency,
@ -52,7 +52,7 @@
ROUND(
CASE
WHEN MAX(A.use_man) = 0 OR SUM(A.work_time) = 0 THEN NULL
ELSE SUM(mrw.quantity_feedback) / MAX(A.use_man) / SUM(A.work_time)
ELSE (SUM(mrw.quantity_feedback)) / MAX(A.use_man) / (MAX(A.work_time))
END,
1
) AS DECIMAL(10,1))

Loading…
Cancel
Save