展示组件 初始化 时禁用扫描框 ; 排序工单 及条码 的上线时间赋值 扫描工单的时间

master
王杰 6 months ago
parent 84a8175ed7
commit 6e2ce20b3b

@ -21,7 +21,6 @@ public interface IMesShiftService {
@ApiOperation(value = "查询产线与班次的对应关系")
ListPager<MesShift> queryMesShiftByPager(MesShift mesShift, Pager pager);
@ApiOperation(value = "查询产线与班次的对应关系")
List<MesShift> queryMesShift(String organizeCode, String workCenterCode);

@ -18,7 +18,6 @@ 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.model.StationKvBean;
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
import cn.estsh.i3plus.pojo.mes.repository.MesConfigRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesDowntimeRecordRepository;
import cn.estsh.i3plus.pojo.mes.repository.MesProdShiftRecordRepository;
@ -245,7 +244,7 @@ public class MesProdShiftRecordServiceImpl implements IMesProdShiftRecordService
//班次开始时间 ,班次结束时间
Map<String, String> shiftTimeMap = mesShiftService.getShiftTimeMap(record);
if (!java.util.Objects.isNull(shiftTimeMap)) {
if (!CollectionUtils.isEmpty(shiftTimeMap)) {
StationKvBeanUtil.addStationKvBeanList(stationKvBeans,
new StationKvBean(MesPcnExtConstWords.START_TIME,"开始时间", shiftTimeMap.get(MesPcnExtConstWords.START_TIME)),
new StationKvBean(MesPcnExtConstWords.END_TIME,"结束时间",shiftTimeMap.get(MesPcnExtConstWords.END_TIME)));

@ -73,6 +73,7 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getProductionProcessContext(reqBean, false);
//配置错误 抛出异常
if (!productionProcessContext.getSuccess()) {
this.sendMessage(reqBean, new StationResultBean().resultObj(MesPcnExtConstWords.STEP_DISABLE_SCAN), String.format("信息: %s!", productionProcessContext.getMessage()), MesPcnEnumUtil.STATION_BUSI_TYPE.STEP_TITLE, MesPcnEnumUtil.STATION_DATA_TYPE.TITLE);
this.sendMessage(reqBean, new StationResultBean().writeDbLog(), productionProcessContext.getMessage(), MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT);
MesPcnException.throwBusiException(productionProcessContext.getMessage());
}
@ -83,6 +84,7 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
//获取班次信息,先查询缓存,缓存没有在查询数据库
List<StationKvBean> prodShiftDataContext = prodShiftRecordService.getShiftRecordStationKvBeans(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
if (CollectionUtils.isEmpty(prodShiftDataContext)) {
this.sendMessage(reqBean, new StationResultBean().resultObj(MesPcnExtConstWords.STEP_DISABLE_SCAN), "信息: 请先开班!", MesPcnEnumUtil.STATION_BUSI_TYPE.STEP_TITLE, MesPcnEnumUtil.STATION_DATA_TYPE.TITLE);
this.sendMessage(reqBean, new StationResultBean().writeDbLog(), "请先开班!", MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
MesPcnException.throwBusiException("请先开班!");
}

@ -64,6 +64,7 @@ public class MesProductionSortModuleService extends BaseModuleService {
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getProductionProcessContext(reqBean, false);
//配置错误 抛出异常
if (!productionProcessContext.getSuccess()) {
this.sendMessage(reqBean, new StationResultBean().resultObj(MesPcnExtConstWords.STEP_DISABLE_SCAN), String.format("信息: %s!", productionProcessContext.getMessage()), MesPcnEnumUtil.STATION_BUSI_TYPE.STEP_TITLE, MesPcnEnumUtil.STATION_DATA_TYPE.TITLE);
this.sendMessage(reqBean, new StationResultBean().writeDbLog(), productionProcessContext.getMessage(), MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.EXP_TEXT);
MesPcnException.throwBusiException(productionProcessContext.getMessage());
}
@ -79,6 +80,7 @@ public class MesProductionSortModuleService extends BaseModuleService {
//获取班次信息,先查询缓存,缓存没有在查询数据库
List<StationKvBean> prodShiftDataContext = prodShiftRecordService.getShiftRecordStationKvBeans(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
if (CollectionUtils.isEmpty(prodShiftDataContext)) {
this.sendMessage(reqBean, new StationResultBean().resultObj(MesPcnExtConstWords.STEP_DISABLE_SCAN), "信息: 请先开班!", MesPcnEnumUtil.STATION_BUSI_TYPE.STEP_TITLE, MesPcnEnumUtil.STATION_DATA_TYPE.TITLE);
this.sendMessage(reqBean, new StationResultBean().writeDbLog(), "请先开班!", MesPcnEnumUtil.STATION_BUSI_TYPE.MESSAGE, MesPcnEnumUtil.STATION_DATA_TYPE.TEXT);
MesPcnException.throwBusiException("请先开班!");
}

@ -3,6 +3,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.*;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.mes.pcn.util.StationKvBeanUtil;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesProduceSn;
@ -213,13 +214,16 @@ public class MesWorkOrderCheckSortStepService extends MesWorkOrderCheckStepServi
//封装产成零件
MesProductionPartContext productionPartContext = new MesProductionPartContext().copyPartNo(workOrder, equipVariableCollectContextList.get(0).getMessageSource()).isCheck(productionProcessContext.getWorkCell());
if (StringUtils.isEmpty(productionPartContext.getOnlineTime())) productionPartContext.setOnlineTime(TimeTool.getNowTime(true));
productionPartContextList.add(productionPartContext);
//封装产品条码
productionPsInContextList.add(new MesProductionPsInContext(produceSn).isCheck(productionProcessContext.getWorkCell()).messageSource(equipVariableCollectContextList.get(0).getMessageSource()).relateId(queueOrder.getId()));
//封装产出条码
productionPsOutContextList.add(new MesProductionPsOutContext().copy(produceSn));
MesProductionPsOutContext productionPsOutContext = new MesProductionPsOutContext().copy(produceSn);
if (StringUtils.isEmpty(productionPsOutContext.getInWorkCenterTime())) productionPsOutContext.setInWorkCenterTime(productionPartContext.getOnlineTime());
productionPsOutContextList.add(productionPsOutContext);
}

@ -98,19 +98,24 @@ public class MesWorkOrderSaveSortStepService extends BaseStepService {
if (!isEndWorkCell && productionPartContext.getWorkOrderStatus().compareTo(MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue()) == 0) continue;
if (!isEndWorkCell) {
if (StringUtils.isEmpty(productionPartContext.getOnlineTime())) productionPartContext.setOnlineTime(TimeTool.getNowTime(true));
workOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionPartContext.getId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.START_TIME, MesPcnExtConstWords.ONLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue(), productionPartContext.getOnlineTime(), productionPartContext.getOnlineTime()});
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS,
MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.START_TIME, MesPcnExtConstWords.ONLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),
MesExtEnumUtil.ORDER_STATUS.PROCESS.getValue(), productionPartContext.getOnlineTime(), productionPartContext.getOnlineTime()});
} else {
productionPartContext.setOfflineTime(TimeTool.getNowTime(true));
workOrderRepository.updateByProperties(
new String[]{MesPcnExtConstWords.ID, MesPcnExtConstWords.ORGANIZE_CODE},
new Object[]{productionPartContext.getId(), reqBean.getOrganizeCode()},
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS, MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLETE_QTY, MesPcnExtConstWords.UN_COMPLETE_QTY, MesPcnExtConstWords.END_TIME, MesPcnExtConstWords.OFFLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0), productionPartContext.getOfflineTime(), productionPartContext.getOfflineTime()});
new String[]{MesPcnExtConstWords.MODIFY_USER, MesPcnExtConstWords.MODIFY_DATE_TIME, MesPcnExtConstWords.SYSTEM_SYNC_STATUS,
MesPcnExtConstWords.WORK_ORDER_STATUS, MesPcnExtConstWords.COMPLETE_QTY, MesPcnExtConstWords.UN_COMPLETE_QTY,
MesPcnExtConstWords.START_TIME, MesPcnExtConstWords.ONLINE_TIME, MesPcnExtConstWords.END_TIME, MesPcnExtConstWords.OFFLINE_TIME},
new Object[]{reqBean.getUserInfo(), (new SimpleDateFormat(MesPcnExtConstWords.DATE_FORMAT_SSS)).format(new Date()), CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),
MesExtEnumUtil.ORDER_STATUS.COMPLETE.getValue(), new Double(1), new Double(0),
productionPartContext.getOnlineTime(), productionPartContext.getOnlineTime(), productionPartContext.getOfflineTime(), productionPartContext.getOfflineTime()});
}
log.info("工厂{}生产线{}工位{}:FSM STATE DISPATCHER --- DO STEP --- {} EXEC --- ORDER:{} --- UPDATE:[{}:{}]",

Loading…
Cancel
Save