|
|
@ -45,7 +45,9 @@ public class AssemblyPartReportDaoImpl implements IAssemblyPartReportDao {
|
|
|
|
dataQueryHql.append("mes_production_assembly.createUser AS createUser,");
|
|
|
|
dataQueryHql.append("mes_production_assembly.createUser AS createUser,");
|
|
|
|
dataQueryHql.append("mes_production_record.workOrderNo AS workOrderNo,");
|
|
|
|
dataQueryHql.append("mes_production_record.workOrderNo AS workOrderNo,");
|
|
|
|
dataQueryHql.append("mes_production_record.lotNo AS lotNo,");
|
|
|
|
dataQueryHql.append("mes_production_record.lotNo AS lotNo,");
|
|
|
|
dataQueryHql.append("mes_equipment.equipmentName AS equipmentName)");
|
|
|
|
dataQueryHql.append("mes_equipment.equipmentName AS equipmentName,");
|
|
|
|
|
|
|
|
dataQueryHql.append("mes_equipment.equipId AS equipId ");
|
|
|
|
|
|
|
|
dataQueryHql.append(") ");
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder countQueryHql= new StringBuilder();
|
|
|
|
StringBuilder countQueryHql= new StringBuilder();
|
|
|
|
countQueryHql.append("select count(1)");
|
|
|
|
countQueryHql.append("select count(1)");
|
|
|
@ -69,8 +71,8 @@ public class AssemblyPartReportDaoImpl implements IAssemblyPartReportDao {
|
|
|
|
commonQueryHql.append("AND mes_production_assembly.serialNumber like :serialNumber ");
|
|
|
|
commonQueryHql.append("AND mes_production_assembly.serialNumber like :serialNumber ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// = 装配件条码确认规则
|
|
|
|
// = 装配件条码确认规则
|
|
|
|
if (model.getMatchType()!=null){
|
|
|
|
if (!StringUtils.isEmpty(model.getMatchRule())){
|
|
|
|
commonQueryHql.append("AND mes_production_assembly.matchType = :matchType ");
|
|
|
|
commonQueryHql.append("AND mes_production_assembly.matchRule = :matchRule ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// like 零件号
|
|
|
|
// like 零件号
|
|
|
|
if(!StringUtils.isEmpty(model.getPartNo())){
|
|
|
|
if(!StringUtils.isEmpty(model.getPartNo())){
|
|
|
@ -112,10 +114,9 @@ public class AssemblyPartReportDaoImpl implements IAssemblyPartReportDao {
|
|
|
|
if(!StringUtils.isEmpty(model.getWorkCellCode())){
|
|
|
|
if(!StringUtils.isEmpty(model.getWorkCellCode())){
|
|
|
|
commonQueryHql.append("AND mes_production_assembly.workCellCode like :workCellCode ");
|
|
|
|
commonQueryHql.append("AND mes_production_assembly.workCellCode like :workCellCode ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//= 扫描类型
|
|
|
|
if (model.getMatchType()!=null){
|
|
|
|
// if (!StringUtils.isEmpty(model.getScanType())){
|
|
|
|
commonQueryHql.append("AND mes_production_assembly.matchRule = :matchRule ");
|
|
|
|
// commonQueryHql.append("AND mes_production_assembly.scanType = :scanType ");
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
//like 加工单号
|
|
|
|
//like 加工单号
|
|
|
|
if(!StringUtils.isEmpty(model.getWorkOrderNo())){
|
|
|
|
if(!StringUtils.isEmpty(model.getWorkOrderNo())){
|
|
|
|
commonQueryHql.append("AND mes_production_record.workOrderNo like :workOrderNo ");
|
|
|
|
commonQueryHql.append("AND mes_production_record.workOrderNo like :workOrderNo ");
|
|
|
@ -124,6 +125,9 @@ public class AssemblyPartReportDaoImpl implements IAssemblyPartReportDao {
|
|
|
|
if(!StringUtils.isEmpty(model.getEquipmentName())){
|
|
|
|
if(!StringUtils.isEmpty(model.getEquipmentName())){
|
|
|
|
commonQueryHql.append("AND mes_equipment.equipmentName like :equipmentName ");
|
|
|
|
commonQueryHql.append("AND mes_equipment.equipmentName like :equipmentName ");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (model.getEquipId()!=null){
|
|
|
|
|
|
|
|
commonQueryHql.append("AND mes_equipment.equipId = :equipId ");
|
|
|
|
|
|
|
|
}
|
|
|
|
commonQueryHql.append("ORDER BY mes_production_assembly.createDatetime DESC ");
|
|
|
|
commonQueryHql.append("ORDER BY mes_production_assembly.createDatetime DESC ");
|
|
|
|
|
|
|
|
|
|
|
|
Query dataQuery = entityManager.createQuery(dataQueryHql.append(commonQueryHql).toString(), AssemblyPartReportModel.class);
|
|
|
|
Query dataQuery = entityManager.createQuery(dataQueryHql.append(commonQueryHql).toString(), AssemblyPartReportModel.class);
|
|
|
@ -182,11 +186,17 @@ public class AssemblyPartReportDaoImpl implements IAssemblyPartReportDao {
|
|
|
|
if(!StringUtils.isEmpty(model.getWorkCellCode())){
|
|
|
|
if(!StringUtils.isEmpty(model.getWorkCellCode())){
|
|
|
|
dataQuery.setParameter("workCellCode", model.getWorkCellCode() + "%");
|
|
|
|
dataQuery.setParameter("workCellCode", model.getWorkCellCode() + "%");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (model.getMatchType()!=null){
|
|
|
|
|
|
|
|
dataQuery.setParameter("matchRule", model.getMatchRule());
|
|
|
|
|
|
|
|
}
|
|
|
|
if(!StringUtils.isEmpty(model.getWorkOrderNo())){
|
|
|
|
if(!StringUtils.isEmpty(model.getWorkOrderNo())){
|
|
|
|
dataQuery.setParameter("workOrderNo", model.getWorkOrderNo() + "%");
|
|
|
|
dataQuery.setParameter("workOrderNo", model.getWorkOrderNo() + "%");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!StringUtils.isEmpty(model.getEquipmentName())){
|
|
|
|
if(!StringUtils.isEmpty(model.getEquipmentName())){
|
|
|
|
dataQuery.setParameter("equipmentName", model.getEquipmentName() + "%");
|
|
|
|
dataQuery.setParameter("equipmentName", model.getEquipmentName() + "%");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (model.getEquipId()!=null){
|
|
|
|
|
|
|
|
dataQuery.setParameter("equipId", model.getEquipId());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|