Commit acabb8f1 LN

hotayi锡膏料仓修改:1.F4_StockOut增加回温时间设置。2.只有出库任务才调用outNotifyUrl。

1 个父辈 d7bca2ab
...@@ -112,7 +112,7 @@ public class SmfApi { ...@@ -112,7 +112,7 @@ public class SmfApi {
if(isUrlExist(inNotifyUrl)){ if(isUrlExist(inNotifyUrl)){
apiListener.inTaskStatusChange(inNotifyUrl,task); apiListener.inTaskStatusChange(inNotifyUrl,task);
} }
}else{ }else if(task.isCheckOutTask()){
if(isUrlExist(outNotifyUrl)){ if(isUrlExist(outNotifyUrl)){
apiListener.outTaskStatusChange(outNotifyUrl,task); apiListener.outTaskStatusChange(outNotifyUrl,task);
} }
......
...@@ -6,6 +6,7 @@ import com.neotel.smfcore.common.utils.DateUtil; ...@@ -6,6 +6,7 @@ import com.neotel.smfcore.common.utils.DateUtil;
import com.neotel.smfcore.common.utils.HttpHelper; import com.neotel.smfcore.common.utils.HttpHelper;
import com.neotel.smfcore.common.utils.JsonUtil; import com.neotel.smfcore.common.utils.JsonUtil;
import com.neotel.smfcore.core.api.bean.ApiResult; import com.neotel.smfcore.core.api.bean.ApiResult;
import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager; import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.manager.IComponentManager; import com.neotel.smfcore.core.barcode.service.manager.IComponentManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
...@@ -54,11 +55,12 @@ public abstract class BaseSmfApiListener implements ISmfApiListener { ...@@ -54,11 +55,12 @@ public abstract class BaseSmfApiListener implements ISmfApiListener {
@Autowired @Autowired
private IComponentManager componentManager; private IComponentManager componentManager;
protected Component resolveComponent(Barcode barcode){ protected Component resolveComponent(Barcode barcode,int type){
Component component = componentManager.findByPartNumberAndProvider(barcode.getPartNumber(),barcode.getProvider()); Component component = componentManager.findByPartNumberAndProvider(barcode.getPartNumber(),barcode.getProvider());
if(component == null){ if(component == null){
log.info("自动添加["+barcode.getPartNumber()+"]["+barcode.getProvider()+"]的档案信息"); log.info("自动添加["+barcode.getPartNumber()+"]["+barcode.getProvider()+"]的档案信息");
component = new Component(); component = new Component();
component.setType(type);
component.setPartNumber(barcode.getPartNumber()); component.setPartNumber(barcode.getPartNumber());
component.setAmount(barcode.getAmount()); component.setAmount(barcode.getAmount());
int w = barcode.getPlateSize(); int w = barcode.getPlateSize();
...@@ -70,7 +72,9 @@ public abstract class BaseSmfApiListener implements ISmfApiListener { ...@@ -70,7 +72,9 @@ public abstract class BaseSmfApiListener implements ISmfApiListener {
} }
return component; return component;
} }
protected Component resolveComponent(Barcode barcode){
return resolveComponent(barcode, COMPONENT_TYPE.COMPONENT);
}
@Override @Override
public void inTaskStatusChange(String inNotifyUrl, DataLog task){ public void inTaskStatusChange(String inNotifyUrl, DataLog task){
......
...@@ -294,13 +294,17 @@ public class SpBoxHandler extends BaseDeviceHandler { ...@@ -294,13 +294,17 @@ public class SpBoxHandler extends BaseDeviceHandler {
statusBean.addData("posId", task.getPosName()); statusBean.addData("posId", task.getPosName());
DataLog rewarmPuttingTask = findRewarmPuttingTask(task); DataLog rewarmPuttingTask = findRewarmPuttingTask(task);
statusBean.addData("secondPosId", rewarmPuttingTask.getPosName()); if (rewarmPuttingTask == null) {
log.error("[" + cid + "]回温取料任务[" + task.getBarcode() + "][" + task.getPosName() + "]未找到回温放料任务");
} else {
statusBean.addData("secondPosId", rewarmPuttingTask.getPosName());
log.info(task.getBarcode() + "回温移库信息发送到客户端[" + task.getPosName() + "]=>" + rewarmPuttingTask.getPosName()); log.info(task.getBarcode() + "回温移库信息发送到客户端[" + task.getPosName() + "]=>" + rewarmPuttingTask.getPosName());
rewarmPuttingTask.setStatus(OP_STATUS.EXECUTING.name()); rewarmPuttingTask.setStatus(OP_STATUS.EXECUTING.name());
taskService.updateQueueTask(rewarmPuttingTask); taskService.updateQueueTask(rewarmPuttingTask);
}
task.setStatus(OP_STATUS.EXECUTING.name()); task.setStatus(OP_STATUS.EXECUTING.name());
taskService.updateQueueTask(task); taskService.updateQueueTask(task);
......
...@@ -11,6 +11,7 @@ import com.neotel.smfcore.core.api.bean.CodeValidateParam; ...@@ -11,6 +11,7 @@ import com.neotel.smfcore.core.api.bean.CodeValidateParam;
import com.neotel.smfcore.core.api.listener.BaseSmfApiListener; import com.neotel.smfcore.core.api.listener.BaseSmfApiListener;
import com.neotel.smfcore.core.barcode.bean.BarcodeRule; import com.neotel.smfcore.core.barcode.bean.BarcodeRule;
import com.neotel.smfcore.core.barcode.bean.CodeBean; import com.neotel.smfcore.core.barcode.bean.CodeBean;
import com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE;
import com.neotel.smfcore.core.barcode.service.manager.IComponentManager; import com.neotel.smfcore.core.barcode.service.manager.IComponentManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.barcode.utils.CodeResolve; import com.neotel.smfcore.core.barcode.utils.CodeResolve;
...@@ -153,15 +154,15 @@ public class HotayiApi extends BaseSmfApiListener { ...@@ -153,15 +154,15 @@ public class HotayiApi extends BaseSmfApiListener {
log.info(reelId + "入库验证返回 处理后" + result); log.info(reelId + "入库验证返回 处理后" + result);
HotayiBean hotayiBean = JsonUtil.toObj(result, HotayiBean.class); HotayiBean hotayiBean = JsonUtil.toObj(result, HotayiBean.class);
String resultMsgNo = hotayiBean.getInfoItem("MessageNo"); String resultMsgNo = hotayiBean.getInfoItem("MessageNo");
if (resultMsgNo.equals("M90")) { if (resultMsgNo.toUpperCase().equals("M90")) {
String errorCode = hotayiBean.getDataItem("ErrorCode"); String errorCode = hotayiBean.getDataItem("ErrorCode");
String errorMessage = hotayiBean.getDataItem("ErrorMessage"); String errorMessage = hotayiBean.getDataItem("ErrorMessage");
throw new ValidateException("mes.canputIn.ng","NG: ["+errorCode+"]"+errorMessage); throw new ValidateException("mes.canputIn.ng","NG: ["+errorCode+"]"+errorMessage);
}else{ }else{
Barcode barcode = new Barcode(); Barcode barcode = new Barcode();
String mesReelId = hotayiBean.getDataItem("SerialNo"); String mesReelId = hotayiBean.getDataItem("SerialNo").toString().trim();
String pn = hotayiBean.getDataItem("PartNo"); String pn = hotayiBean.getDataItem("PartNo").toString().trim();
String expireDateStr = hotayiBean.getDataItem("ExpireDate"); String expireDateStr = hotayiBean.getDataItem("ExpireDate");
if (Strings.isNotBlank(mesReelId)) { if (Strings.isNotBlank(mesReelId)) {
...@@ -170,14 +171,18 @@ public class HotayiApi extends BaseSmfApiListener { ...@@ -170,14 +171,18 @@ public class HotayiApi extends BaseSmfApiListener {
barcode = dbBarcode; barcode = dbBarcode;
} }
barcode.setBarcode(mesReelId); barcode.setBarcode(mesReelId);
}else{
throw new ValidateException("mes.canputIn.ng","NG: [SerialNo==null]");
} }
barcode.setPlateSize(codeBean.getReelWidth());
barcode.setHeight(codeBean.getReelHeight());
if (Strings.isNotBlank(pn)) { if (Strings.isNotBlank(pn)) {
barcode.setPartNumber(pn); barcode.setPartNumber(pn);
}else{
throw new ValidateException("mes.canputIn.ng","NG: [PartNo==null]");
} }
barcode.setPlateSize(codeBean.getReelWidth());
barcode.setHeight(codeBean.getReelHeight());
if (Strings.isNotBlank(expireDateStr)) { if (Strings.isNotBlank(expireDateStr)) {
Date expireDate = DateUtil.toDate(expireDateStr, "yyyy-MM-dd"); Date expireDate = DateUtil.toDate(expireDateStr, "yyyy-MM-dd");
barcode.setExpireDate(expireDate); barcode.setExpireDate(expireDate);
...@@ -188,7 +193,7 @@ public class HotayiApi extends BaseSmfApiListener { ...@@ -188,7 +193,7 @@ public class HotayiApi extends BaseSmfApiListener {
}if(barcode.getAmount()<=0){ }if(barcode.getAmount()<=0){
barcode.setAmount(1); barcode.setAmount(1);
} }
resolveComponent(barcode); resolveComponent(barcode, COMPONENT_TYPE.SOLDERPASTE);
barcode = barcodeManager.saveBarcode(barcode); barcode = barcodeManager.saveBarcode(barcode);
return barcode; return barcode;
} }
......
package com.neotel.smfcore.custom.hotayi20057; package com.neotel.smfcore.custom.hotayi20057;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.DateUtil; import com.neotel.smfcore.common.utils.DateUtil;
...@@ -199,9 +200,14 @@ public class HotayiController { ...@@ -199,9 +200,14 @@ public class HotayiController {
// "Data": {"Barcode": "A069-O9","RequestDate": "2023-04-12 17:20","MixerBySecond": "0","StandbyHour": 0}} // "Data": {"Barcode": "A069-O9","RequestDate": "2023-04-12 17:20","MixerBySecond": "0","StandbyHour": 0}}
String barcode = hotayiBean.getDataItem("Barcode"); String barcode = hotayiBean.getDataItem("Barcode");
String RequestDate = hotayiBean.getDataItem("RequestDate"); String RequestDate = hotayiBean.getDataItem("RequestDate");
String MixerBySecond = hotayiBean.getDataItem("MixerBySecond"); String MixerBySecondStr = hotayiBean.getDataItem("MixerBySecond");
Integer StandbyHour = hotayiBean.getDataItem("StandbyHour"); Integer StandbyHour = hotayiBean.getDataItem("StandbyHour");
Integer MixerBySecond= 0;
try {
Convert.toInt(MixerBySecondStr);
}catch (Exception ex) {
log.error("MixerBySecondStr[" + MixerBySecondStr + "]转为int出错:" + ex.getMessage());
}
Date outDate=DateUtil.toDate(RequestDate,"yyyy-MM-dd HH:mm"); Date outDate=DateUtil.toDate(RequestDate,"yyyy-MM-dd HH:mm");
if(outDate==null){ if(outDate==null){
log.info("M7: requestDate==null 重置为当前时间"); log.info("M7: requestDate==null 重置为当前时间");
...@@ -230,7 +236,7 @@ public class HotayiController { ...@@ -230,7 +236,7 @@ public class HotayiController {
//需要定时出库 //需要定时出库
// String result = taskService.checkout(pos,true,null,false); // String result = taskService.checkout(pos,true,null,false);
boolean result = setOutDate(pos,outDate); boolean result = setOutDate(pos,outDate,StandbyHour,MixerBySecond);
if (!result) { if (!result) {
String msg = MessageUtils.getText("smfcore.operationFailure", locale, "Operation failed"); String msg = MessageUtils.getText("smfcore.operationFailure", locale, "Operation failed");
hotayiBean.setM90(73, msg); hotayiBean.setM90(73, msg);
...@@ -246,13 +252,17 @@ public class HotayiController { ...@@ -246,13 +252,17 @@ public class HotayiController {
return hotayiBean; return hotayiBean;
} }
private boolean setOutDate( StoragePos pos, Date outDate) { private boolean setOutDate( StoragePos pos, Date outDate,Integer StandbyHour,Integer MixerBySecond ) {
Barcode barcode = pos.getBarcode(); Barcode barcode = pos.getBarcode();
if (barcode != null) { if (barcode != null) {
log.info("设定仓位【" + pos.getPosName() + "】中的锡膏[" + barcode.getBarcode() + "]出库时间:" + DateUtil.toDateTimeString(outDate)); log.info("设定仓位【" + pos.getPosName() + "】中的锡膏[" + barcode.getBarcode() + "]出库时间:"
+ DateUtil.toDateTimeString(outDate)+",StandbyHour="+StandbyHour+",MixerBySecond="+MixerBySecond);
try { try {
barcode.setSolderStatus(SOLDER_STATUS.TO_BE_REWARM.name()); barcode.setSolderStatus(SOLDER_STATUS.TO_BE_REWARM.name());
barcode.setNeedOutDate(outDate); barcode.setNeedOutDate(outDate);
barcode.setWarmTime(StandbyHour*60);
barcode.setMixTime(MixerBySecond);
barcode.setMixTime(0);
barcodeManager.save(barcode); barcodeManager.save(barcode);
pos.setBarcode(barcode); pos.setBarcode(barcode);
storagePosManager.save(pos); storagePosManager.save(pos);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!