|
|
|
@ -5,22 +5,38 @@ import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.util.StringUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipment;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipmentProdParamCfg;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipment;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesWcEquipmentRepository;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class MesEquipmentService extends BaseMesService<MesEquipment> implements IMesEquitmentService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesWcEquipmentRepository mesWcEquipmentRepository;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void setPackQueryBean(MesEquipment bean, DdlPackBean packBean) {
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getEquipmentCode(),"equipmentCode",packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getEquipmentName(),"equipmentName",packBean);
|
|
|
|
|
if (!StringUtil.isEmpty(bean.getFilterWorkCell())) {
|
|
|
|
|
//过滤已绑定工位
|
|
|
|
|
DdlPackBean packBean1 = DdlPackBean.getDdlPackBean(bean.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getIsNotNull("equipmentCode", packBean);
|
|
|
|
|
DdlPreparedPack.getIsNotNull( "workCellCode", packBean);
|
|
|
|
|
|
|
|
|
|
List<MesWcEquipment> workCells = mesWcEquipmentRepository.findByHqlWhere(packBean);
|
|
|
|
|
DdlPreparedPack.getNotInPack(workCells.stream().map(MesWcEquipment::getEquipmentCode), "equipmentCode", packBean);
|
|
|
|
|
}
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getEquipmentCode(), "equipmentCode", packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(bean.getEquipmentName(), "equipmentName", packBean);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|