设备点检查询

tags/yfai-mes-ext-v1.0
yxw 1 year ago
parent 1ca09aadc8
commit 4bcf4e46bc

@ -65,7 +65,7 @@ public class EquipmentCheckDetailDao implements IEquipmentCheckDetailDao {
hql.append(" where ecd.organizeCode = :organizeCode "); hql.append(" where ecd.organizeCode = :organizeCode ");
hql.append(" and ecd.isValid = :isValid "); hql.append(" and ecd.isValid = :isValid ");
hql.append(" and ecd.isDeleted = :isDeleted "); hql.append(" and ecd.isDeleted = :isDeleted ");
hql.append(" and oj.orderStatus in :orderStatus "); //hql.append(" and oj.orderStatus in :orderStatus ");
if (!StringUtils.isEmpty(equipmentCheckDetail.getOrderJobNo())) { if (!StringUtils.isEmpty(equipmentCheckDetail.getOrderJobNo())) {
hql.append(" and ecd.orderJobNo like :orderJobNo "); hql.append(" and ecd.orderJobNo like :orderJobNo ");
} }
@ -89,9 +89,10 @@ public class EquipmentCheckDetailDao implements IEquipmentCheckDetailDao {
} }
if (!StringUtils.isEmpty(equipmentCheckDetail.getCheckResult())) { if (!StringUtils.isEmpty(equipmentCheckDetail.getCheckResult())) {
hql.append(" and ecd.checkResult = :checkResult "); hql.append(" and ecd.checkResult = :checkResult ");
} else {
hql.append(" and ecd.checkResult in :checkResult ");
} }
//else {
// hql.append(" and ecd.checkResult in :checkResult ");
//}
if (!StringUtils.isEmpty(equipmentCheckDetail.getCreateDateTimeStart())) { if (!StringUtils.isEmpty(equipmentCheckDetail.getCreateDateTimeStart())) {
hql.append(" and ecd.spotCheckTime >= :spotCheckTimeStart "); hql.append(" and ecd.spotCheckTime >= :spotCheckTimeStart ");
} }
@ -104,10 +105,10 @@ public class EquipmentCheckDetailDao implements IEquipmentCheckDetailDao {
query.setParameter(MesExtConstWords.ORGANIZE_CODE, equipmentCheckDetail.getOrganizeCode()); query.setParameter(MesExtConstWords.ORGANIZE_CODE, equipmentCheckDetail.getOrganizeCode());
query.setParameter(MesExtConstWords.IS_VALID, CommonEnumUtil.IS_VAILD.VAILD.getValue()); query.setParameter(MesExtConstWords.IS_VALID, CommonEnumUtil.IS_VAILD.VAILD.getValue());
query.setParameter(MesExtConstWords.IS_DELETED, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()); query.setParameter(MesExtConstWords.IS_DELETED, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue());
List<Integer> orderStatusList = new ArrayList<>(2); //List<Integer> orderStatusList = new ArrayList<>(2);
orderStatusList.add(MesExtEnumUtil.MES_ORJ_ORDER_STATUS.CHECK_COMPLETE.getValue()); //orderStatusList.add(MesExtEnumUtil.MES_ORJ_ORDER_STATUS.CHECK_COMPLETE.getValue());
orderStatusList.add(MesExtEnumUtil.MES_ORJ_ORDER_STATUS.CLOSE.getValue()); //orderStatusList.add(MesExtEnumUtil.MES_ORJ_ORDER_STATUS.CLOSE.getValue());
query.setParameter(MesExtConstWords.ORDER_STATUS, orderStatusList); //query.setParameter(MesExtConstWords.ORDER_STATUS, orderStatusList);
if (!StringUtils.isEmpty(equipmentCheckDetail.getOrderJobNo())) { if (!StringUtils.isEmpty(equipmentCheckDetail.getOrderJobNo())) {
query.setParameter(MesExtConstWords.ORDER_JOB_NO, "%" + equipmentCheckDetail.getOrderJobNo() + "%"); query.setParameter(MesExtConstWords.ORDER_JOB_NO, "%" + equipmentCheckDetail.getOrderJobNo() + "%");
} }
@ -131,13 +132,14 @@ public class EquipmentCheckDetailDao implements IEquipmentCheckDetailDao {
} }
if (!StringUtils.isEmpty(equipmentCheckDetail.getCheckResult())) { if (!StringUtils.isEmpty(equipmentCheckDetail.getCheckResult())) {
query.setParameter(MesExtConstWords.CHECK_RESULT, equipmentCheckDetail.getCheckResult()); query.setParameter(MesExtConstWords.CHECK_RESULT, equipmentCheckDetail.getCheckResult());
} else {
List<Integer> checkResultList = new ArrayList<>(3);
checkResultList.add(MesExtEnumUtil.EQU_CHECK_RESULT.QUALIFIED.getValue());
checkResultList.add(MesExtEnumUtil.EQU_CHECK_RESULT.EQUIPMENT_ABNORMAL.getValue());
checkResultList.add(MesExtEnumUtil.EQU_CHECK_RESULT.EQUIPMENT_FAILURE.getValue());
query.setParameter(MesExtConstWords.CHECK_RESULT, checkResultList);
} }
//else {
// List<Integer> checkResultList = new ArrayList<>(3);
// checkResultList.add(MesExtEnumUtil.EQU_CHECK_RESULT.QUALIFIED.getValue());
// checkResultList.add(MesExtEnumUtil.EQU_CHECK_RESULT.EQUIPMENT_ABNORMAL.getValue());
// checkResultList.add(MesExtEnumUtil.EQU_CHECK_RESULT.EQUIPMENT_FAILURE.getValue());
// query.setParameter(MesExtConstWords.CHECK_RESULT, checkResultList);
//}
if (!StringUtils.isEmpty(equipmentCheckDetail.getCreateDateTimeStart())) { if (!StringUtils.isEmpty(equipmentCheckDetail.getCreateDateTimeStart())) {
query.setParameter(MesExtConstWords.SPOT_CHECK_TIME_START, equipmentCheckDetail.getCreateDateTimeStart()); query.setParameter(MesExtConstWords.SPOT_CHECK_TIME_START, equipmentCheckDetail.getCreateDateTimeStart());
} }

@ -1730,6 +1730,7 @@ public class MesExtEnumUtil {
*/ */
@JsonFormat(shape = JsonFormat.Shape.OBJECT) @JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum EQU_CHECK_RESULT { public enum EQU_CHECK_RESULT {
UNCHECKED(0, "未点检"),
QUALIFIED(10, "合格"), QUALIFIED(10, "合格"),
EQUIPMENT_ABNORMAL(20, "设备异常"), EQUIPMENT_ABNORMAL(20, "设备异常"),
EQUIPMENT_FAILURE(30, "设备故障中"); EQUIPMENT_FAILURE(30, "设备故障中");

Loading…
Cancel
Save