产品转换/完产清线点检表等逻辑修改

master
Yangwl 2 months ago
parent cab780b4df
commit 20cf1b58a6

@ -84,7 +84,16 @@ public class MesInspectionReport extends BaseEntity {
private String clearLine; private String clearLine;
//班组 //班组
private String team; private String team;
//班次
private String shiftId;
public String getShiftId() {
return shiftId;
}
public void setShiftId(String shiftId) {
this.shiftId = shiftId;
}
public void setId(String id) { this.id = id; } public void setId(String id) { this.id = id; }
public String getId() { return id; } public String getId() { return id; }

@ -57,7 +57,6 @@ public class MesInspectionReportServiceImpl implements IMesInspectionReportServi
dto.setProjectName(project.getProjectName());//项目名 dto.setProjectName(project.getProjectName());//项目名
dto.setProjectCode(project.getProjectCode());//项目编码 dto.setProjectCode(project.getProjectCode());//项目编码
dynamicTime.put("开始-结束",dto); dynamicTime.put("开始-结束",dto);
if(CollectionUtils.isEmpty(timeArray)){ if(CollectionUtils.isEmpty(timeArray)){
dynamicTime.put("", new MesInspectionReport()); dynamicTime.put("", new MesInspectionReport());
dynamicTime.put(" ", new MesInspectionReport()); dynamicTime.put(" ", new MesInspectionReport());

@ -32,10 +32,10 @@
<result property="timeArray" column="timeArray"/> <result property="timeArray" column="timeArray"/>
<result property="equipmentCode" column="equipment_code"/> <result property="equipmentCode" column="equipment_code"/>
<result property="equipmentName" column="equipment_name"/> <result property="equipmentName" column="equipment_name"/>
<result property="projectName" column="project_name"/> <result property="projectName" column="project_name"/>
<result property="lineName" column="line_name"/> <result property="lineName" column="line_name"/>
<result property="workorderId" column="workorder_id"/> <result property="workorderId" column="workorder_id"/>
<result property="shiftId" column="shiftId"/>
</resultMap> </resultMap>
<select id="selectSelfMutualInspectionList" resultMap="MesInspectionReportResult" parameterType="MesInspectionReport"> <select id="selectSelfMutualInspectionList" resultMap="MesInspectionReportResult" parameterType="MesInspectionReport">
@ -92,8 +92,16 @@
and mtsd.del_flag = '0' and mtsd.del_flag = '0'
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate}) and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
and mts.line_code = #{lineCode} and mts.line_code = #{lineCode}
and mts.report_name = #{reportName} <choose>
and mtsd.table_line is not null <when test="shiftId != null">
AND mts.report_name = CONCAT(#{reportName}, (SELECT Shift_Desc FROM base_shifts_t WHERE Shift_Id = #{shiftId}))
</when>
<otherwise>
AND mts.report_name = #{reportName}
</otherwise>
</choose>
</where> </where>
group by mtsd.check_time_s , mtsd.check_time_e , mtsd.table_line group by mtsd.check_time_s , mtsd.check_time_e , mtsd.table_line
order by mtsd.check_time_s order by mtsd.check_time_s
@ -109,7 +117,14 @@
and mtsd.del_flag = '0' and mtsd.del_flag = '0'
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate}) and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
and mts.line_code = #{lineCode} and mts.line_code = #{lineCode}
and mts.report_name = #{reportName} <choose>
<when test="shiftId != null">
AND mts.report_name = CONCAT(#{reportName}, (SELECT Shift_Desc FROM base_shifts_t WHERE Shift_Id = #{shiftId}))
</when>
<otherwise>
AND mts.report_name = #{reportName}
</otherwise>
</choose>
group by mtsd.remark group by mtsd.remark
order by mtsd.remark order by mtsd.remark
</select> </select>
@ -127,14 +142,23 @@
mts.create_by mts.create_by
from mes_table_self mts from mes_table_self mts
where 1=1 where 1=1
<if test="reportName == 'CheckReport'"> <choose>
and report_name = #{reportName} <when test="shiftId != null and reportName = 'CheckReport'">
and report_name = CONCAT(#{reportName}, (SELECT Shift_Desc FROM base_shifts_t WHERE Shift_Id = #{shiftId}))
and line_code = #{lineCode} and line_code = #{lineCode}
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate}) and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
</if> </when>
<if test="reportName != 'CheckReport'"> <when test="shiftId = null and reportName = 'CheckReport'">
AND mts.report_name = #{reportName}
and line_code = #{lineCode}
and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate})
</when>
<otherwise>
and id = #{id} and id = #{id}
</if> </otherwise>
</choose>
and del_flag = '0' and del_flag = '0'
</select> </select>
@ -149,23 +173,31 @@
select select
mts.id, mts.id,
pow.workorder_id, pow.workorder_id,
mts.product_name, pow.product_name,
mts.product_code pow.product_code
from mes_table_self mts from mes_table_self mts
left join pro_order_workorder pow on mts.product_code = pow.product_code left join pro_order_workorder pow on mts.line_code = pow.workorder_name
LEFT JOIN base_shifts_t bst ON pow.shift_id = bst.Shift_Id
where DATEDIFF(DAY, mts.check_date, #{checkDate}) = 0 where DATEDIFF(DAY, mts.check_date, #{checkDate}) = 0
and DATEDIFF(DAY, pow.product_date, #{checkDate}) = 0 and DATEDIFF(DAY, pow.product_date, #{checkDate}) = 0
and mts.del_flag = '0' and mts.del_flag = '0'
and mts.product_code is not null AND mts.product_code!= ''
and pow.del_flag = '0' and pow.del_flag = '0'
and mts.report_name = #{reportName} and pow.parent_order = '0'
<choose>
<when test="shiftId != null">
AND mts.report_name = CONCAT(#{reportName}, bst.Shift_Desc)
</when>
<otherwise>
AND mts.report_name = #{reportName}
</otherwise>
</choose>
and mts.line_code = #{lineCode} and mts.line_code = #{lineCode}
and pow.workorder_name = #{lineCode} and pow.workorder_name = #{lineCode}
group by group by
mts.id, mts.id,
pow.workorder_id, pow.workorder_id,
mts.product_name, pow.product_name,
mts.product_code pow.product_code
</select> </select>
<select id="getDataCodeList" resultType ="com.op.mes.domain.ProOrderWorkorder" parameterType="MesInspectionReport"> <select id="getDataCodeList" resultType ="com.op.mes.domain.ProOrderWorkorder" parameterType="MesInspectionReport">

Loading…
Cancel
Save