Commit fc8e567d LN

用户默认语言改成英文

1 个父辈 545ddb9e
......@@ -393,6 +393,13 @@ public class Micron20031Api {
* //Output: Micron Part Numbers, Quantity, UnitOfMeasures, MatReqNo, MaterialType, Message, Status
*/
public static MatOrderBean triggerMatReqOrder(MatOrderBean orderBean) throws ApiException {
if(Debug){
log.info("调用MES接口 triggerMatReqOrder,Debug Mode ,reutrn ");
MatOrderBean bean=new MatOrderBean();
Random random=new Random();
bean.setMatReqNo("ReqNo"+random.nextInt(100));
return bean;
}
//pnMap的key为pn, value为库存数量
String checkStockAvailableUrl = getUrl(api_TriggerMatReqOrder);
if (StringUtils.isBlank(checkStockAvailableUrl)){
......@@ -494,7 +501,7 @@ public class Micron20031Api {
}
dataMap.put("ExpiredDate", dateStr);
// dataMap.put("SystemID", "SPMMS");
dataMap.put("SystemID", dataCache.getConfigCache(Constants.CACHE_APIPARAM_SystemID,param_SystemID));
dataMap.put("SystemID", dataCache.getCache(Constants.CACHE_APIPARAM_SystemID,param_SystemID));
dataMap.put("MaterialType", MATERIAL_TYPE);
dataMap.put("Username", username);
dataMap.put("supplier", barcode.getProvider());
......@@ -668,6 +675,14 @@ public class Micron20031Api {
* @return
*/
public static List<String> getEquipIDList() throws ApiException {
if(Debug){
List<String> res=new ArrayList<>();
res.add("Test1");
res.add("Test2");
res.add("Test3");
return res;
}
List<String> equipIdList = new ArrayList<>();
String checkStockAvailableUrl = getUrl(api_GetEquipIDList);
if(ObjectUtil.isEmpty(checkStockAvailableUrl)) {
......@@ -683,10 +698,10 @@ public class Micron20031Api {
// dataMap.put("Area","MSA MODSSD-ASSEMBLY");
// dataMap.put("EquipmentGroup","SMT AUTO ETA");
dataMap.put("Facility",dataCache.getConfigCache(Constants.CACHE_APIPARAM_Facility,param_Facility));
dataMap.put("Area",dataCache.getConfigCache(Constants.CACHE_APIPARAM_Area,param_Area));
dataMap.put("EquipmentGroup",dataCache.getConfigCache(Constants.CACHE_APIPARAM_EquipmentGroup,param_EquipmentGroup));
dataMap.put("Type",dataCache.getConfigCache(Constants.CACHE_APIPARAM_Type,param_Type));
dataMap.put("Facility",dataCache.getCache(Constants.CACHE_APIPARAM_Facility,param_Facility));
dataMap.put("Area",dataCache.getCache(Constants.CACHE_APIPARAM_Area,param_Area));
dataMap.put("EquipmentGroup",dataCache.getCache(Constants.CACHE_APIPARAM_EquipmentGroup,param_EquipmentGroup));
dataMap.put("Type",dataCache.getCache(Constants.CACHE_APIPARAM_Type,param_Type));
log.info("调用MES接口 GetEquipIDList,参数:"+JsonUtil.toJsonStr(dataMap));
String resultStr = HttpHelper.postJsonWithAuth(checkStockAvailableUrl, dataMap, auth);
......@@ -739,7 +754,7 @@ public class Micron20031Api {
* {
* "MicronPN": "501-10187",
* "LotNo": "10819093SP-0148",
* "BatchNo": "10819093SP",
* "BatchNo": "10819093SP",MATRACKOUT
* "SpoolStatus": "NEW", //Indicate new material
* "Quantity": 1,
* "Mode": "ENABLE_MAM_SAP",
......@@ -841,6 +856,11 @@ public class Micron20031Api {
// "equipId":"",
// "message":"SAP ERROR: <item><TYPE>E</TYPE><ID>KI</ID><NUMBER>235</NUMBER><MESSAGE>Account 536111 requires an assignment to a CO object</MESSAGE><LOG_NO /><LOG_MSG_NO>000000</LOG_MSG_NO><MESSAGE_V1>536111</MESSAGE_V1><MESSAGE_V2>000</MESSAGE_V2><MESSAGE_V3 /><MESSAGE_V4 /><PARAMETER>GOODSMVT_ITEM</PARAMETER><ROW>1</ROW><FIELD /><SYSTEM>QE1100</SYSTEM></item>","status":"FAIL","spoolStatus":"","expiredDate":"07-26-2024 11:56:00","stepId":"","materialDocumentNo":"","username":"leandraang","mode":"ENABLE_MAM_SAP","quantity":0,"remainingQuantity":1,"expiredDate2":"","stabilizationEndDate":"","isQualLot":"","exposureStartDateTime":"","lotNo2":"","targetSystemId":"","transferMode":"","adjustedQuantity":0,"manufacturerLotNo":"","lotList":{"lots":null},"newMergeLotId":"","inHouseMark":"","leadFrameCount":0,"modSolderPaste":"","supplier":"","supplierPN":"","printerName":"","lineId":"","comments":"test","maxQuantity":0}]
public static Barcode returnMaterial(Barcode barcode, String typeOfReturn, String username,String comments) throws ApiException {
if(Debug){
log.info("调用MES接口 ReturnMaterial type="+typeOfReturn+",Debug mode ,return");
return barcode;
}
String checkStockAvailableUrl = getUrl(api_ReturnMaterial);
if(ObjectUtil.isEmpty(checkStockAvailableUrl)){
return barcode;
......
......@@ -63,6 +63,12 @@ public class MicronSpController {
Integer num = Convert.toInt(posName.substring(2, posName.length()));
//0=灰色未使用,1=使用中,2=AuthoriseNg,3=已过期,4=解冻中
//0=灰色,1=绿色,2=黄色,3=红色,4=橙色,
//1:绿色 2:黄色 3和-1:红 4:橙色
// 空库位=灰色,有锡膏位置=绿色,AuthoriseNg=黄色,已过期或报警=红色,解冻中=橙色
//outArea和inArea:1:绿 2和-1:红 4:橙色 默认:灰色
Integer used = 0;
Barcode barcode = pos.getBarcode();
if (pos.isUsed()&&barcode!=null) {
......
package com.neotel.smfcore.custom.micron20031.login.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.*;
......@@ -129,6 +130,11 @@ public class MicronLoginController {
user = new User(userInfo.getWinaccountname(), userInfo.getEmail(), "zh-CN", role.getId(), pwd, true, true, new Date(), new HashSet<>(), "",new ArrayList<>(),new ArrayList<>());
}
if(ObjectUtil.isEmpty(user.getLanguage())||(!user.getLanguage().equals("en-US"))){
user.setLanguage("en-US");
log.info("设置用户"+user.getUsername()+"的默认语言为=en-US");
}
//重新设置用户展示菜单,替换掉上一次
user.setShowButtonList(new ArrayList<>());
user.setShowList(new ArrayList<>());
......
......@@ -15,6 +15,7 @@
*/
package com.neotel.smfcore.security.service;
import cn.hutool.core.util.ObjectUtil;
import com.neotel.smfcore.common.exception.EntityNotFoundException;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.StringUtils;
......@@ -52,6 +53,11 @@ public class UserDetailsServiceImpl implements UserDetailsService {
User user;
try {
user = userManager.findByUserName(username);
if(ObjectUtil.isEmpty(user.getLanguage())||(!user.getLanguage().equals("en-US"))){
user.setLanguage("en-US");
}
} catch (EntityNotFoundException e) {
// SpringSecurity会自动转换UsernameNotFoundException为BadCredentialsException
throw new ValidateException("smfcore.valueNotExist", "{0}[{1}]不存在", new String[]{"username", username});
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!