From 742a0057180ac656407a08d91fff0d13e03968b2 Mon Sep 17 00:00:00 2001 From: anthonyywj2 <353682448@qq.com> Date: Mon, 4 Jul 2022 14:13:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=B8=8E=E4=B8=8B=E8=BD=BDbug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=8C=E9=A2=86=E7=94=A8=E5=8D=95=E6=8D=AEbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/admin/constant/Constant.java | 1 + .../thrsys/ThrOrderReceiveController.java | 9 +++++-- .../api/admin/res/basic/ErpUnitsResponse.java | 6 +++++ .../com/glxp/api/admin/util/HttpOkClient.java | 24 +++++++++++++++---- .../src/main/resources/logback-spring.xml | 18 +++++++------- 5 files changed, 42 insertions(+), 16 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/api/admin/constant/Constant.java b/api-admin/src/main/java/com/glxp/api/admin/constant/Constant.java index 8ffeedf5..40748e00 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/constant/Constant.java +++ b/api-admin/src/main/java/com/glxp/api/admin/constant/Constant.java @@ -11,6 +11,7 @@ public class Constant { public static final String SCAN_ORDER = "MS"; public static final String BUS_ORDER = "MY"; + public static final String LIN_YONG = "ML"; public static final String dlThrProducts = "THR_DOWNLOAD_PRODUCTS"; public static final String dlThrInvProducts = "THR_DOWNLOAD_INV_PRODUCTS"; diff --git a/api-admin/src/main/java/com/glxp/api/admin/controller/thrsys/ThrOrderReceiveController.java b/api-admin/src/main/java/com/glxp/api/admin/controller/thrsys/ThrOrderReceiveController.java index 000b14e9..92f64236 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/controller/thrsys/ThrOrderReceiveController.java +++ b/api-admin/src/main/java/com/glxp/api/admin/controller/thrsys/ThrOrderReceiveController.java @@ -2,6 +2,7 @@ package com.glxp.api.admin.controller.thrsys; //领用单 import com.glxp.api.admin.annotation.AuthRuleAnnotation; +import com.glxp.api.admin.constant.Constant; import com.glxp.api.admin.entity.business.StockOrderDetailEntity; import com.glxp.api.admin.entity.thrsys.ThrOrderDetailEntity; import com.glxp.api.admin.entity.thrsys.ThrOrderEntity; @@ -10,6 +11,8 @@ import com.glxp.api.admin.service.auth.CustomerService; import com.glxp.api.admin.service.thrsys.ThrOrderDetailService; import com.glxp.api.admin.service.thrsys.ThrOrderService; import com.glxp.api.admin.util.DateUtil; +import com.glxp.api.admin.util.GennerOrderUtils; +import com.glxp.api.admin.util.OrderNoTypeBean; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; @@ -33,6 +36,8 @@ public class ThrOrderReceiveController { private ThrOrderDetailService thrOrderDetailService; @Resource CustomerService customerService; + @Resource + GennerOrderUtils gennerOrderUtils; @AuthRuleAnnotation("") @PostMapping("/udiwms/thrsys/order/insertWeb") @@ -43,17 +48,17 @@ public class ThrOrderReceiveController { } Integer userId = customerService.getUserId(); ThrOrderEntity stockOrderEntity = new ThrOrderEntity(); -// Integer id = Integer.parseInt(CustomUtil.getId()); BeanUtils.copyProperties(stockOrderPostRequest, stockOrderEntity); stockOrderEntity.setCreateUser(userId + ""); stockOrderEntity.setType(1);//领用单据 stockOrderEntity.setUpdateTime(new Date()); stockOrderEntity.setBilldate(DateUtil.formatDate(new Date())); -// stockOrderEntity.setId(id); ThrOrderEntity temp = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk()); if (temp != null) { stockOrderEntity.setId(temp.getId()); } + String orderNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.LIN_YONG, "yyyyMMdd")); + stockOrderEntity.setBillNo(orderNo); thrOrderService.insertThrOrder(stockOrderEntity); stockOrderEntity = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk()); diff --git a/api-admin/src/main/java/com/glxp/api/admin/res/basic/ErpUnitsResponse.java b/api-admin/src/main/java/com/glxp/api/admin/res/basic/ErpUnitsResponse.java index 3ed5869a..866f150e 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/res/basic/ErpUnitsResponse.java +++ b/api-admin/src/main/java/com/glxp/api/admin/res/basic/ErpUnitsResponse.java @@ -14,4 +14,10 @@ public class ErpUnitsResponse { private String mobile; private Boolean checked; private String unitId; //必填 往来单位ID + + + + + + } diff --git a/api-admin/src/main/java/com/glxp/api/admin/util/HttpOkClient.java b/api-admin/src/main/java/com/glxp/api/admin/util/HttpOkClient.java index 5db83538..bf3bc00e 100644 --- a/api-admin/src/main/java/com/glxp/api/admin/util/HttpOkClient.java +++ b/api-admin/src/main/java/com/glxp/api/admin/util/HttpOkClient.java @@ -1,5 +1,6 @@ package com.glxp.api.admin.util; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.glxp.api.admin.entity.basic.BasicThirdSysEntity; import lombok.extern.slf4j.Slf4j; @@ -30,12 +31,25 @@ public class HttpOkClient { header.add("Content-Type"); header.add("application/json"); if (null != basicThirdSysEntity) { - header.add("api_key"); - header.add(basicThirdSysEntity.getApikey()); - header.add("secret_key"); - header.add(basicThirdSysEntity.getSecretkey()); + + if (StrUtil.isNotEmpty(basicThirdSysEntity.getApikey())) { + header.add("api_key"); + header.add(basicThirdSysEntity.getApikey()); + } + + + if (StrUtil.isNotEmpty(basicThirdSysEntity.getSecretkey())) { + header.add("secret_key"); + header.add(basicThirdSysEntity.getSecretkey()); + } + + } - return okHttpCli.doPostJson(url, json, (String[]) header.toArray()); + + String[] strArray = new String[header.size()]; + header.toArray(strArray); + + return okHttpCli.doPostJson(url, json, strArray); } } diff --git a/api-admin/src/main/resources/logback-spring.xml b/api-admin/src/main/resources/logback-spring.xml index 3251a779..c55aa8ae 100644 --- a/api-admin/src/main/resources/logback-spring.xml +++ b/api-admin/src/main/resources/logback-spring.xml @@ -1,9 +1,9 @@ - + logback - + - + @@ -140,7 +140,7 @@ - +