diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java index 278cde94..a660c983 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/MesReportWorkController.java @@ -631,10 +631,9 @@ public class MesReportWorkController extends BaseController { parammap.put("beginTime",beginTime); parammap.put("endTime",endTime); mesMonthReportVo.setParams(parammap); - List mapList = mesReportWorkService.getmonthProductionSut(mesMonthReportVo); - return success(mapList); + Map resultMap = mesReportWorkService.getmonthProductionSut(mesMonthReportVo); + return success(resultMap); } - } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesUnitpriceReport.java b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesUnitpriceReport.java index 1b6f800e..132bb19a 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/domain/MesUnitpriceReport.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/domain/MesUnitpriceReport.java @@ -6,6 +6,7 @@ import com.op.common.core.annotation.Excel; import com.op.common.core.web.domain.BaseEntity; import java.math.BigDecimal; +import java.util.Date; /** * 计件工资统计对象 mes_unitprice_report @@ -69,9 +70,9 @@ public class MesUnitpriceReport extends BaseEntity { private BigDecimal result; @Excel(name = "人数") private String headCount; - @Excel(name = "平均工资") + // @Excel(name = "平均工资") private String avgResult; - @Excel(name = "实际工资") + @Excel(name = "工时工资") private String realWages; @@ -90,7 +91,6 @@ public class MesUnitpriceReport extends BaseEntity { private String childprocessCode; - /** * $column.columnComment */ @@ -100,6 +100,7 @@ public class MesUnitpriceReport extends BaseEntity { * $column.columnComment */ // @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") + @Excel(name = "工时") private String attr2; public String getSapCode() { diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java index d11ffc30..d5f054e8 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesReportWorkMapper.java @@ -182,5 +182,9 @@ public interface MesReportWorkMapper { List getSumQuantity(QuantityDto quantityDto); + //当月产线产量汇总 List getmonthProductionSut(MesMonthReportVo mesMonthReportVo); + + //当月产线品类汇总 + List getmonthProductionSutCategory(MesMonthReportVo mesMonthReportVo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java index 0cd7e5b5..b4ff141c 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IMesReportWorkService.java @@ -137,5 +137,5 @@ public interface IMesReportWorkService { List getDailyReportNew(MesDailyReportVo mesDailyReportVo); - List getmonthProductionSut(MesMonthReportVo mesMonthReportVo); + Map getmonthProductionSut(MesMonthReportVo mesMonthReportVo); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java index 60b10a77..d39a4731 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/MesReportWorkServiceImpl.java @@ -839,15 +839,19 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService { @Override @DS("#header.poolName") - public List getmonthProductionSut(MesMonthReportVo mesMonthReportVo) { - List mapList=new ArrayList<>(); + public Map getmonthProductionSut(MesMonthReportVo mesMonthReportVo) { + Map map=new HashMap(); try { - mapList = mesReportWorkMapper.getmonthProductionSut(mesMonthReportVo); - + List mapList_one=new ArrayList<>(); + List mapList_two=new ArrayList<>(); + mapList_one = mesReportWorkMapper.getmonthProductionSut(mesMonthReportVo); + mapList_two = mesReportWorkMapper.getmonthProductionSutCategory(mesMonthReportVo); + map.put("mapList_one",mapList_one); + map.put("mapList_two",mapList_two); }catch (Exception e){ e.printStackTrace(); } - return mapList; + return map; } } diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index 1f46a3f5..b0f18603 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -930,6 +930,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + insert into mes_report_work diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesUnitpriceReportMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesUnitpriceReportMapper.xml index 4613a9ec..e9e42c62 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesUnitpriceReportMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesUnitpriceReportMapper.xml @@ -44,16 +44,18 @@ mur.product_code, mur.product_name, mur.line_code, - mur.attr2 AS real_wages, + mur.attr2, mur.remark, be.sap_name as equipment_name, mur.nick_name, mur.childprocess_code, mup.childprocess_name, mur.attr1 AS total_quantity, + CAST(mur.attr2 AS DECIMAL) * 16 AS real_wages, mup.attr1, mup.attr1*mur.attr1 AS result, - COUNT(*) OVER (PARTITION BY mur.workorder_code_sap, mur.childprocess_code) AS head_count + COUNT(*) OVER (PARTITION BY mur.workorder_code_sap, mur.childprocess_code) AS head_count, + mur.create_time FROM mes_unitprice_report mur LEFT JOIN @@ -82,12 +84,15 @@ and mur.line_code like concat('%', #{lineCode}, '%') - and be.equipment_name like concat('%', + and be.sap_name like concat('%', #{equipmentName}, '%') and attr1 = #{attr1} and attr2 = #{attr2} and attr3 = #{attr3} + + and mur.create_time between #{params.beginTime} and #{params.endTime} + GROUP BY mur.id, @@ -104,6 +109,7 @@ mur.childprocess_code, mup.childprocess_name, mrw.total_quantity, + mur.create_time, mup.attr1;