From 6a7e8d322287157c8260dda3c939bbcbf086c904 Mon Sep 17 00:00:00 2001 From: yinq <1345442242@qq.com> Date: Mon, 20 Nov 2023 13:44:15 +0800 Subject: [PATCH] =?UTF-8?q?update=20-=20SAP=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/SAPPortController.java | 3 +- .../aucma/api/domain/dto/SAPBOMPortDto.java | 68 +++++++++++++++++++ .../com/aucma/api/domain/vo/SAPResultVo.java | 9 ++- .../aucma/api/service/ISAPPortService.java | 3 +- .../api/service/impl/SAPPortServiceImpl.java | 33 +++------ .../impl/SAPPutStorageServiceImpl.java | 19 +++++- .../main/java/com/aucma/api/task/SAPTask.java | 7 +- .../java/com/aucma/api/utils/ApiUtils.java | 4 +- .../com/aucma/api/utils/SAPConstants.java | 5 ++ .../framework/config/SecurityConfig.java | 2 +- 10 files changed, 119 insertions(+), 34 deletions(-) create mode 100644 aucma-api/src/main/java/com/aucma/api/domain/dto/SAPBOMPortDto.java diff --git a/aucma-api/src/main/java/com/aucma/api/controller/SAPPortController.java b/aucma-api/src/main/java/com/aucma/api/controller/SAPPortController.java index e9506f2..1cf7dc1 100644 --- a/aucma-api/src/main/java/com/aucma/api/controller/SAPPortController.java +++ b/aucma-api/src/main/java/com/aucma/api/controller/SAPPortController.java @@ -1,5 +1,6 @@ package com.aucma.api.controller; +import com.aucma.api.domain.dto.SAPBOMPortDto; import com.aucma.api.domain.dto.SAPPortDto; import com.aucma.api.domain.dto.WERKSDto; import com.aucma.api.service.ISAPPortService; @@ -92,7 +93,7 @@ public class SAPPortController extends BaseController { */ @PostMapping("/getBaseBomInfo") public AjaxResult getBaseBomInfo(@RequestBody Map paramMap) { - SAPPortDto sapPortDto = new SAPPortDto(); + SAPBOMPortDto sapPortDto = new SAPBOMPortDto(); sapPortDto.setStartDate(String.valueOf(paramMap.get("NDATE"))); sapPortDto.setEndDate(String.valueOf(paramMap.get("EDATE"))); HashMap>> werksMap = (HashMap>>)paramMap.get("WERKS"); diff --git a/aucma-api/src/main/java/com/aucma/api/domain/dto/SAPBOMPortDto.java b/aucma-api/src/main/java/com/aucma/api/domain/dto/SAPBOMPortDto.java new file mode 100644 index 0000000..8781526 --- /dev/null +++ b/aucma-api/src/main/java/com/aucma/api/domain/dto/SAPBOMPortDto.java @@ -0,0 +1,68 @@ +package com.aucma.api.domain.dto; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * @Author YinQ + * @create 2023-09-26 14:46 + */ +public class SAPBOMPortDto { + + private static final long serialVersionUID = 1L; + + /** + * 开始时间 + */ + @JsonProperty(value = "NDATE") + private String startDate; + + /** + * 结束时间 + */ + @JsonProperty(value = "EDATE") + private String endDate; + + /** + * 类型 + */ + @JsonProperty(value = "XTYPE") + private String type; + + /** + * 工厂编号 + */ + @JsonProperty(value = "WERKS") + private WERKSDto factoryCodes; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public WERKSDto getFactoryCodes() { + return factoryCodes; + } + + public void setFactoryCodes(WERKSDto factoryCodes) { + this.factoryCodes = factoryCodes; + } +} diff --git a/aucma-api/src/main/java/com/aucma/api/domain/vo/SAPResultVo.java b/aucma-api/src/main/java/com/aucma/api/domain/vo/SAPResultVo.java index 671bdb7..95b8605 100644 --- a/aucma-api/src/main/java/com/aucma/api/domain/vo/SAPResultVo.java +++ b/aucma-api/src/main/java/com/aucma/api/domain/vo/SAPResultVo.java @@ -18,7 +18,7 @@ public class SAPResultVo { private HashMap>> O_TAB; @JsonProperty(value = "WERKS") - private String WERKS; + private WERKSDto WERKS; @JsonProperty(value = "O_RETURN") private WERKSDto O_RETURN; @@ -31,11 +31,11 @@ public class SAPResultVo { O_TAB = o_TAB; } - public String getWERKS() { + public WERKSDto getWERKS() { return WERKS; } - public void setWERKS(String WERKS) { + public void setWERKS(WERKSDto WERKS) { this.WERKS = WERKS; } @@ -47,6 +47,9 @@ public class SAPResultVo { O_RETURN = o_RETURN; } + public SAPResultVo() { + } + @Override public String toString() { return "SAPResultVo{" + diff --git a/aucma-api/src/main/java/com/aucma/api/service/ISAPPortService.java b/aucma-api/src/main/java/com/aucma/api/service/ISAPPortService.java index 7f14607..f957143 100644 --- a/aucma-api/src/main/java/com/aucma/api/service/ISAPPortService.java +++ b/aucma-api/src/main/java/com/aucma/api/service/ISAPPortService.java @@ -1,5 +1,6 @@ package com.aucma.api.service; +import com.aucma.api.domain.dto.SAPBOMPortDto; import com.aucma.api.domain.dto.SAPPortDto; import com.aucma.base.domain.BaseDeviceLedger; import com.aucma.base.domain.BaseMaterialInfo; @@ -44,6 +45,6 @@ public interface ISAPPortService { * @param sapPortDto * @return */ - List getSapOrderBomInfo(SAPPortDto sapPortDto); + List getSapOrderBomInfo(SAPBOMPortDto sapPortDto); } diff --git a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPortServiceImpl.java b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPortServiceImpl.java index f1e7c17..8f174f8 100644 --- a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPortServiceImpl.java +++ b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPortServiceImpl.java @@ -1,9 +1,9 @@ package com.aucma.api.service.impl; +import com.aucma.api.domain.dto.SAPBOMPortDto; import com.aucma.api.domain.dto.SAPPortDto; import com.aucma.api.domain.dto.WERKSDto; -import com.aucma.api.domain.vo.SAPResultBomVo; import com.aucma.api.domain.vo.SAPResultOrderInfoVo; import com.aucma.api.domain.vo.SAPResultVo; import com.aucma.api.service.ISAPPortService; @@ -16,7 +16,6 @@ import com.aucma.base.domain.BaseOrderInfo; import com.aucma.base.domain.OrderBomInfo; import com.aucma.common.exception.base.BaseException; import com.aucma.common.utils.StringUtils; -import com.aucma.common.utils.http.HttpUtils; import com.aucma.system.utils.PortLogUtils; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.beans.factory.annotation.Autowired; @@ -62,16 +61,12 @@ public class SAPPortServiceImpl implements ISAPPortService { requestParam = objectMapper.writeValueAsString(sapPortDto); result = ApiUtils.sendSAPHttpPost(SAPConstants.SAP_PREFIX_URL + SAPConstants.MATERIAL_URL, requestParam); // 处理接口返回消息 - // result = "{\"O_TAB\":{\"item\":[{\"MAKTX\":\"压缩机,GP14TG,R134a,ACC\",\"WERKS\":\"2004\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000125\"},{\"MAKTX\":\"压缩机,GP14TG,R134a,ACC\",\"WERKS\":\"2006\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000125\"},{\"MAKTX\":\"压缩机,NL7CLX,R404a,丹佛斯\",\"WERKS\":\"2004\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000126\"},{\"MAKTX\":\"压缩机,NL7CLX,R404a,丹佛斯\",\"WERKS\":\"2006\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000126\"},{\"MAKTX\":\"压缩机,HVY57AA,R600a,奥地利ACC\",\"WERKS\":\"2004\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000127\"},{\"MAKTX\":\"压缩机,HVY57AA,R600a,奥地利ACC\",\"WERKS\":\"2006\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000127\"},{\"MAKTX\":\"压缩机,HVY67AA,R600a,奥地利ACC\",\"WERKS\":\"2004\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000128\"},{\"MAKTX\":\"压缩机,HVY67AA,R600a,奥地利ACC\",\"WERKS\":\"2006\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000128\"},{\"MAKTX\":\"压缩机,MR22FB,R404a,ACC\",\"WERKS\":\"2004\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000129\"},{\"MAKTX\":\"压缩机,MR22FB,R404a,ACC\",\"WERKS\":\"2006\",\"MTART\":\"ROH\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-21\",\"MATNR\":\"000000003000000129\"},{\"MAKTX\":\"盖后加固体,BC/BD-127FA\",\"WERKS\":\"2004\",\"MTART\":\"HALB\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-06\",\"MATNR\":\"000000008106000102\"},{\"MAKTX\":\"SC-246,YZXGWB乳品\",\"WERKS\":\"2006\",\"MTART\":\"FERT\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-22\",\"MATNR\":\"000000009002003478\"},{\"MAKTX\":\"SD-460,YZXGW蒙牛冰品\",\"WERKS\":\"2004\",\"MTART\":\"FERT\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-22\",\"MATNR\":\"000000009000004735\"},{\"MAKTX\":\"BC-100E,特需\",\"WERKS\":\"2006\",\"MTART\":\"FERT\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-02\",\"MATNR\":\"000000009001002406\"},{\"MAKTX\":\"BD(C)-310T,特需\",\"WERKS\":\"2004\",\"MTART\":\"FERT\",\"MEINS\":\"EA\",\"UDATE\":\"2019-08-20\",\"MATNR\":\"000000009000000225\"}]},\"WERKS\":null,\"O_RETURN\":{\"item\":[{\"MESSAGE\":\"查询成功1!\",\"ID\":\" 0\",\"TYPE\":\"S\"}]}}"; ObjectMapper resultMapper = new ObjectMapper(); // 将 JSON 字符串 转换为 Java 对象 SAPResultVo resultVo = resultMapper.readValue(result, SAPResultVo.class); //判断返回数据是否正确 - if (StringUtils.isNull(resultVo.getO_RETURN()) || !" 0".equals(resultVo.getO_RETURN().getItem().get(0).get("ID"))){ - Integer integer = Integer.valueOf(resultVo.getO_RETURN().getItem().get(0).get("ID")); - if (integer!=0){ - throw new BaseException("处理接口返回消息错误!(ID不为0或O_RETURN为空)"); - } + if (StringUtils.isNull(resultVo.getO_RETURN()) || !resultVo.getO_RETURN().getItem().get(0).get("ID").contains("0")){ + throw new BaseException("处理接口返回消息错误!(ID不为0或O_RETURN为空)"); } //转物料实体类 保存数据 materialVos = storageService.insertSAPMaterialInfo(resultVo); @@ -79,7 +74,6 @@ public class SAPPortServiceImpl implements ISAPPortService { PortLogUtils.savePortLog(werks.getItem().get(0).get("WERKS"), "获取SAP物料主数据" + intervalDate, "getSAPMaterialData", requestParam, result, null); } catch (Exception e) { //保存接口日志 - System.out.println(e.getMessage()); PortLogUtils.savePortLog(werks.getItem().get(0).get("WERKS"), "获取SAP物料主数据" + intervalDate, "getSAPMaterialData", requestParam, result, e.toString()); } return materialVos; @@ -114,13 +108,9 @@ public class SAPPortServiceImpl implements ISAPPortService { SAPResultOrderInfoVo resultVo = resultMapper.readValue(result, SAPResultOrderInfoVo.class); //判断返回数据是否正确 - if (StringUtils.isNull(resultVo.getO_RETURN()) || !" 0".equals(resultVo.getO_RETURN().getItem().get(0).get("ID"))){ - String id = resultVo.getO_RETURN().getItem().get(0).get("ID"); - Integer integer = Integer.valueOf(id); - if (integer!=0&&integer!=null){ + if (StringUtils.isNull(resultVo.getO_RETURN()) || !resultVo.getO_RETURN().getItem().get(0).get("ID").contains("0")){ throw new BaseException("处理接口返回消息错误!(ID不为0或O_RETURN为空)"); } - } //转物料实体类 保存数据 baseOrderInfoVos = storageService.insertSAPBaseOrderInfo(resultVo); //保存接口日志 @@ -161,7 +151,7 @@ public class SAPPortServiceImpl implements ISAPPortService { // 将 JSON 字符串转换为 Java 对象 SAPResultOrderInfoVo resultVo = resultMapper.readValue(result, SAPResultOrderInfoVo.class); //判断返回数据是否正确 - if (StringUtils.isNull(resultVo.getO_RETURN()) || !" 0".equals(resultVo.getO_RETURN().getItem().get(0).get("ID"))){ + if (StringUtils.isNull(resultVo.getO_RETURN()) || !resultVo.getO_RETURN().getItem().get(0).get("ID").contains("0")){ throw new BaseException("处理接口返回消息错误!(ID不为0或O_RETURN为空)"); } //转物料实体类 保存数据 @@ -182,10 +172,11 @@ public class SAPPortServiceImpl implements ISAPPortService { * @return */ @Override - public List getSapOrderBomInfo(SAPPortDto sapPortDto) { + public List getSapOrderBomInfo(SAPBOMPortDto sapPortDto) { String startDate = sapPortDto.getStartDate(); String endDate = sapPortDto.getEndDate(); WERKSDto werks = sapPortDto.getFactoryCodes(); + sapPortDto.setType("S"); String intervalDate = "(" + startDate + "——" + endDate + ")"; if (StringUtils.isEmpty(startDate) || StringUtils.isEmpty(endDate) || StringUtils.isNull(werks)) { return null; @@ -205,13 +196,8 @@ public class SAPPortServiceImpl implements ISAPPortService { // 将 JSON 字符串转换为 Java 对象 SAPResultOrderInfoVo resultVo = resultMapper.readValue(result, SAPResultOrderInfoVo.class); //判断返回数据是否正确 - if (StringUtils.isNull(resultVo.getO_RETURN()) || !" 0".equals(resultVo.getO_RETURN().getItem().get(0).get("ID"))){ - String id = resultVo.getO_RETURN().getItem().get(0).get("ID"); - String s = id.replaceAll(" ", ""); - if (0!=Long.valueOf(s)){ - throw new BaseException("处理接口返回消息错误!(ID不为0或O_RETURN为空)"); - } - + if (StringUtils.isNull(resultVo.getO_RETURN()) || !resultVo.getO_RETURN().getItem().get(0).get("ID").contains("0")){ + throw new BaseException("处理接口返回消息错误!(ID不为0或O_RETURN为空)"); } //转物料实体类 保存数据 orderBomInfosVos = storageService.insertSAPOrderBomInfo(resultVo); @@ -219,7 +205,6 @@ public class SAPPortServiceImpl implements ISAPPortService { PortLogUtils.savePortLog(werks.getItem().get(0).get("WERKS"), "获取产品bom数据" + intervalDate, "getSapBaseBomInfo", requestParam, result, null); } catch (Exception e) { //保存接口日志 - System.out.println(e.getMessage()); PortLogUtils.savePortLog(werks.getItem().get(0).get("WERKS"), "获取产品bom数据" + intervalDate, "getSapBaseBomInfo", requestParam, result, e.toString()); } return orderBomInfosVos; diff --git a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java index 242a622..9c1c245 100644 --- a/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java +++ b/aucma-api/src/main/java/com/aucma/api/service/impl/SAPPutStorageServiceImpl.java @@ -3,6 +3,7 @@ package com.aucma.api.service.impl; import com.aucma.api.domain.vo.SAPResultOrderInfoVo; import com.aucma.api.domain.vo.SAPResultVo; import com.aucma.api.service.ISAPPutStorageService; +import com.aucma.api.utils.SAPConstants; import com.aucma.base.domain.BaseDeviceLedger; import com.aucma.base.domain.BaseMaterialInfo; import com.aucma.base.domain.BaseOrderInfo; @@ -12,6 +13,7 @@ import com.aucma.base.service.IBaseMaterialInfoService; import com.aucma.base.service.IBaseOrderInfoService; import com.aucma.base.service.IOrderBomInfoService; import com.aucma.common.utils.DateUtils; +import com.aucma.common.utils.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -53,6 +55,9 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { ArrayList baseMaterialInfoArrayList = new ArrayList<>(); List> itemList = resultVo.getO_TAB().get("item"); for (HashMap map : itemList) { + if (StringUtils.isEmpty(map.get("WERKS")) || !map.get("WERKS").equals(SAPConstants.FACTORY_CODE)){ + continue; + } BaseMaterialInfo baseMaterialInfo = new BaseMaterialInfo(); baseMaterialInfo.setPlantCode(map.get("WERKS")); baseMaterialInfo.setMaterialCode(map.get("MATNR")); @@ -64,6 +69,8 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { materialInfo.setMaterialType(map.get("MTART")); materialInfo.setPlantCode(map.get("WERKS")); materialInfo.setMaterialUnit(map.get("MEINS")); + materialInfo.setMaterialMatkl(map.get("MATKL")); + materialInfo.setIncrementDate(DateUtils.dateTime(DateUtils.YYYY_MM_DD,map.get("UDATE"))); baseMaterialInfoService.insertBaseMaterialInfo(materialInfo); baseMaterialInfoArrayList.add(materialInfo); } @@ -79,6 +86,9 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { ArrayList baseOrderInfoList = new ArrayList<>(); List> itemList = resultVo.getO_TAB().get("item"); for (HashMap map : itemList) { + if (StringUtils.isEmpty(map.get("WERKS")) || !map.get("WERKS").equals(SAPConstants.FACTORY_CODE)){ + continue; + } BaseOrderInfo boInfo = new BaseOrderInfo(); boInfo.setOrderCode(map.get("AUFNR")); boInfo.setMaterialCode(map.get("MATNR")); @@ -98,7 +108,7 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { baseOrderInfo.setOrderType(map.get("AUART")); baseOrderInfo.setBeginDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("GLTRP"))); baseOrderInfo.setEndDate(new SimpleDateFormat("yyyy-MM-dd").parse(map.get("GSTRP"))); - baseOrderInfo.setCreatedTime(DateUtils.getNowDate()); + baseOrderInfoService.insertBaseOrderInfo(baseOrderInfo); baseOrderInfoList.add(baseOrderInfo); } @@ -120,6 +130,9 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { ArrayList baseDeviceLedgerArrayList = new ArrayList<>(); List> itemList = resultVo.getO_TAB().get("item"); for (HashMap map : itemList) { + if (StringUtils.isEmpty(map.get("WERKS")) || !map.get("WERKS").equals(SAPConstants.FACTORY_CODE)){ + continue; + } BaseDeviceLedger device = new BaseDeviceLedger(); device.setCostCenter(map.get("KOSTL"));; device.setDeviceCode(map.get("EQUNR")); @@ -151,8 +164,10 @@ public class SAPPutStorageServiceImpl implements ISAPPutStorageService { public ArrayList insertSAPOrderBomInfo(SAPResultOrderInfoVo resultVo) throws ParseException { ArrayList orderBomInfoList = new ArrayList<>(); List> itemList = resultVo.getO_TAB().get("item"); - for (HashMap map : itemList) { + if (StringUtils.isEmpty(map.get("WERKS")) || !map.get("WERKS").equals(SAPConstants.FACTORY_CODE)){ + continue; + } OrderBomInfo bomInfo = new OrderBomInfo(); bomInfo.setMaterialCode(map.get("IDNRK")); bomInfo.setParentId(map.get("MATNR")); diff --git a/aucma-api/src/main/java/com/aucma/api/task/SAPTask.java b/aucma-api/src/main/java/com/aucma/api/task/SAPTask.java index 03ad637..c02741e 100644 --- a/aucma-api/src/main/java/com/aucma/api/task/SAPTask.java +++ b/aucma-api/src/main/java/com/aucma/api/task/SAPTask.java @@ -1,5 +1,6 @@ package com.aucma.api.task; +import com.aucma.api.domain.dto.SAPBOMPortDto; import com.aucma.api.domain.dto.SAPPortDto; import com.aucma.api.domain.dto.WERKSDto; import com.aucma.api.service.ISAPPortService; @@ -57,7 +58,11 @@ public class SAPTask { */ public void SAPBaseBomInfoDataTask(String factoryCode, Long days) { SAPPortDto sapPortDto = this.SAPRequestDataAssembly(factoryCode, days); - portService.getSapOrderBomInfo(sapPortDto); + SAPBOMPortDto sapbomPortDto = new SAPBOMPortDto(); + sapbomPortDto.setStartDate(sapPortDto.getStartDate()); + sapbomPortDto.setEndDate(sapPortDto.getEndDate()); + sapbomPortDto.setFactoryCodes(sapPortDto.getFactoryCodes()); + portService.getSapOrderBomInfo(sapbomPortDto); } diff --git a/aucma-api/src/main/java/com/aucma/api/utils/ApiUtils.java b/aucma-api/src/main/java/com/aucma/api/utils/ApiUtils.java index a5ae529..8b0f173 100644 --- a/aucma-api/src/main/java/com/aucma/api/utils/ApiUtils.java +++ b/aucma-api/src/main/java/com/aucma/api/utils/ApiUtils.java @@ -25,7 +25,9 @@ public class ApiUtils { .header("Authorization", "Basic " + Base64.getUrlEncoder(). encodeToString((SAPConstants.USER_NAME + ":" + SAPConstants.PASS_WORD).getBytes())) .body(jsonData) // 设置JSON格式的请求体 - .contentType("application/json"); // 设置Content-Type为application/json + .contentType("application/json") // 设置Content-Type为application/json + .setConnectionTimeout(1000 * 10) // 设置请求连接超时时间 + ; // 发送POST请求 HttpResponse httpResponse = request.execute(); diff --git a/aucma-api/src/main/java/com/aucma/api/utils/SAPConstants.java b/aucma-api/src/main/java/com/aucma/api/utils/SAPConstants.java index c800597..306bf0f 100644 --- a/aucma-api/src/main/java/com/aucma/api/utils/SAPConstants.java +++ b/aucma-api/src/main/java/com/aucma/api/utils/SAPConstants.java @@ -46,6 +46,11 @@ public class SAPConstants { */ public static final String PRODUCTS_BOM_URL = "/SdGetSB/SdSapGetBomToMesSvcRSProxy/merge"; + /** + * 河南工厂编号 + */ + public static final String FACTORY_CODE = "1301"; + @Value("${sap.prefix}") public void setPrefix(String value) { diff --git a/aucma-framework/src/main/java/com/aucma/framework/config/SecurityConfig.java b/aucma-framework/src/main/java/com/aucma/framework/config/SecurityConfig.java index 12a4c69..56169b4 100644 --- a/aucma-framework/src/main/java/com/aucma/framework/config/SecurityConfig.java +++ b/aucma-framework/src/main/java/com/aucma/framework/config/SecurityConfig.java @@ -116,7 +116,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() // 开放SAP接口调试 -// .antMatchers(HttpMethod.POST, "/sap/port/**").permitAll() + .antMatchers(HttpMethod.POST, "/sap/port/**").permitAll() // 开放看板接口 .antMatchers(HttpMethod.POST, "/boardReport/**").permitAll() // 除上面外的所有请求全部需要鉴权认证