Commit 59f31eb2 hc

NG料出库

1 个父辈 3ce699ec
......@@ -1010,6 +1010,36 @@ public class LuxsanApi extends DefaultSmfApiListener {
}
}
public static List<GetBoxNGResult> getBoxNGsnList(GetBoxNGsnListRequest request) {
try {
log.info("getBoxNGsnList接口请求参数为:" + JSON.toJSONString(request));
String resultStr = HttpHelper.postJson(getBoxNGsnListUrl, request);
log.info("getBoxNGsnList接口返回结果为:" + resultStr);
JSONObject resultJson = JsonUtil.toObj(resultStr, JSONObject.class);
if (resultJson != null) {
if (resultJson.getString("data") != null) {
JSONObject dataJson = resultJson.getJSONObject("data");
if (dataJson.get("result") != null && !dataJson.getBoolean("result")) {
String errorMessage = (String) dataJson.get("message");
if (StringUtils.isEmpty(errorMessage)) {
errorMessage = "";
}
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}],失败原因[{1}]", new String[]{getBoxNGsnListUrl, errorMessage});
} else {
List<GetBoxNGResult> resultList = JSONObject.parseArray(dataJson.getString("data"), GetBoxNGResult.class);
if (resultList != null && !resultList.isEmpty()) {
return resultList;
}
}
}
}
} catch (ApiException e) {
log.error("getBoxNGsnList接口请求失败:" + e.getMessage());
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{e.getMessage()});
}
throw new ValidateException("smfcore.api.error", "接口请求失败[{0}]", new String[]{"getBoxNGsnListUrl"});
}
@Override
public void outTaskStatusChange(String outNotifyUrl, DataLog task) {
......@@ -1291,4 +1321,10 @@ public class LuxsanApi extends DefaultSmfApiListener {
public void setTicketUpUrl(String url){
LuxsanApi.ticketUpUrl = url;
}
public static String getBoxNGsnListUrl;
@Value("${api.getBoxNGsnListUrl}")
public void setBoxNGsnListUrl(String url){
LuxsanApi.getBoxNGsnListUrl = url;
}
}
package com.neotel.smfcore.custom.luxsan.api.bean.request;
import lombok.Data;
/**
* 获取料箱ngsn列表
*/
@Data
public class GetBoxNGsnListRequest {
/**
* 机种
*/
private String model;
/**
* 料箱号
*/
private String carton_id;
}
package com.neotel.smfcore.custom.luxsan.api.bean.result;
import lombok.Data;
/**
* 获取料箱的NG列表
*/
@Data
public class GetBoxNGResult {
/**
* sn号
*/
private String SN;
/**
* ng的原因
*/
private String NGREASON;
/**
* 行号
*/
private Integer ROW;
/**
* 列号
*/
private Integer COLUMN;
}
......@@ -24,9 +24,11 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import com.neotel.smfcore.core.system.util.TaskService;
import com.neotel.smfcore.custom.luxsan.api.LuxsanApi;
import com.neotel.smfcore.custom.luxsan.api.bean.request.FetchPalletInfoRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.request.GetBoxNGsnListRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.request.PalletUpdateRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.request.ValidCartonRequest;
import com.neotel.smfcore.custom.luxsan.api.bean.result.FetchPalletInfoResult;
import com.neotel.smfcore.custom.luxsan.api.bean.result.GetBoxNGResult;
import com.neotel.smfcore.custom.luxsan.api.bean.result.ValidCartonResult;
import com.neotel.smfcore.custom.luxsan.api.enums.PalletEnum;
import com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil;
......@@ -332,6 +334,15 @@ public class LineController {
return ResultBean.newOkResult("");
}
@ApiOperation("手动绑定料箱和cartonId")
@RequestMapping("/getBoxNGsnList")
@AnonymousAccess
public ResultBean getBoxNGsnList(@RequestBody GetBoxNGsnListRequest result){
log.info("机种["+result.getModel()+"]和CartonId:" + result.getCarton_id());
List<GetBoxNGResult> boxNGsnList = LuxsanApi.getBoxNGsnList(result);
return ResultBean.newOkResult(boxNGsnList);
}
@ApiOperation("手动完成入库任务")
@RequestMapping("/finishedInTask")
@AnonymousAccess
......
......@@ -163,4 +163,7 @@ api:
ticketUp: http://10.68.30.22:8082/api/mlb/TicketUp
#自动仓内单据转库
ticketMove: http://10.42.220.171:8082/api/mlb/TicketMove
\ No newline at end of file
ticketMove: http://10.42.220.171:8082/api/mlb/TicketMove
#获取箱内NGSN列表
getBoxNGsnListUrl: http://10.68.25.30:8000/mesoffline/GetBoxNgSnList
......@@ -163,4 +163,7 @@ api:
ticketUp: http://10.42.220.171:8082/api/mlb/TicketUp
#自动仓内单据转库
ticketMove: http://10.42.220.171:8082/api/mlb/TicketMove
\ No newline at end of file
ticketMove: http://10.42.220.171:8082/api/mlb/TicketMove
#获取箱内NGSN列表
getBoxNGsnListUrl: http://10.68.25.30:8000/mesoffline/GetBoxNgSnList
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!