From e272a1f29526bb24befdeeae1214952a2954b672 Mon Sep 17 00:00:00 2001
From: wangxuanran <3055088966@qq.com>
Date: Mon, 17 Jul 2023 16:46:15 +0800
Subject: [PATCH] =?UTF-8?q?util=E5=8A=A0=E8=BE=93=E5=87=BA=E5=BC=82?=
=?UTF-8?q?=E5=B8=B8=E4=BF=A1=E6=81=AF=E6=96=B9=E6=B3=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/main/java/aiyh/utils/Util.java | 25 +
.../workflow/controller/GetExchangeRate.java | 66 +-
.../workflow/mapper/ExchangeRateMapper.java | 4 +-
.../controller/CommonDataAsyncController.java | 42 +
.../ey/jiahx/UpdateStatusAchargeTwo.java | 212 +++++
.../ey/zhang/ImportExtValidateTemplate.java | 342 --------
.../ey/zhang/ImportNtoOValidateTemplate.java | 307 -------
.../ey/zhangm/didi/util/EYSeconddevUtil.java | 773 ++++++++++++++++++
.../ey/zhangm/util/EYSeconddevUtil.java | 17 +
.../xuanran/wang/eny/ModelFieldAsyncTest.java | 17 +
10 files changed, 1145 insertions(+), 660 deletions(-)
create mode 100644 src/main/java/com/api/xuanran/wang/xk_hospital/data_async/controller/CommonDataAsyncController.java
create mode 100644 src/main/java/weaver/formmode/customjavacode/modeexpand/ey/jiahx/UpdateStatusAchargeTwo.java
delete mode 100644 src/main/java/weaver/formmode/interfaces/impl/ey/zhang/ImportExtValidateTemplate.java
delete mode 100644 src/main/java/weaver/formmode/interfaces/impl/ey/zhang/ImportNtoOValidateTemplate.java
create mode 100644 src/main/java/weaver/seconddev/ey/zhangm/didi/util/EYSeconddevUtil.java
diff --git a/src/main/java/aiyh/utils/Util.java b/src/main/java/aiyh/utils/Util.java
index b1ff738..16c18ea 100644
--- a/src/main/java/aiyh/utils/Util.java
+++ b/src/main/java/aiyh/utils/Util.java
@@ -4067,6 +4067,31 @@ public class Util extends weaver.general.Util {
}
}
}
+
+ /**
+ *
将线程错误信息输出
+ * @author xuanran.wang
+ * @dateTime 2023/7/17 16:43
+ * @param e 线程异常对象
+ **/
+ public static void logErrorStr(Throwable e){
+ logErrorStr(e, null);
+ }
+
+ /**
+ * 将线程错误信息输出
+ * @author xuanran.wang
+ * @dateTime 2023/7/17 16:43
+ * @param e 线程异常对象
+ * @param logger 日志对象
+ **/
+ public static void logErrorStr(Throwable e, Logger logger){
+ if(null != logger){
+ logger.error(getErrString(e));
+ }else {
+ Util.getLogger().error(getErrString(e));
+ }
+ }
}
diff --git a/src/main/java/com/api/xuanran/wang/eny/workflow/controller/GetExchangeRate.java b/src/main/java/com/api/xuanran/wang/eny/workflow/controller/GetExchangeRate.java
index 2bac670..6a7f2c3 100644
--- a/src/main/java/com/api/xuanran/wang/eny/workflow/controller/GetExchangeRate.java
+++ b/src/main/java/com/api/xuanran/wang/eny/workflow/controller/GetExchangeRate.java
@@ -6,50 +6,98 @@ import aiyh.utils.excention.CustomerException;
import com.alibaba.fastjson.JSONObject;
import com.api.xuanran.wang.eny.workflow.mapper.ExchangeRateMapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
+import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
+import weaver.seconddev.ey.zhangm.util.EYSeconddevUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
import java.util.Map;
/**
- *
+ * 根据接口币种数据以及流程币种转成对应的汇率
*
* @author xuanran.wang
* @date 2023/7/14 15:02
*/
-@Path("/wxr/eny/workflow/rate")
+@Path("/wxr/ey/workflow/rate")
public class GetExchangeRate {
private final Logger log = Util.getLogger();
private final ExchangeRateMapper mapper = Util.getMapper(ExchangeRateMapper.class);
+ private EYSeconddevUtil eySeconddevUtil = null;
@POST
@Path("/exchange")
- @Produces(MediaType.APPLICATION_OCTET_STREAM)
+ @Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public String exchangeRate(@Context HttpServletRequest request,
@Context HttpServletResponse response,
- @RequestBody Map params){
+ @RequestBody Map params){
try {
+ if(eySeconddevUtil == null){
+ eySeconddevUtil = new EYSeconddevUtil();
+ }
// 地区
- String area = Util.null2DefaultStr(params.get("area"),"");
+ String date = Util.null2DefaultStr(params.get("date"),"");
// 本位币
String baseCurrency = Util.null2DefaultStr(params.get("baseCurrency"),"");
// 接口币种
String interfaceCurrency = Util.null2DefaultStr(params.get("interfaceCurrency"),"");
- if(StringUtils.isBlank(area) || StringUtils.isBlank(baseCurrency) || StringUtils.isBlank(interfaceCurrency)){
+ // 是否打印参数
+ String printParams = Util.null2DefaultStr(params.get("printParams"),"");
+ // rateType
+ String rateType = Util.null2DefaultStr(params.get("rateType"),"5");
+ // 字段名
+ List