Commit 4a4fb0d7 zshaohui

1.mATrackOut 用户名修改

1 个父辈 7c1555a6
......@@ -4,10 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.neotel.smfcore.common.exception.ApiException;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.DateUtil;
import com.neotel.smfcore.common.utils.HttpHelper;
import com.neotel.smfcore.common.utils.JsonUtil;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.common.utils.*;
import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.custom.micron20031.bean.DepositMatReqBean;
import com.neotel.smfcore.custom.micron20031.bean.MatOrderBean;
......@@ -490,9 +487,13 @@ public class Micron20031Api {
barcode.updateAppendData("stabilizationEndDate",stabilizationEndDate);
barcode.updateAppendData("opUsername",username);
barcode.updateAppendData("maTrackOut",false);
Object exposureStartDateObj = resultMap.get("exposureStartDate");
Date exposureStartDate = DateUtil.toDate(exposureStartDateObj.toString(),"MM-dd-yyyy");
barcode.setOpenTime(exposureStartDate);
try {
Object exposureStartDateObj = resultMap.get("exposureStartDate");
Date exposureStartDate = DateUtil.toDate(exposureStartDateObj.toString(),"MM-dd-yyyy");
barcode.setOpenTime(exposureStartDate);
} catch (Exception e) {
e.printStackTrace();
}
return barcode;
}
......@@ -556,7 +557,12 @@ public class Micron20031Api {
dataMap.put("LotNo",barcode.getBarcode());
dataMap.put("SystemID","SPMMS");
dataMap.put("MaterialType",MATERIAL_TYPE);
dataMap.put("Username","KHIENYONGCHE");
String defaultUserName = loginCache.getDefaultUserName();
if (StringUtils.isBlank(defaultUserName)){
defaultUserName = SecurityUtils.getLoginUsername();
}
dataMap.put("Username", defaultUserName);
log.info("调用MES接口 mATrackOut,参数:"+JsonUtil.toJsonStr(dataMap));
String resultStr = HttpHelper.postJsonWithAuth(url, dataMap, auth);
......
......@@ -2,6 +2,7 @@ package com.neotel.smfcore.custom.micron20031.cache;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
......@@ -18,4 +19,17 @@ public class LoginCache {
return loginMap.get(cid);
}
public String getDefaultUserName() {
try {
if (loginMap != null && !loginMap.isEmpty()) {
Collection<String> collection = loginMap.values();
for (String userName : collection) {
return userName;
}
}
} catch (Exception e) {
e.printStackTrace();
}
return "";
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!