计件工资、月度报表修改

master
Yangwl 7 months ago
parent 79cf66af1f
commit 845fc2fa00

@ -631,10 +631,9 @@ public class MesReportWorkController extends BaseController {
parammap.put("beginTime",beginTime); parammap.put("beginTime",beginTime);
parammap.put("endTime",endTime); parammap.put("endTime",endTime);
mesMonthReportVo.setParams(parammap); mesMonthReportVo.setParams(parammap);
List<Map> mapList = mesReportWorkService.getmonthProductionSut(mesMonthReportVo); Map resultMap = mesReportWorkService.getmonthProductionSut(mesMonthReportVo);
return success(mapList); return success(resultMap);
} }
} }

@ -6,6 +6,7 @@ import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity; import com.op.common.core.web.domain.BaseEntity;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date;
/** /**
* mes_unitprice_report * mes_unitprice_report
@ -69,9 +70,9 @@ public class MesUnitpriceReport extends BaseEntity {
private BigDecimal result; private BigDecimal result;
@Excel(name = "人数") @Excel(name = "人数")
private String headCount; private String headCount;
@Excel(name = "平均工资") // @Excel(name = "平均工资")
private String avgResult; private String avgResult;
@Excel(name = "实际工资") @Excel(name = "工时工资")
private String realWages; private String realWages;
@ -90,7 +91,6 @@ public class MesUnitpriceReport extends BaseEntity {
private String childprocessCode; private String childprocessCode;
/** /**
* $column.columnComment * $column.columnComment
*/ */
@ -100,6 +100,7 @@ public class MesUnitpriceReport extends BaseEntity {
* $column.columnComment * $column.columnComment
*/ */
// @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") // @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
@Excel(name = "工时")
private String attr2; private String attr2;
public String getSapCode() { public String getSapCode() {

@ -182,5 +182,9 @@ public interface MesReportWorkMapper {
List<QuantityDto> getSumQuantity(QuantityDto quantityDto); List<QuantityDto> getSumQuantity(QuantityDto quantityDto);
//当月产线产量汇总
List<Map> getmonthProductionSut(MesMonthReportVo mesMonthReportVo); List<Map> getmonthProductionSut(MesMonthReportVo mesMonthReportVo);
//当月产线品类汇总
List<Map> getmonthProductionSutCategory(MesMonthReportVo mesMonthReportVo);
} }

@ -137,5 +137,5 @@ public interface IMesReportWorkService {
List<MesDailyReportVo> getDailyReportNew(MesDailyReportVo mesDailyReportVo); List<MesDailyReportVo> getDailyReportNew(MesDailyReportVo mesDailyReportVo);
List<Map> getmonthProductionSut(MesMonthReportVo mesMonthReportVo); Map getmonthProductionSut(MesMonthReportVo mesMonthReportVo);
} }

@ -839,15 +839,19 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public List<Map> getmonthProductionSut(MesMonthReportVo mesMonthReportVo) { public Map getmonthProductionSut(MesMonthReportVo mesMonthReportVo) {
List<Map> mapList=new ArrayList<>(); Map map=new HashMap();
try { try {
mapList = mesReportWorkMapper.getmonthProductionSut(mesMonthReportVo); List<Map> mapList_one=new ArrayList<>();
List<Map> 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){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }
return mapList; return map;
} }
} }

@ -930,6 +930,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getmonthProductionSut" statementType="CALLABLE" resultType="java.util.Map" parameterType="MesMonthReportVo"> <select id="getmonthProductionSut" statementType="CALLABLE" resultType="java.util.Map" parameterType="MesMonthReportVo">
{CALL GeneratePivotReport(#{params.beginTime, jdbcType=DATE}, #{params.endTime, jdbcType=DATE})} {CALL GeneratePivotReport(#{params.beginTime, jdbcType=DATE}, #{params.endTime, jdbcType=DATE})}
</select> </select>
<select id="getmonthProductionSutCategory" statementType="CALLABLE" resultType="java.util.Map" parameterType="MesMonthReportVo">
{CALL GeneratePivotReportCategory(#{params.beginTime, jdbcType=DATE}, #{params.endTime, jdbcType=DATE})}
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork"> <insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work insert into mes_report_work

@ -44,16 +44,18 @@
mur.product_code, mur.product_code,
mur.product_name, mur.product_name,
mur.line_code, mur.line_code,
mur.attr2 AS real_wages, mur.attr2,
mur.remark, mur.remark,
be.sap_name as equipment_name, be.sap_name as equipment_name,
mur.nick_name, mur.nick_name,
mur.childprocess_code, mur.childprocess_code,
mup.childprocess_name, mup.childprocess_name,
mur.attr1 AS total_quantity, mur.attr1 AS total_quantity,
CAST(mur.attr2 AS DECIMAL) * 16 AS real_wages,
mup.attr1, mup.attr1,
mup.attr1*mur.attr1 AS result, 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 FROM
mes_unitprice_report mur mes_unitprice_report mur
LEFT JOIN LEFT JOIN
@ -82,12 +84,15 @@
<if test="lineCode != null and lineCode != ''">and mur.line_code like concat('%', <if test="lineCode != null and lineCode != ''">and mur.line_code like concat('%',
#{lineCode}, '%') #{lineCode}, '%')
</if> </if>
<if test="equipmentName != null and equipmentName != ''">and be.equipment_name like concat('%', <if test="equipmentName != null and equipmentName != ''">and be.sap_name like concat('%',
#{equipmentName}, '%') #{equipmentName}, '%')
</if> </if>
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if>
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
and mur.create_time between #{params.beginTime} and #{params.endTime}
</if>
</where> </where>
GROUP BY GROUP BY
mur.id, mur.id,
@ -104,6 +109,7 @@
mur.childprocess_code, mur.childprocess_code,
mup.childprocess_name, mup.childprocess_name,
mrw.total_quantity, mrw.total_quantity,
mur.create_time,
mup.attr1; mup.attr1;
</select> </select>

Loading…
Cancel
Save