forked from I3-YF/i3plus-mes-pcn-yfai
Merge branch 'uat' into uat-temp-copydevorderservice
commit
f848b4bcbf
@ -0,0 +1,30 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.base;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi.MesProduceSnExtService;
|
||||
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/white")
|
||||
public class MesWhiteController {
|
||||
|
||||
@Autowired
|
||||
private MesProduceSnExtService mesProduceSnExtService;
|
||||
|
||||
@GetMapping("/mesPartSap/{productSn}/{organizeCode}")
|
||||
public ResultBean getPartNo(@PathVariable String productSn,@PathVariable String organizeCode){
|
||||
|
||||
String partNo;
|
||||
try {
|
||||
partNo = mesProduceSnExtService.queryPartNoByProduceSn(productSn, organizeCode);
|
||||
} catch (Exception e) {
|
||||
return ResultBean.fail("查询失败").setErrorMsg(e.getMessage());
|
||||
}
|
||||
return ResultBean.success("查询成功").setResultObject(partNo);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.numberrule;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||
import cn.estsh.i3plus.mes.pcn.api.iservice.base.IPartService;
|
||||
import cn.estsh.i3plus.mes.pcn.api.iservice.busi.INumberRulePackAttributeStrategyService;
|
||||
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesPart;
|
||||
import cn.estsh.i3plus.pojo.mes.model.GenSerialNoModel;
|
||||
import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.StringJoiner;
|
||||
|
||||
/**
|
||||
* @Description : 门板及cnsl总成条码
|
||||
* @Reference :
|
||||
* @Author : junsheng.li
|
||||
* @CreateDate 2024/9/27 13:23
|
||||
* @Modify:
|
||||
**/
|
||||
@Component
|
||||
public class MesDPBarcodeSubStringPartSnParamWhNumberRuleStrategyService implements INumberRulePackAttributeStrategyService {
|
||||
|
||||
@Autowired
|
||||
private IPartService partService;
|
||||
|
||||
@Override
|
||||
public GenSerialNoModel execute(GenSerialNoModel genSerialNoModel) {
|
||||
|
||||
if (null == genSerialNoModel) MesPcnException.throwBusiException("入参缺少[GenSerialNoModel]!");
|
||||
|
||||
Map<String, Object> dataMap = genSerialNoModel.getDataMap();
|
||||
|
||||
MesPart part = (!CollectionUtils.isEmpty(dataMap) && dataMap.containsKey(MesPart.class.getSimpleName())) ?
|
||||
(MesPart)dataMap.get(MesPart.class.getSimpleName()) : partService.getPartByNo(genSerialNoModel.getOrganizeCode(), genSerialNoModel.getPartNo());
|
||||
if (null == part) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]信息不存在!", genSerialNoModel.getPartNo());
|
||||
if (StringUtils.isEmpty(part.getPartSnParam())) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]未维护零件条码参数!", part.getPartNo());
|
||||
if (part.getPartSnParam().length() < 4) MesPcnException.throwBusiException("请检查零件信息,零件号[%s]维护零件条码参数[%s]长度小于4!", part.getPartNo(), part.getPartSnParam());
|
||||
if (StringUtils.isEmpty(genSerialNoModel.getShiftCode())) MesPcnException.throwBusiException("入参缺少班次代码!");
|
||||
|
||||
genSerialNoModel.partSnParam(part.getPartSnParam())
|
||||
.dynamicRule(new StringJoiner(MesPcnExtConstWords.COMMA).add(part.getPartSnParam().substring(part.getPartSnParam().length() - 4)).add(genSerialNoModel.getShiftCode()).toString());
|
||||
//年月日缩写
|
||||
Date date = new Date();
|
||||
genSerialNoModel.setYear(getYearShort(date));
|
||||
genSerialNoModel.setMonth(getMonthShort(date));
|
||||
genSerialNoModel.setDay(getDayShort(date));
|
||||
return genSerialNoModel;
|
||||
}
|
||||
|
||||
private String getYearShort(Date date) {
|
||||
return MesExtEnumUtil.YEAR_SHORT.valueOfDescription(Integer.parseInt(TimeTool.getYear(date)));
|
||||
}
|
||||
|
||||
private String getMonthShort(Date date) {
|
||||
return MesExtEnumUtil.MONTH_SHORT.valueOfDescription(Integer.parseInt(TimeTool.getMonth(date)));
|
||||
}
|
||||
|
||||
private String getDayShort(Date date) {
|
||||
return TimeTool.getDay(date);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.step;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesProdOrgExtService;
|
||||
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
||||
import cn.estsh.i3plus.mes.pcn.actor.shipping.dispatch.IFsmCommonService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.BaseStepService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IShippingDispatchService;
|
||||
import cn.estsh.i3plus.mes.pcn.serviceimpl.fsm.IStepService;
|
||||
import cn.estsh.i3plus.mes.pcn.websocket.StationWebSocket;
|
||||
import cn.estsh.i3plus.platform.common.util.MesPcnConstWords;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.MesPcnEnumUtil;
|
||||
import cn.estsh.i3plus.pojo.mes.bean.MesWorkCellExtendCfg;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationRequestBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StationResultBean;
|
||||
import cn.estsh.i3plus.pojo.mes.model.StepResult;
|
||||
import cn.estsh.impp.framework.boot.util.SpringContextsUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description : 验证通过后所有分屏强制重置工序工步
|
||||
* @Author : wangjie
|
||||
**/
|
||||
@Slf4j
|
||||
@Service("mesManyCellTriggerJumpProcessStepService")
|
||||
public class MesManyCellTriggerJumpProcessStepService extends BaseStepService {
|
||||
|
||||
@Autowired
|
||||
private IFsmCommonService fsmCommonService;
|
||||
|
||||
@Autowired
|
||||
private IMesProdOrgExtService prodOrgExtService;
|
||||
|
||||
@Autowired
|
||||
private IShippingDispatchService shippingDispatchService;
|
||||
|
||||
@Override
|
||||
public StepResult execute(StationRequestBean reqBean) {
|
||||
|
||||
StepResult stepResult = StepResult.getSuccessComplete();
|
||||
|
||||
if (StringUtils.isEmpty(reqBean.getScanInfo())) return stepResult;
|
||||
|
||||
stepResult.unResetScanInfo();
|
||||
|
||||
//所有分屏强制跳过工序密码
|
||||
String pwd = fsmCommonService.handleFsmWcpcMapDataForDoScan(reqBean).get(MesPcnExtConstWords.MANY_CELL_TRIGGER_JUMP_PROCESS_PWD);
|
||||
if (StringUtils.isEmpty(pwd) || !pwd.equals(reqBean.getScanInfo())) return stepResult;
|
||||
|
||||
StationResultBean resultBean = new StationResultBean();
|
||||
|
||||
//根据生产线代码,工位代码查询主子工位实虚关系信息
|
||||
List<MesWorkCellExtendCfg> workCellExtendCfgList = prodOrgExtService.getWorkCellExtendCfgRvListByBak(reqBean.getOrganizeCode(), reqBean.getWorkCenterCode(), reqBean.getWorkCellCode());
|
||||
|
||||
if (CollectionUtils.isEmpty(workCellExtendCfgList)) return stepSuccessCompleteAndSendMsgReturn(reqBean, resultBean.writeDbLog(), stepResult, String.format("生产线[%s]工位[%s]未配置实虚工位对应关系", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()));
|
||||
|
||||
for (MesWorkCellExtendCfg workCellExtendCfg : workCellExtendCfgList) {
|
||||
|
||||
if (null == workCellExtendCfg) continue;
|
||||
|
||||
//验证工位是否在线,当前工位无须验证
|
||||
String clientInfo = shippingDispatchService.getActorClientInfo(reqBean.getOrganizeCode(), workCellExtendCfg.getWorkCenterCodeBak(), workCellExtendCfg.getWorkCellCodeBak());
|
||||
if (!workCellExtendCfg.getWorkCenterCodeBak().equals(reqBean.getWorkCenterCode()) || !workCellExtendCfg.getWorkCellCodeBak().equals(reqBean.getWorkCellCode())) {
|
||||
if (CollectionUtils.isEmpty(StationWebSocket.getStationWebSocketList(clientInfo))) continue;
|
||||
}
|
||||
|
||||
StationRequestBean stationRequestBean = new StationRequestBean();
|
||||
BeanUtils.copyProperties(reqBean, stationRequestBean);
|
||||
stationRequestBean.setWorkCenterCode(workCellExtendCfg.getWorkCenterCodeBak());
|
||||
stationRequestBean.setWorkCellCode(workCellExtendCfg.getWorkCellCodeBak());
|
||||
stationRequestBean.setClientInfo(clientInfo);
|
||||
stationRequestBean.setInterfaceType(MesPcnConstWords.SHIPPING);
|
||||
stationRequestBean.setBusiType(MesPcnEnumUtil.ACTOR_RECEIVE_STRATEGY.WS_CMD_DO_SCAN.getCode());
|
||||
stationRequestBean.setForceJumpProcess(true);
|
||||
shippingDispatchService.sendScanQueueNextExec(stationRequestBean);
|
||||
|
||||
}
|
||||
|
||||
stepSendMsgAndThrowEx(reqBean, resultBean.writeDbLog(), String.format("生产线[%s]工位[%s]触发所有在线分屏重置工序成功!", reqBean.getWorkCenterCode(), reqBean.getWorkCellCode()));
|
||||
|
||||
return stepResult;
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue