质量报表相关

master
zhaoxiaolin 8 months ago
parent 6af7ebdc92
commit d082384d27

@ -95,10 +95,18 @@ public class MesDailyReportVo extends BaseEntity {
private String workCenter;
private String equipmentTypeCode;
private String reason;
private String machineCode;
private BigDecimal reportRate;
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public BigDecimal getReportRate() {
return reportRate;
}

@ -188,4 +188,6 @@ public interface MesReportWorkMapper {
//当月产线产量汇总
//当月产线品类汇总
List<Map> getmonthProductionSutCategory(MesMonthReportVo mesMonthReportVo);
String getProductReason(QuantityDto quantityDto);
}

@ -424,6 +424,12 @@ public class MesReportWorkServiceImpl implements IMesReportWorkService {
quantityDto.setWorkorderCode(workorderCode);
quantityDto.setMachineCode(machineCode);
//影响效率原因
String reasons = mesReportWorkMapper.getProductReason(quantityDto);
if(!reasons.equals(";;")&&StringUtils.isNotBlank(reasons)){
dto.setReason(reasons);
}
QuantityDto parentMesReport = mesReportWorkMapper.getRealQuantity(quantityDto);
QuantityDto sonMesReport = mesReportWorkMapper.getSumQuantity(quantityDto);
if(sonMesReport == null){//单层工单的情况

@ -953,6 +953,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getmonthProductionSutCategory" statementType="CALLABLE" resultType="java.util.Map" parameterType="MesMonthReportVo">
{CALL GeneratePivotReportCategory(#{params.beginTime, jdbcType=DATE}, #{params.endTime, jdbcType=DATE})}
</select>
<select id="getProductReason" resultType="java.lang.String">
SELECT
STRING_AGG(Reason, ';') AS Reasons
FROM
mes_report_work where workorder_code = #{workorderCode} and del_flag = '0'
GROUP BY
workorder_code;
</select>
<insert id="insertMesReportWork" parameterType="MesReportWork">
insert into mes_report_work

@ -104,4 +104,11 @@ public class QcDefectTypeClassController extends BaseController {
List<QcDefectTypeClass> list = qcDefectTypeClassService.getClassInfoList(qcDefectTypeClass);
return success(list);
}
@GetMapping("/getClassInfoListByCheckType")
@DS("#header.poolName")
public AjaxResult getClassInfoListByCheckType(QcDefectTypeClass qcDefectTypeClass) {
List<QcDefectTypeClass> list = qcDefectTypeClassService.getClassInfoListByCheckType(qcDefectTypeClass);
return success(list);
}
}

@ -8,6 +8,7 @@ import com.op.common.log.annotation.Log;
import com.op.common.log.enums.BusinessType;
import com.op.common.security.annotation.RequiresPermissions;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcDefectType;
import com.op.quality.service.IQcDefectTypeService;
import org.springframework.beans.factory.annotation.Autowired;
@ -95,4 +96,10 @@ public class QcDefectTypeController extends BaseController {
List<QcDefectType> list = qcDefectTypeService.getDefectTypeListByDefectType(defectType);
return getDataTable(list);
}
@GetMapping("/getCheckTypes")
public List<QcCheckType> getCheckTypes(QcCheckType qcCheckType) {
List<QcCheckType> list = qcDefectTypeService.getCheckTypes(qcCheckType);
return list;
}
}

@ -75,9 +75,18 @@ public class QcDefectType extends BaseEntity {
// 创建日期结束
private String createTimeEnd;
private String checkType;
private String checkName;
private BigDecimal ratio;
public String getCheckName() {
return checkName;
}
public void setCheckName(String checkName) {
this.checkName = checkName;
}
public String getCheckType() {
return checkType;
}

@ -48,6 +48,15 @@ private static final long serialVersionUID=1L;
/** 删除标志 */
private String delFlag;
private String sort;
private String checkType;
public String getCheckType() {
return checkType;
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getSort() {
return sort;

@ -61,4 +61,6 @@ public interface QcDefectTypeClassMapper {
public int deleteQcDefectTypeClassByIds(String[] ids);
List<QcDefectTypeClass> getClassInfoList(QcDefectTypeClass qcDefectTypeClass);
List<QcDefectTypeClass> getClassInfoListByCheckType(QcDefectTypeClass qcDefectTypeClass);
}

@ -1,5 +1,6 @@
package com.op.quality.mapper;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcDefectType;
import org.apache.ibatis.annotations.Mapper;
@ -70,4 +71,5 @@ public interface QcDefectTypeMapper {
public List<QcDefectType> getDefectTypeListByDefectType(String defectType);
List<QcCheckType> getCheckTypes(QcCheckType qcCheckType);
}

@ -62,4 +62,6 @@ public interface IQcDefectTypeClassService {
public int deleteQcDefectTypeClassById(String id);
List<QcDefectTypeClass> getClassInfoList(QcDefectTypeClass qcDefectTypeClass);
List<QcDefectTypeClass> getClassInfoListByCheckType(QcDefectTypeClass qcDefectTypeClass);
}

@ -1,6 +1,7 @@
package com.op.quality.service;
import com.op.common.core.web.domain.AjaxResult;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcDefectType;
import java.util.List;
@ -61,4 +62,6 @@ public interface IQcDefectTypeService {
public int deleteQcDefectTypeByDefectId(String defectId);
public List<QcDefectType> getDefectTypeListByDefectType(String defectType);
List<QcCheckType> getCheckTypes(QcCheckType qcCheckType);
}

@ -800,7 +800,11 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
defect = new QcCheckTaskDefect();
defect.setDefectCode(defectCodes[d]);
defect.setDefectSubclass(defectNames[d].split(":")[0]);
defect.setClassId(classIds[d]);
if(d < classIds.length){
defect.setClassId(classIds[d]);
}else{
defect.setClassId("");
}
defect.setNoOkQuality(new BigDecimal(defectQualitys[d]));
defect.setRecordId(IdUtils.fastSimpleUUID());
defect.setCreateTime(nowTime);
@ -928,7 +932,11 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
defect.setDefectCode(defectCodes[d]);
defect.setDefectSubclass(defectNames[d].split(":")[0]);
defect.setNoOkQuality(new BigDecimal(defectQualitys[d]));
defect.setClassId(classIds[d]);
if(d < classIds.length){
defect.setClassId(classIds[d]);
}else{
defect.setClassId("");
}
defect.setRecordId(IdUtils.fastSimpleUUID());
defect.setCreateTime(nowTime);
defect.setCreateBy(updateBy);
@ -1211,7 +1219,10 @@ public class QcCheckTaskIncomeServiceImpl<QcCheckUnqualifiedService> implements
}
public static void main(String args[]){
QcCheckTaskIncomeServiceImpl impl = new QcCheckTaskIncomeServiceImpl();
System.out.println(impl.getConvertUnit("ST"));
String str = "11,,22,";
System.out.println(str.split(",")[0]);
System.out.println(str.split(",")[1]);
System.out.println(str.split(",")[2]);
}
}

@ -107,5 +107,8 @@ public class QcDefectTypeClassServiceImpl implements IQcDefectTypeClassService {
return qcDefectTypeClassMapper.getClassInfoList(qcDefectTypeClass);
}
@Override
public List<QcDefectTypeClass> getClassInfoListByCheckType(QcDefectTypeClass qcDefectTypeClass) {
return qcDefectTypeClassMapper.getClassInfoListByCheckType(qcDefectTypeClass);
}
}

@ -5,6 +5,7 @@ import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.quality.domain.QcCheckType;
import com.op.quality.domain.QcDefectType;
import com.op.quality.mapper.QcDefectTypeMapper;
import com.op.quality.service.IQcDefectTypeService;
@ -172,4 +173,11 @@ public class QcDefectTypeServiceImpl implements IQcDefectTypeService {
public List<QcDefectType> getDefectTypeListByDefectType(String defectType) {
return qcDefectTypeMapper.getDefectTypeListByDefectType(defectType);
}
@Override
@DS("#header.poolName")
public List<QcCheckType> getCheckTypes(QcCheckType qcCheckType) {
return qcDefectTypeMapper.getCheckTypes(qcCheckType);
}
}

@ -570,13 +570,19 @@
order by qctd.defect_code
</select>
<select id="getDefectType" resultType="com.op.quality.domain.QcCheckTaskDefect">
select
<!--select
defect_code defectCode,
defect_subclass defectSubclass
from qc_defect_type qdt
left join qc_check_type qct on qdt.defect_type = qct.type_code
where qct.order_code = #{checkType} and qdt.del_flag = '0'
order by qdt.defect_code
order by qdt.defect_code-->
select
defect_code defectCode,
defect_subclass defectSubclass
from qc_defect_type qdt
where qdt.defect_type = #{checkType} and qdt.del_flag = '0'
order by qdt.defect_code
</select>
<select id="getTaskInfo" resultType="com.op.quality.domain.QcCheckTaskIncome">

@ -141,12 +141,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by wpp.create_time desc
</select>
<select id="getDefectListPDA" resultType="com.op.quality.domain.QcDefectType">
select qdt.defect_code defectCode,
<!--select qdt.defect_code defectCode,
qdt.defect_subclass defectSubclass
from qc_defect_type qdt
left join qc_check_type qct on qdt.defect_type = qct.type_code
where qct.order_code = #{checkType} and qdt.del_flag='0'
order by qdt.create_time
order by qdt.create_time-->
select
defect_code defectCode,
defect_subclass defectSubclass
from qc_defect_type qdt
where qdt.defect_type = #{checkType} and qdt.del_flag = '0'
order by qdt.defect_code
</select>
<insert id="insertQcCheckUnqualified" parameterType="QcCheckUnqualified">

@ -68,6 +68,14 @@
and del_flag = '0'
order by sort
</select>
<select id="getClassInfoListByCheckType" resultType="com.op.quality.domain.QcDefectTypeClass">
select id,
class_name className
from qc_defect_type_class
where defect_code in(select defect_code from qc_defect_type where del_flag='0' and defect_type = #{checkType})
and del_flag = '0'
order by sort
</select>
<insert id="insertQcDefectTypeClass" parameterType="QcDefectTypeClass">
insert into qc_defect_type_class

@ -20,6 +20,8 @@
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="ratio" column="ratio" />
<result property="checkName" column="check_name"/>
</resultMap>
<sql id="selectQcDefectTypeVo">
@ -30,30 +32,29 @@
</sql>
<select id="selectQcDefectTypeList" parameterType="QcDefectType" resultMap="QcDefectTypeResult">
<include refid="selectQcDefectTypeVo"/>
select qdt.defect_id, qdt.defect_code, qdt.defect_type, qdt.defect_subclass, qdt.defect_remark,
qdt.factory_code, qdt.attr1, qdt.attr2, qdt.attr3,
qdt.create_by, qdt.create_time, qdt.update_by, qdt.update_time,qdt.ratio,qct.check_name
from qc_defect_type qdt
left join qc_check_type qct on qdt.defect_type = qct.id
<where>
<if test="defectCode != null and defectCode != ''">and defect_code like concat('%', #{defectCode}, '%')
<if test="defectCode != null and defectCode != ''">and qdt.defect_code like concat('%', #{defectCode}, '%')
</if>
<if test="defectType != null and defectType != ''">and defect_type like concat('%', #{defectType}, '%')
<if test="defectType != null and defectType != ''">and qdt.defect_type = #{defectType}
</if>
<if test="defectSubclass != null and defectSubclass != ''">and defect_subclass like concat('%',
<if test="defectSubclass != null and defectSubclass != ''">and qdt.defect_subclass like concat('%',
#{defectSubclass}, '%')
</if>
<if test="defectRemark != null and defectRemark != ''">and defect_remark = #{defectRemark}</if>
<if test="factoryCode != null and factoryCode != ''">and factory_code = #{factoryCode}</if>
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if>
<if test="delFlag != null and delFlag != ''">and del_flag = #{delFlag}</if>
<if test="createTimeStart != null ">and CONVERT(date,create_time) >= #{createTimeStart}</if>
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(date,create_time)</if>
<if test="createBy != null and createBy != ''">and create_by like concat('%', #{createBy}, '%')</if>
<if test="updateTimeStart != null ">and CONVERT(date,update_time) >= #{updateTimeStart}</if>
<if test="updateTimeEnd != null ">and #{updateTimeEnd} >= CONVERT(date,update_time)</if>
<if test="updateBy != null and updateBy != ''">and update_by like concat('%', #{updateBy}, '%')</if>
and del_flag = '0'
<if test="defectRemark != null and defectRemark != ''">and qdt.defect_remark = #{defectRemark}</if>
<if test="createTimeStart != null ">and CONVERT(date,qdt.create_time) >= #{createTimeStart}</if>
<if test="createTimeEnd != null ">and #{createTimeEnd} >= CONVERT(date,qdt.create_time)</if>
<if test="createBy != null and createBy != ''">and qdt.create_by like concat('%', #{createBy}, '%')</if>
<if test="updateTimeStart != null ">and CONVERT(date,qdt.update_time) >= #{updateTimeStart}</if>
<if test="updateTimeEnd != null ">and #{updateTimeEnd} >= CONVERT(date,qdt.update_time)</if>
<if test="updateBy != null and updateBy != ''">and qdt.update_by like concat('%', #{updateBy}, '%')</if>
and qdt.del_flag = '0' and qct.del_flag = '0'
</where>
ORDER BY create_time DESC
ORDER BY qct.check_name DESC
</select>
<select id="selectQcDefectTypeByDefectId" parameterType="String" resultMap="QcDefectTypeResult">
@ -142,4 +143,7 @@
where defect_type = #{defectType}
order by defect_code
</select>
<select id="getCheckTypes" resultType="com.op.quality.domain.QcCheckType">
select id,check_name checkName from qc_check_type where del_flag = '0' order by type_code
</select>
</mapper>

@ -491,10 +491,15 @@
GROUP by qctd.belong_to,qctd.belong_to_detail
</select>
<select id="getTableHzTitle" resultType="java.lang.String">
select dtc.class_name
<!--select dtc.class_name
from qc_defect_type dt
left join qc_defect_type_class dtc on dt.defect_code = dtc.defect_code
where dt.defect_type in (select type_code from qc_check_type where order_code = #{remark} and del_flag = '0')
and dtc.del_flag = '0' order by dtc.sort-->
select dtc.class_name
from qc_defect_type dt
left join qc_defect_type_class dtc on dt.defect_code = dtc.defect_code
where dt.defect_type = #{remark}
and dtc.del_flag = '0' order by dtc.sort
</select>
<select id="getTableHzTitle2" resultType="java.lang.String">

Loading…
Cancel
Save