Commit 127bd4ff LN

合入1053分支:新增RobotBoxHandler,接口测试

1 个父辈 120e0694
package com.neotel.smfcore.common.utils; package com.neotel.smfcore.common.utils;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.neotel.smfcore.common.exception.ApiException; import com.neotel.smfcore.common.exception.ApiException;
import com.neotel.smfcore.custom.micron1053.bean.MicronResult;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import lombok.val; import lombok.val;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
...@@ -12,6 +14,7 @@ import org.apache.http.client.HttpClient; ...@@ -12,6 +14,7 @@ import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig; import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.utils.URIBuilder; import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.StringEntity; import org.apache.http.entity.StringEntity;
...@@ -169,4 +172,62 @@ public class HttpHelper { ...@@ -169,4 +172,62 @@ public class HttpHelper {
} }
} }
public static MicronResult getMicronJson(String url ) throws ApiException {
if(ObjectUtil.isEmpty(url)) {
return new MicronResult();
}
HttpGet httpGet = new HttpGet(url);
httpGet.addHeader("Content-Type", "application/json;charset=utf-8");
// // 设置请求参数
// if (params != null && !params.isEmpty()) {
// ObjectMapper mapper = new ObjectMapper();
// try {
// String requestBody = mapper.writeValueAsString(params);
// httpGet.seb(new StringEntity(requestBody,CONTENT_CHARSET));
// } catch (JsonProcessingException e) {
// throw new ApiException("Request params to [" + url + "] failed:" + e.getMessage());
// } catch (Exception e) {
// throw new ApiException("Request params to [" + url + "] failed:" + e.getMessage());
// }
// }
try {
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = httpClient.execute(httpGet);
int code = response.getStatusLine().getStatusCode();
//System.out.println(response.getStatusLine().getStatusCode() + "\n");
HttpEntity entity = response.getEntity();
String responseContent = EntityUtils.toString(entity, CONTENT_CHARSET);
MicronResult result = JsonUtil.toObj(responseContent, MicronResult.class);
if (result == null) {
result = new MicronResult();
}
result.setHttpCode(code);
result.setResponseData(responseContent);
response.close();
httpClient.close();
return result;
} catch (Exception e) {
throw new ApiException("Request to [" + url + "] failed:" + e.getMessage());
}
}
public static MicronResult postMicronJson(String url , Map<String, Object> params) throws ApiException {
try {
if(ObjectUtil.isEmpty(url)) {
return new MicronResult();
}
String responseContent = postJson(url, params);
MicronResult result = JsonUtil.toObj(responseContent, MicronResult.class);
if (result == null) {
result = new MicronResult();
}
result.setResponseData(responseContent);
return result;
} catch (Exception e) {
throw new ApiException("Request to [" + url + "] failed:" + e.getMessage());
}
}
} }
...@@ -38,6 +38,24 @@ public enum OP_STATUS { ...@@ -38,6 +38,24 @@ public enum OP_STATUS {
/** /**
* 已结束 * 已结束
*/ */
END END ,
/**
* 已从仓位中取出
*/
OUTBOX,
/**
* 机器人正在移栽中
*/
INROBOT,
/**
* 已放到料仓门口
*/
BOXDOOR,
/**
* 已放到料仓门口无料盘
*/
BOXDOOR_NOREEL
; ;
} }
...@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.bean.ResultBean; ...@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.exception.ValidateException; import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants; import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.ReelLockPosUtil; import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.SecurityUtils;
import com.neotel.smfcore.core.api.SmfApi; import com.neotel.smfcore.core.api.SmfApi;
import com.neotel.smfcore.core.api.bean.CodeValidateParam; import com.neotel.smfcore.core.api.bean.CodeValidateParam;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
...@@ -570,5 +571,17 @@ public class DeviceController { ...@@ -570,5 +571,17 @@ public class DeviceController {
// } // }
return ResultBean.newOkResult(""); return ResultBean.newOkResult("");
} }
@ApiOperation("全部出库")
@RequestMapping(value = "/service/store/outAll")
@ResponseBody
@AnonymousAccess
public ResultBean outAll(){
//查找全部库位
List<StoragePos> storagePosList = storagePosManager.findNotEmpty();
//开始进行出库操作
for (StoragePos storagePos : storagePosList) {
taskService.addTaskToFinished(storagePos,null, SecurityUtils.getCurrentUsername()+"outAll");
}
return ResultBean.newOkResult("");
}
} }
...@@ -715,6 +715,19 @@ public class DataCache { ...@@ -715,6 +715,19 @@ public class DataCache {
} }
return availableStorageIds; return availableStorageIds;
} }
public List<String> getAvailableStorageIds(DeviceType deviceType){
List<String> availableStorageIds = new ArrayList<>();
for (Storage storage : getAllStorage().values()) {
if(storage.getType().equals(deviceType.name())) {
StatusBean bean = DevicesStatusUtil.getStatusBean(storage.getCid());
if (bean == null || bean.timeOut() || !bean.isAvailable()) {
continue;
}
availableStorageIds.add(storage.getCid());
}
}
return availableStorageIds;
}
public Storage AutoCreateStorage(String cid,String deviceType) { public Storage AutoCreateStorage(String cid,String deviceType) {
//判断cid存在 //判断cid存在
Storage storage = null; Storage storage = null;
......
...@@ -117,7 +117,12 @@ public enum DeviceType { ...@@ -117,7 +117,12 @@ public enum DeviceType {
/** /**
* 18 (默认料仓) * 18 (默认料仓)
*/ */
DEFAULT("storage.type.default") DEFAULT("storage.type.default"),
/**
* 19 机器人料仓
*/
ROBOT_BOX("storage.type.robotBox");
; ;
private String key; private String key;
......
...@@ -309,4 +309,7 @@ public class Storage extends BasePo implements Serializable { ...@@ -309,4 +309,7 @@ public class Storage extends BasePo implements Serializable {
return getGroupId().equals(groupId); return getGroupId().equals(groupId);
} }
public boolean isRobotBox() {
return DeviceType.ROBOT_BOX.name().equals(type);
}
} }
...@@ -204,7 +204,10 @@ public class DataLog extends BasePo implements Serializable { ...@@ -204,7 +204,10 @@ public class DataLog extends BasePo implements Serializable {
* 如果是出库任务,需要记录入库时间 * 如果是出库任务,需要记录入库时间
*/ */
private Date putInDate; private Date putInDate;
/**
* 位置信息,如料架编号,托盘编号,移栽编号,皮带线编号,机器人编号等
*/
private String locInfo = "";
/** /**
* MSD附加信息 * MSD附加信息
*/ */
...@@ -256,7 +259,16 @@ public class DataLog extends BasePo implements Serializable { ...@@ -256,7 +259,16 @@ public class DataLog extends BasePo implements Serializable {
return theStatus.name().equals(status); return theStatus.name().equals(status);
} }
public boolean isOutBox(){
return OP_STATUS.OUTBOX.name().equals(status);
}
public boolean isInRobot(){
return OP_STATUS.INROBOT.name().equals(status);
}
public boolean isBoxdoor(){
return OP_STATUS.BOXDOOR.name().equals(status) || OP_STATUS.BOXDOOR_NOREEL.equals(status);
}
/** /**
* 是否是入库任务 * 是否是入库任务
*/ */
......
package com.neotel.smfcore.custom.micron1053.bean;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Data
@Slf4j
@AllArgsConstructor
@NoArgsConstructor
public class MaterialInfo implements Serializable {
// "Label2DID": "<Label2DID>",
// "TowerID": "<TowerID>|null",
// "StorageBin": "<StorageBin>|null",
// "Qty": "<Label Qty>|<X-Ray Qty>",
// "X-RayCheck": "Yes|No|N/A",
// "ErrorCode": "0-Success|1-Rejected",
// "ErrorMessage": "N/A|<ErrorMessage>"
private String Label2DID;
private String TowerID;
private String StorageBin;
private String Qty;
private String XRayCheck;
private String ErrorCode;
private String ErrorMessage;
// "Label2DID": "<Label2DID>",
// "FromTowerID": "<TowerID>",
// "FromStorageBin": "<StorageBin>",
// "Qty": "<Qty>",
private String FromTowerID;
private String FromStorageBin;
public static MaterialInfo NewMaterial(Map<String,String> map) {
MaterialInfo mInfo = new MaterialInfo();
try {
mInfo.setLabel2DID(map.getOrDefault("Label2DID", ""));
mInfo.setTowerID(map.getOrDefault("TowerID", ""));
mInfo.setStorageBin(map.getOrDefault("StorageBin", ""));
mInfo.setXRayCheck(map.getOrDefault("X-RayCheck", ""));
mInfo.setErrorCode(map.getOrDefault("ErrorCode", ""));
mInfo.setErrorMessage(map.getOrDefault("ErrorMessage", ""));
mInfo.setQty( map.getOrDefault("Qty", "0"));
mInfo.setFromTowerID(map.getOrDefault("FromTowerID", ""));
mInfo.setFromStorageBin(map.getOrDefault("FromStorageBin", ""));
} catch (Exception ex) {
}
return mInfo;
}
public static List<MaterialInfo> GetObjList(List<Map<String,String>> arrList){
List<MaterialInfo> materialInfos=new ArrayList<>();
for (Map<String, String> o :
arrList) {
MaterialInfo mInfo = MaterialInfo.NewMaterial(o);
materialInfos.add(mInfo);
}
return materialInfos;
}
public static List<Map<String,String>> ToLoadingList(List<MaterialInfo> list){
List<Map<String,String>> arrList=new ArrayList<>();
for (MaterialInfo obj :list
) {
Map<String,String> map=new HashMap<>();
map.put("Label2DID",obj.getLabel2DID());
map.put("TowerID",obj.getTowerID());
map.put("StorageBin",obj.getStorageBin());
map.put("X-RayCheck",obj.getXRayCheck());
map.put("ErrorCode",obj.getErrorCode());
map.put("ErrorMessage",obj.getErrorMessage());
map.put("Qty",obj.getQty().toString());
arrList.add(map);
}
return arrList;
}
public static List<Map<String,String>> ToDispatchList(List<MaterialInfo> list){
List<Map<String,String>> arrList=new ArrayList<>();
for (MaterialInfo obj :list
) {
Map<String,String> map=new HashMap<>();
map.put("FromTowerID",obj.getFromTowerID());
map.put("FromStorageBin",obj.getFromStorageBin());
map.put("Qty",obj.getQty().toString());
arrList.add(map);
}
return arrList;
}
}
package com.neotel.smfcore.custom.micron1053.bean;
import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Slf4j
public class MicronResult implements Serializable {
// {
// Status : <Success|Fail>
// Message : <Error Message>
// }
private Integer httpCode=0;
private String status;
private String message;
private String responseData;
public boolean isSuccess() {
if (ObjectUtil.isNotEmpty(status) && status.equals("Success")) {
return true;
}
return false;
}
}
package com.neotel.smfcore.custom.micron1053.controller;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.utils.HttpHelper;
import com.neotel.smfcore.core.api.listener.BaseSmfApiListener;
import com.neotel.smfcore.custom.micron1053.bean.MaterialInfo;
import com.neotel.smfcore.custom.micron1053.bean.MicronResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/rest/api/micron")
@Slf4j
public class MicronApi extends BaseSmfApiListener {
private static MicronConfig config;
@Autowired
public void setConfig(MicronConfig config){
MicronApi.config=config;
}
@Override
public boolean isForThisApi(String apiName) {
// return apiName != null && apiName.equalsIgnoreCase("Micron");
return ObjectUtil.isNotEmpty(config.micronAddr);
}
private static String GetSkipSap(String skipSap) {
if(skipSap.toUpperCase().toString().equals("TRUE")||skipSap.toUpperCase().toString().equals("YES")){
return "YES";
}
return "NO";
}
public static MicronResult validateMRB(String mbrId, String skipSap) {
//Validate if MBR (From Warehouse )  is valid
// if (skipSap instanceof Boolean) {
//
// skipSapStr = (boolean) skipSap ? "YES" : "NO";
// } else {
// skipSapStr = skipSap.toString();
// }
String skipSapStr = GetSkipSap(skipSap);
String url =config. getUrl(MessageFormat.format("validate/mrb/{0}/{1}", mbrId, skipSapStr));
try {
MicronResult result = HttpHelper.getMicronJson(url);
return result;
} catch (Exception e) {
log.error(url + "出错", e);
}
return null;
}
public static MicronResult validateREQ(String reqId) {
//Validate if REQ (From Outside Shelf) is valid
String url = config.getUrl(MessageFormat.format("validate/req/{0}", reqId));
try {
MicronResult result = HttpHelper.getMicronJson(url);
return result;
} catch (Exception e) {
log.error(url + "出错", e);
}
return null;
}
public static MicronResult validateMCL(String PurchaseOrder, String PackagingSlip, String skipSap) {
//Validate if MCL GR  is valid
//validate/mcl/{PurchaseOrder}/{PackagingSlip}/{SkipSap}
// {PurchaseOrder}=<purchase order>,
// {PackagingSlip}=<packaging slide>,
// {SkipSAP}="YES|No"
String skipSapStr = GetSkipSap(skipSap);
String url = config.getUrl(MessageFormat.format("validate/mcl/{0}/{1}/{2}", PurchaseOrder, PackagingSlip, skipSapStr));
try {
MicronResult result = HttpHelper.getMicronJson(url);
return result;
} catch (Exception e) {
log.error(url + "出错", e);
}
return null;
}
public static MicronResult validateMaterial(String Label2DID, String LoadingMode) {
//Validate the material before loading into the storage bin
//validate/material
// {
// "Label2DID" : "<2DID String that contains SAP P/N; S/N; Supplier..etc>",
// "LoadingMode" : "MBR|REQ|GR|MCL|RET|NPI"
// }
String url = config.getUrl( "validate/material" );
Map<String, Object> dataMap = new HashMap<String, Object>();
dataMap.put("Label2DID", Label2DID);
dataMap.put("LoadingMode", LoadingMode);
try {
MicronResult result = HttpHelper.postMicronJson(url, dataMap);
return result;
} catch (Exception e) {
log.error(url + "出错", e);
}
return null;
}
public static MicronResult loadReport(String JobId, List<MaterialInfo> materialInfos) {
//Update material storage location at rod or magazine slot level (One JobID per rod or slot).
//load-report
// {
// "JobId": "<job Id>",
// "Materials": [
// {
// "Label2DID": "<Label2DID>",
// "TowerID": "<TowerID>|null",
// "StorageBin": "<StorageBin>|null",
// "Qty": "<Label Qty>|<X-Ray Qty>",
// "X-RayCheck": "Yes|No|N/A",
// "ErrorCode": "0-Success|1-Rejected",
// "ErrorMessage": "N/A|<ErrorMessage>"
// }
//]
// }
String url = config.getUrl( "load-report" );
Map<String, Object> dataMap = new HashMap<String, Object>();
dataMap.put("JobId", JobId);
dataMap.put("Materials", MaterialInfo.ToLoadingList(materialInfos));
try {
MicronResult result = HttpHelper.postMicronJson(url, dataMap);
return result;
} catch (Exception e) {
log.error(url + "出错", e);
}
return null;
}
public static MicronResult dispatchList(String Facility, String DispatchType) {
//Get ready Pretask/LinePrep/RET list from Auto Kitting System
//dispatch-list/{Facility}/{DispatchType}
// {Facility} = "Grouping that need to align with KitView"
// {DispatchType}="PreTask|LinePrep|RET"
String url = config.getUrl(MessageFormat.format("dispatch-list/{0}/{1}", Facility, DispatchType));
try {
MicronResult result = HttpHelper.getMicronJson(url);
return result;
} catch (Exception e) {
log.error(url + "出错", e);
}
return null;
}
public static MicronResult dispatchMaterial(String DispatchType, String Id) {
//Get dispatch Material list  from Autokitting system to fullfil the Pretask or LinePrep
//dispatch-material/{DispatchType}/{Id}
// {DispatchType}="PreTask|LinePrep|RET"
// Id="<PretaskId>|<LinePrepId>|<RetId>"
String url = config.getUrl(String.format("dispatch-material/{0}/{1}", DispatchType, Id));
try {
MicronResult result = HttpHelper.getMicronJson(url);
return result;
} catch (Exception e) {
log.error(url + "出错", e);
}
return null;
}
public static MicronResult dispatchReport(String JobId, String dispatchType, List<MaterialInfo> materialInfos) {
//Update dispatch information by Job Level
//dispatch-report
// "JobId": "<JobId>",
// "DispatchType": "PreTask|LinePrep|RET|Warehouse|Controlled",
// "Materials": [
// {
// "Label2DID": "<Label2DID>",
// "FromTowerID": "<TowerID>",
// "FromStorageBin": "<StorageBin>",
// "Qty": "<Qty>",
// }
//]
String url = config.getUrl( "dispatch-report" );
Map<String, Object> dataMap = new HashMap<String, Object>();
dataMap.put("JobId", JobId);
dataMap.put("DispatchType", dispatchType);
dataMap.put("Materials", MaterialInfo.ToDispatchList(materialInfos));
try {
MicronResult result = HttpHelper.postMicronJson(url, dataMap);
return result;
} catch (Exception e) {
log.error(url + "出错", e);
}
return null;
}
}
package com.neotel.smfcore.custom.micron1053.controller;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.core.device.util.DataCache;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
@Service
@Slf4j
public class MicronConfig {
@Value("${micron.addr}")
public String micronAddr;
@Autowired
private DataCache dataCache;
public String getUrl(String apiName) {
if (ObjectUtil.isEmpty(micronAddr)) {
return "";
}
String url = micronAddr + apiName;
if (micronAddr.endsWith("/")) {
if (apiName.startsWith("/")) {
url = micronAddr + apiName.substring(1, apiName.length());
}
} else {
if (!apiName.startsWith("/")) {
url = micronAddr + "/" + apiName;
}
}
return micronAddr + apiName;
}
@PostConstruct
public void init() {
// host = dataCache.GetConfigCache("siemens.host", "siemens.host", url);
// port = dataCache.GetConfigCache("siemens.port", "siemens.port", url);
// url = dataCache.GetConfigCache("siemens.url", "siemens.url", url);
// action_GetMaterialLot = dataCache.GetConfigCache("siemens.action.GetMaterialLot", "siemens.action.GetMaterialLot", action_GetMaterialLot);
// action_ProcessMaterialLot = dataCache.GetConfigCache("siemens.action.ProcessMaterialLot", "siemens.action.ProcessMaterialLot", action_ProcessMaterialLot);
log.info("Micron sesrver addr:" + micronAddr );
}
}
package com.neotel.smfcore.custom.micron1053.controller;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.utils.JsonUtil;
import com.neotel.smfcore.custom.micron1053.bean.MaterialInfo;
import com.neotel.smfcore.custom.micron1053.bean.MicronResult;
import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(tags = "API测试")
@RequestMapping("rest/api/test")
public class MicronTestController {
@Autowired
private MicronApi apiController;
@ApiOperation("API-001 validate/mrb/{Id}/{SkipSap}")
@GetMapping("/validateMRB")
@AnonymousAccess
public String validateMRB(String Id, String SkipSap) {
MicronResult result = apiController.validateMRB(Id, SkipSap);
if (ObjectUtil.isEmpty(result)) {
return "";
}
return result.getResponseData();
}
@ApiOperation("API-002 validate/req/{Id}")
@GetMapping("/validateREQ")
@AnonymousAccess
public String validateREQ(String Id) {
MicronResult result = apiController.validateREQ(Id);
if (ObjectUtil.isEmpty(result)) {
return "";
}
return result.getResponseData();
}
@ApiOperation("API-003 validate/mcl/{PurchaseOrder}/{PackagingSlip}/{SkipSap}")
@GetMapping("/validateMCL")
@AnonymousAccess
public String validateMCL(String PurchaseOrder, String PackagingSlip, String skipSap) {
MicronResult result = apiController.validateMCL(PurchaseOrder, PackagingSlip, skipSap);
if (ObjectUtil.isEmpty(result)) {
return "";
}
return result.getResponseData();
}
@ApiOperation("API-004 validate/material")
@GetMapping("/validateMaterial")
@AnonymousAccess
public String validateMaterial(String Label2DID, String LoadingMode) {
MicronResult result = apiController.validateMaterial(Label2DID, LoadingMode);
if (ObjectUtil.isEmpty(result)) {
return "";
}
return result.getResponseData();
}
@ApiOperation("API-005 load-report")
@GetMapping("/loadReport")
@AnonymousAccess
public String loadReport(String params ) {
Map<String,Object> paramsMap=JsonUtil.toMap(params);
String JobId = paramsMap.get("JobId").toString();
Object obj=paramsMap.get("Materials");
List<Map<String,String>> arr=(List<Map<String, String>>)obj;
List<MaterialInfo> materialInfos=MaterialInfo.GetObjList(arr);
MicronResult result = apiController.loadReport(JobId, materialInfos);
if (ObjectUtil.isEmpty(result)) {
return "";
}
return result.getResponseData();
}
@ApiOperation("API-007 dispatch-list/{Facility}/{DispatchType}")
@GetMapping("/dispatchList")
@AnonymousAccess
public String dispatchList(String Facility, String DispatchType) {
MicronResult result = apiController.dispatchList(Facility, DispatchType);
if (ObjectUtil.isEmpty(result)) {
return "";
}
return result.getResponseData();
}
@ApiOperation("API-009 dispatch-material/{DispatchType}/{Id}")
@GetMapping("/dispatchMaterial")
@AnonymousAccess
public String dispatchMaterial(String DispatchType, String Id) {
MicronResult result = apiController.dispatchMaterial(DispatchType, Id);
if (ObjectUtil.isEmpty(result)) {
return "";
}
return result.getResponseData();
}
@ApiOperation("API-010 dispatch-report")
@GetMapping("/dispatchReport")
@AnonymousAccess
public String dispatchReport(String params) {
Map<String,Object> paramsMap=JsonUtil.toMap(params);
String JobId = paramsMap.get("JobId").toString();
String dispatchType = paramsMap.get("DispatchType").toString();
Object obj=paramsMap.get("Materials");
List<Map<String,String>> arr=(List<Map<String, String>>)obj;
List<MaterialInfo> materialInfos=MaterialInfo.GetObjList(arr);
MicronResult result = apiController.dispatchReport(JobId, dispatchType, materialInfos);
if (ObjectUtil.isEmpty(result)) {
return "";
}
return result.getResponseData();
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!