|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.station;
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdShiftRecordService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionCustomContextStepService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionDispatchContextStepService;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesProductionProcessContextStepService;
|
|
|
|
@ -14,6 +15,7 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesFile;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesProdShiftRecord;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesStateMachineStatus;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCell;
|
|
|
|
|
import cn.estsh.i3plus.pojo.mes.model.AttrBean;
|
|
|
|
@ -56,6 +58,9 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
private IMesProductionCustomContextStepService productionCustomContextStepService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private IMesProdShiftRecordService mesProdShiftRecordService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private MesFileRepository mesFileRepository;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -66,9 +71,11 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
//获取上下文信息
|
|
|
|
|
MesProductionProcessContext productionProcessContext = productionProcessContextStepService.getEquipmentVariableList(reqBean, MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PRODUCTION.getValue());
|
|
|
|
|
MesWorkCell mesWorkCell = productionProcessContext.getWorkCell();
|
|
|
|
|
/**
|
|
|
|
|
* 获取班次信息,先查询缓存,缓存没有在查询数据库
|
|
|
|
|
*/
|
|
|
|
|
List<StationKvBean> prodShiftDataContext = getShiftRecordStationKvBeans(reqBean);
|
|
|
|
|
|
|
|
|
|
// 获取班次信息
|
|
|
|
|
List<StationKvBean> prodShiftDataContext = productionCustomContextStepService.getProdShiftDataContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
|
|
|
|
|
MesProdShiftContext mesProdShiftKvBean = productionCustomContextStepService.getMesProdShiftKvBean(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
|
|
|
|
|
|
|
|
|
|
if (CollectionUtils.isEmpty(prodShiftDataContext)) {
|
|
|
|
@ -97,6 +104,23 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private List<StationKvBean> getShiftRecordStationKvBeans(StationRequestBean reqBean) {
|
|
|
|
|
// 获取班次信息 redis
|
|
|
|
|
List<StationKvBean> prodShiftDataContext = productionCustomContextStepService.getProdShiftDataContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode());
|
|
|
|
|
if (CollectionUtils.isEmpty(prodShiftDataContext)) {
|
|
|
|
|
MesProdShiftRecord shiftRecord = new MesProdShiftRecord();
|
|
|
|
|
shiftRecord.setWorkCenterCode(reqBean.getWorkCenterCode());
|
|
|
|
|
shiftRecord.setWorkStatus(MesExtEnumUtil.WORK_STATUS.START.getValue());
|
|
|
|
|
// 查询数据库
|
|
|
|
|
MesProdShiftRecord prodShiftRecord = mesProdShiftRecordService.queryMesProdShiftRecord(shiftRecord);
|
|
|
|
|
if (prodShiftRecord != null) {
|
|
|
|
|
prodShiftDataContext = getProdShiftData(prodShiftRecord);
|
|
|
|
|
productionCustomContextStepService.saveProdShiftDataContext(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(),prodShiftDataContext);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return prodShiftDataContext;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private StationResultBean getStationResultBean(StationRequestBean reqBean, List<List<StationKvBean>> moduleContentContext, List<StationKvBean> prodShiftDataContext) {
|
|
|
|
|
StationResultBean resultBean = new StationResultBean();
|
|
|
|
|
resultBean.setBusiType(MesPcnEnumUtil.STATION_BUSI_TYPE.MODULE_CONTENT.getValue());
|
|
|
|
@ -160,5 +184,14 @@ public class MesProductionNoSortModuleService extends BaseModuleService {
|
|
|
|
|
init(reqBean);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//封装展示组件班组班次内容
|
|
|
|
|
private List<StationKvBean> getProdShiftData(MesProdShiftRecord record) {
|
|
|
|
|
|
|
|
|
|
return StationKvBeanUtil.addStationKvBeanList(new ArrayList<>(),
|
|
|
|
|
new StationKvBean("shiftGroup", "班组", record.getShiftGroup()),
|
|
|
|
|
new StationKvBean("shiftGroupName", "班组名称", record.getShiftGroup()),
|
|
|
|
|
new StationKvBean("shiftCode", "班次", record.getShiftCode()),
|
|
|
|
|
new StationKvBean("shiftName", "班次名称", record.getShiftName()))
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|