feat(exit-cut): 添加甩尾信号发送功能并扩展字典数据长度
- 在 ExitCutHandler 中注入 OpcReceiverHandler 用于消息发送 - 添加 EntryMovementMessage 导入并实现甩尾信号发送逻辑 - 将字典数据表中字典键值长度限制从100字符扩展到10000字符 - 优化 SysDictData 中 toString 方法的代码格式 - 在 EXIT_CUT 消息处理完成后发送 ENTRY_MOVEMENT 消息实现甩尾功能
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.json.JSONUtil;
|
||||
import com.fizz.business.anno.OpcMessageHandlerType;
|
||||
import com.fizz.business.constants.enums.L1OperateMatEnum;
|
||||
import com.fizz.business.constants.enums.OpcMessageType;
|
||||
import com.fizz.business.domain.msg.EntryMovementMessage;
|
||||
import com.fizz.business.domain.msg.ExitCutMessage;
|
||||
import com.fizz.business.dto.ExitCoilInfoDTO;
|
||||
import com.fizz.business.dto.MatmapDTO;
|
||||
@@ -16,6 +17,8 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static com.fizz.business.constants.enums.DeviceEnum.TR;
|
||||
|
||||
@Component
|
||||
@@ -27,7 +30,8 @@ public class ExitCutHandler implements OpcMessageHandler<ExitCutMessage> {
|
||||
// 注入 PdoExCoilService
|
||||
private final PdoExCoilService pdoExCoilService;
|
||||
private final TrackService trackService;
|
||||
|
||||
@Resource
|
||||
private OpcReceiverHandler opcReceiverHandler;
|
||||
@Override
|
||||
public void handle(ExitCutMessage message) {
|
||||
// 1. 获取卷取机 (TR) 上的物料信息
|
||||
@@ -50,12 +54,22 @@ public class ExitCutHandler implements OpcMessageHandler<ExitCutMessage> {
|
||||
pdoExCoilService.saveExCoil(exitCoilInfo);
|
||||
|
||||
if (exitCoilInfo.isLastFlag()) {
|
||||
|
||||
trackService.l1OperateMat(L1OperateMatForm.builder()
|
||||
.trIdx(TR.getIdx())
|
||||
.entryMatId(trMatmap.getMatId())
|
||||
.planId(trMatmap.getPlanId())
|
||||
.operation(L1OperateMatEnum.PRODUCT)
|
||||
.build());
|
||||
|
||||
// wangyu 配合二级发一个甩尾信号 01全甩一下
|
||||
EntryMovementMessage msg = new EntryMovementMessage();
|
||||
msg.setCounter(message.getCounter());
|
||||
msg.setMaterialPlaceSource(0);
|
||||
msg.setMaterialPlaceDestination(200);
|
||||
opcReceiverHandler.onMessageReceived(OpcMessageType.ENTRY_MOVEMENT,msg);
|
||||
msg.setMaterialPlaceSource(1);
|
||||
opcReceiverHandler.onMessageReceived(OpcMessageType.ENTRY_MOVEMENT,msg);
|
||||
}
|
||||
|
||||
log.info("成功处理 EXIT_CUT 消息,已保存成品卷: " + exitCoilInfo.getExitMatId());
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 字典数据表 sys_dict_data
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class SysDictData extends BaseEntity
|
||||
@@ -85,7 +85,7 @@ public class SysDictData extends BaseEntity
|
||||
}
|
||||
|
||||
@NotBlank(message = "字典键值不能为空")
|
||||
@Size(min = 0, max = 100, message = "字典键值长度不能超过100个字符")
|
||||
@Size(min = 0, max = 10000, message = "字典键值长度不能超过10000个字符")
|
||||
public String getDictValue()
|
||||
{
|
||||
return dictValue;
|
||||
@@ -153,24 +153,24 @@ public class SysDictData extends BaseEntity
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("dictCode", getDictCode())
|
||||
.append("dictSort", getDictSort())
|
||||
.append("dictLabel", getDictLabel())
|
||||
.append("dictValue", getDictValue())
|
||||
.append("dictType", getDictType())
|
||||
.append("cssClass", getCssClass())
|
||||
.append("listClass", getListClass())
|
||||
.append("isDefault", getIsDefault())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
.append("dictCode", getDictCode())
|
||||
.append("dictSort", getDictSort())
|
||||
.append("dictLabel", getDictLabel())
|
||||
.append("dictValue", getDictValue())
|
||||
.append("dictType", getDictType())
|
||||
.append("cssClass", getCssClass())
|
||||
.append("listClass", getListClass())
|
||||
.append("isDefault", getIsDefault())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user