Commit 8e48a9c5 LN

bug修改

1 个父辈 92dc9d31
......@@ -566,6 +566,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
if(barcode.isToXray()){
log.info("物料["+barcode.getBarcode()+"]需要先去点料" );
resultMap.put("result", "110");
resultMap.put("barcode", barcode.getBarcode());
errorMsg= MessageUtils.getText("smfcore.api.toXray",new String[]{barcode.getBarcode()},new Locale("en","US"),"{0}需要去点料");
resultMap.put("msg", errorMsg);
}
......
......@@ -397,8 +397,19 @@ public class MicronApi {
log.info("调用MES接口 API006: url=" + url + ",body=" + paramStr + "");
MicronResult result = HttpHelper.postMicronJson(url, paramMap);
if (result.isOk()&& result.statusIsSuccess()) {
materialList = result.getResult("materials");
if (result.isOk()) {
List<Object> objects = result.getResult("materials",false);
if(objects==null||objects.size()<=0){
log.info("API006 ,接口通信失败");
throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API006"});
}
for (Object object :
objects) {
Material material= JsonUtil.toObj(JsonUtil.toJsonStr( object) ,Material.class);
materialList.add(material);
}
return materialList;
}else{
log.info("API006 ,接口通信失败");
......@@ -409,7 +420,6 @@ public class MicronApi {
log.error(url + "出错", e);
return null;
}
return materialList;
}
......
......@@ -12,6 +12,6 @@ import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
public class IdInfo implements Serializable {
private String IdStr;
private String Id;
private List<Object> Attribute;
}
\ No newline at end of file
package com.neotel.smfcore.custom.micron1053.task;
import com.mks.api.response.APIException;
import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ApiException;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.JsonUtil;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.device.enums.OP;
......@@ -89,8 +91,35 @@ public class MicronPreTaskController {
@ApiOperation("出库页面展示")
@AnonymousAccess
@GetMapping("/getTaskId")
public ResultBean task(String mode) throws ApiException{
public ResultBean task(String mode) throws ApiException {
//
// MicronResult result = new MicronResult(200,"{\n" +
// " \"trasactionId\": \"00000000-0000-0000-0000-000000000000\",\n" +
// " \"materials\": [\n" +
// " {\n" +
// " \"serialNum\": \"P2SITPCB001\",\n" +
// " \"partNumber\": \"550-502922\"\n" +
// " }\n" +
// " ]\n" +
// "}");
// if (result.isOk()) {
// List<Object> materialList = result.getResult("materials",false);
// if(materialList.size()>0){
// if (materialList != null && !materialList.isEmpty()) {
// //生成工单进行出库
// List<LiteOrderItem> itemList = new ArrayList<>();
// for (Object object : materialList) {
// Material material= JsonUtil.toObj(JsonUtil.toJsonStr( object) ,Material.class);
//
// }
// }
// }
// }else{
//
// log.info("API006 ,接口通信失败");
// throw new ApiException("smfcore.api.fail", "{0} Failed to get data", new String[]{"API006"});
// }
//判断是否验证
if (!MicronApi.isEnable()) {
return ResultBean.newErrorResult(9, "smfcore.micron.apiClose", " Not yet open");
......@@ -299,6 +328,17 @@ public class MicronPreTaskController {
log.info(" abort :mode=" + mode);
LiteOrder order = getOrderByMode(mode);
if (order == null) {
//如果dto不是空
if(dto!=null){
//清空配置
String key=Constants.CACHE_DISPATCH+order.getMode();
log.info("abort mode="+order.getMode()+" 清空 key="+key+" 的cache");
dataCache.updateCache(key,"");
return ResultBean.newOkResult("");
}
return ResultBean.newErrorResult(-1, "smfcore.micron.operationFailure", "操作失败");
}
List<LiteOrderItem> liteOrderItemList = order.getOrderItems();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!