|
|
|
@ -3,7 +3,6 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.api.busi.IProdExtOrgService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.apiservice.dao.IEquipmentExtDao;
|
|
|
|
|
import cn.estsh.i3plus.mes.api.iservice.base.IEnumService;
|
|
|
|
|
import cn.estsh.i3plus.mes.apiservice.dao.IEquipmentDao;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
|
|
|
@ -16,22 +15,11 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.MesEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.util.StringUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesArea;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesEquipment;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellParam;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellParamCfg;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellPoint;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCenter;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.MesEquipmentModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.ProdOrgModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.SysOrganizeModel;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesAreaRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCellParamCfgRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCellParamRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCellPointRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCellRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.MesWorkCenterRepository;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.repository.*;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.sqlpack.MesHqlPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysUserInfo;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
@ -73,8 +61,6 @@ public class ProdExtOrgService implements IProdExtOrgService {
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesWorkCellParamRepository workCellParamRepository;
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesWorkCellPointRepository workCellPointRepository;
|
|
|
|
|
@Autowired
|
|
|
|
|
private IEnumService enumService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -612,64 +598,4 @@ public class ProdExtOrgService implements IProdExtOrgService {
|
|
|
|
|
new Object[]{status, userName, TimeTool.getNowTime(true)});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ListPager<MesWorkCellPoint> queryMesWorkCellPointByPager(MesWorkCellPoint workCellPoint, Pager pager) {
|
|
|
|
|
|
|
|
|
|
if (workCellPoint == null) {
|
|
|
|
|
pager = PagerHelper.getPager(pager, workCellPointRepository.listCount());
|
|
|
|
|
return new ListPager(workCellPointRepository.listPager(pager), pager);
|
|
|
|
|
} else {
|
|
|
|
|
DdlPackBean hqlPack = MesHqlPack.getMesWorkCellPoint(workCellPoint, AuthUtil.getOrganize().getOrganizeCode());
|
|
|
|
|
pager = PagerHelper.getPager(pager, workCellPointRepository.findByHqlWhereCount(hqlPack));
|
|
|
|
|
hqlPack.setOrderByStr(workCellPoint.orderBy());
|
|
|
|
|
return new ListPager(workCellPointRepository.findByHqlWherePage(hqlPack, pager), pager);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesWorkCellPoint insertMesWorkCellPoint(MesWorkCellPoint workCellPoint) {
|
|
|
|
|
|
|
|
|
|
//唯一性校验
|
|
|
|
|
MesWorkCellPoint workCellPointDb = workCellPointRepository.getByProperty(new String[]{MesConstWords.ORGANIZE_CODE, "workCenterCode", "workCellCode", MesConstWords.IS_DELETED},
|
|
|
|
|
new Object[]{workCellPoint.getOrganizeCode(), workCellPoint.getWorkCenterCode(), workCellPoint.getWorkCellCode(), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()});
|
|
|
|
|
|
|
|
|
|
if (null != workCellPointDb) {
|
|
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_EXIT.getCode())
|
|
|
|
|
.setErrorDetail("产线代码为【%s】,工位代码为【%s】的记录已存在", workCellPoint.getWorkCenterCode(), workCellPoint.getWorkCellCode())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return workCellPointRepository.insert(workCellPoint);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesWorkCellPoint updateMesWorkCellPoint(MesWorkCellPoint workCellPoint) {
|
|
|
|
|
|
|
|
|
|
//对id做有效性校验
|
|
|
|
|
MesWorkCellPoint workCellPointDb = workCellPointRepository.getById(workCellPoint.getId());
|
|
|
|
|
if (workCellPointDb == null) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
|
|
|
|
|
.setErrorDetail("产线代码为【%s】,工位代码为【%s】的记录不存在", workCellPoint.getWorkCenterCode(), workCellPoint.getWorkCellCode())
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
workCellPointDb.setQueueSeq(workCellPoint.getQueueSeq());
|
|
|
|
|
workCellPointDb.setQueueDetailSeq(workCellPoint.getQueueDetailSeq());
|
|
|
|
|
ConvertBean.serviceModelUpdate(workCellPointDb, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
|
|
|
|
|
return workCellPointRepository.save(workCellPointDb);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int updateMesWorkCellPointStatusById(Long id, int status, String userName) {
|
|
|
|
|
|
|
|
|
|
return workCellPointRepository.updateByProperties(new String[]{"id"}, new Object[]{id},
|
|
|
|
|
new String[]{MesConstWords.IS_VALID, "modifyUser", "modifyDatetime"},
|
|
|
|
|
new Object[]{status, userName, TimeTool.getNowTime(true)});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|