diff --git a/pom.xml b/pom.xml
index 8509d5e..583e774 100644
--- a/pom.xml
+++ b/pom.xml
@@ -130,7 +130,13 @@
easypoi-annotation
4.0.0
-
+
+
+ javax.servlet
+ javax.servlet-api
+ 3.1.0
+
+
diff --git a/src/main/java/aiyh/utils/httpUtil/cushttpclasses/CusHttpServletRequest.java b/src/main/java/aiyh/utils/httpUtil/cushttpclasses/CusHttpServletRequest.java
index 231944e..5dfc3ec 100644
--- a/src/main/java/aiyh/utils/httpUtil/cushttpclasses/CusHttpServletRequest.java
+++ b/src/main/java/aiyh/utils/httpUtil/cushttpclasses/CusHttpServletRequest.java
@@ -1,14 +1,12 @@
package aiyh.utils.httpUtil.cushttpclasses;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletInputStream;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
+import javax.servlet.*;
+import javax.servlet.http.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
@@ -95,6 +93,11 @@ public class CusHttpServletRequest implements HttpServletRequest {
return null;
}
+ @Override
+ public String changeSessionId() {
+ return null;
+ }
+
@Override
public String getRequestedSessionId() {
return null;
@@ -143,6 +146,36 @@ public class CusHttpServletRequest implements HttpServletRequest {
return false;
}
+ @Override
+ public boolean authenticate(HttpServletResponse httpServletResponse) throws IOException, ServletException {
+ return false;
+ }
+
+ @Override
+ public void login(String s, String s1) throws ServletException {
+
+ }
+
+ @Override
+ public void logout() throws ServletException {
+
+ }
+
+ @Override
+ public Collection getParts() throws IOException, ServletException {
+ return null;
+ }
+
+ @Override
+ public Part getPart(String s) throws IOException, ServletException {
+ return null;
+ }
+
+ @Override
+ public T upgrade(Class aClass) throws IOException, ServletException {
+ return null;
+ }
+
@Override
public String getProtocol() {
return null;
@@ -218,6 +251,11 @@ public class CusHttpServletRequest implements HttpServletRequest {
return 0;
}
+ @Override
+ public long getContentLengthLong() {
+ return 0;
+ }
+
@Override
public String getContentType() {
return null;
@@ -271,4 +309,59 @@ public class CusHttpServletRequest implements HttpServletRequest {
public String getRealPath(String s) {
return null;
}
+
+ @Override
+ public int getRemotePort() {
+ return 0;
+ }
+
+ @Override
+ public String getLocalName() {
+ return null;
+ }
+
+ @Override
+ public String getLocalAddr() {
+ return null;
+ }
+
+ @Override
+ public int getLocalPort() {
+ return 0;
+ }
+
+ @Override
+ public ServletContext getServletContext() {
+ return null;
+ }
+
+ @Override
+ public AsyncContext startAsync() throws IllegalStateException {
+ return null;
+ }
+
+ @Override
+ public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse) throws IllegalStateException {
+ return null;
+ }
+
+ @Override
+ public boolean isAsyncStarted() {
+ return false;
+ }
+
+ @Override
+ public boolean isAsyncSupported() {
+ return false;
+ }
+
+ @Override
+ public AsyncContext getAsyncContext() {
+ return null;
+ }
+
+ @Override
+ public DispatcherType getDispatcherType() {
+ return null;
+ }
}
diff --git a/src/main/java/com/api/test/aiyh/controller/TestServlet.java b/src/main/java/com/api/test/aiyh/controller/TestServlet.java
new file mode 100644
index 0000000..9525e65
--- /dev/null
+++ b/src/main/java/com/api/test/aiyh/controller/TestServlet.java
@@ -0,0 +1,34 @@
+package com.api.test.aiyh.controller;
+
+import aiyh.utils.ApiResult;
+
+import javax.servlet.ServletException;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.core.MediaType;
+import java.io.IOException;
+
+/**
+ * ceshi servlet
+ *
+ * create: 2023/7/18 10:36
+ *
+ * @author youHong.ai
+ */
+@WebServlet("/test/servlet/v1")
+public class TestServlet extends HttpServlet {
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
+ String success = ApiResult.success("成功!");
+ res.setContentType(MediaType.APPLICATION_JSON + ";charset=utf-8");
+ res.getWriter().write(success);
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
+ super.doPost(req, res);
+ }
+}
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 6a7f2c3..3b8beb4 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
@@ -5,8 +5,10 @@ import aiyh.utils.Util;
import aiyh.utils.excention.CustomerException;
import com.alibaba.fastjson.JSONObject;
import com.api.xuanran.wang.eny.workflow.mapper.ExchangeRateMapper;
+import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import weaver.seconddev.ey.zhangm.util.EYSeconddevUtil;
@@ -16,8 +18,10 @@ import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.math.BigDecimal;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -40,9 +44,9 @@ public class GetExchangeRate {
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public String exchangeRate(@Context HttpServletRequest request,
- @Context HttpServletResponse response,
- @RequestBody Map params){
+ @Context HttpServletResponse response){
try {
+ Map params = parseBody(request);
if(eySeconddevUtil == null){
eySeconddevUtil = new EYSeconddevUtil();
}
@@ -101,4 +105,25 @@ public class GetExchangeRate {
}
}
+ private Map parseBody(HttpServletRequest request) {
+ try {
+ InputStream inputStream = request.getInputStream();
+ BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+ StringBuilder requestBody = new StringBuilder();
+ String line;
+ while ((line = reader.readLine()) != null) {
+ requestBody.append(line);
+ }
+ ObjectMapper objectMapper = new ObjectMapper();
+ Map body = objectMapper.readValue(requestBody.toString(), Map.class);
+ if(MapUtils.isEmpty(body)){
+ throw new CustomerException("parse body map is empty!");
+ }
+ return body;
+ }catch (Exception e){
+ throw new CustomerException("解析请求体json error : " + e.getMessage());
+ }
+ }
+
+
}
diff --git a/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/controller/CommonDataAsyncController.java b/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/controller/CommonDataAsyncController.java
index 4e23cda..024f20d 100644
--- a/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/controller/CommonDataAsyncController.java
+++ b/src/main/java/com/api/xuanran/wang/xk_hospital/data_async/controller/CommonDataAsyncController.java
@@ -2,6 +2,8 @@ package com.api.xuanran.wang.xk_hospital.data_async.controller;
import aiyh.utils.ApiResult;
import aiyh.utils.Util;
+import com.api.xuanran.wang.xk_hospital.data_async.service.XkHospitalCommonDataAsyncService;
+import com.api.xuanran.wang.xk_hospital.data_async.service.impl.XkHospitalCommonDataAsyncServiceImpl;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import org.apache.log4j.Logger;
@@ -23,19 +25,23 @@ public class CommonDataAsyncController {
private final Logger logger = Util.getLogger();
+ private final XkHospitalCommonDataAsyncService service = new XkHospitalCommonDataAsyncServiceImpl();
+
@POST
- @Path("/{configId}}")
+ @Path("/{type}/{configId}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public String async(@Context HttpServletRequest request,
- @Context HttpServletResponse response,
- @PathParam("configId") String configId,
- @RequestBody Map params){
+ @Context HttpServletResponse response,
+ @PathParam("configId") String configId,
+ @PathParam("type") String type,
+ @RequestBody Map params){
try {
- return "";
+ service.async(configId, type, params);
+ return ApiResult.successNoData();
}catch (Exception e){
logger.error("CommonDataAsyncController error : " + e.getMessage());
- Util.logErrorStr(e, logger);
+ Util.logErrorStr(e);
return ApiResult.error("数据同步失败! [ " + e.getMessage() + " ]");
}
}
diff --git a/src/main/java/com/api/youhong/ai/guojun/sso/controller/SsoLoginAuthController.java b/src/main/java/com/api/youhong/ai/guojun/sso/controller/SsoLoginAuthController.java
new file mode 100644
index 0000000..179e6da
--- /dev/null
+++ b/src/main/java/com/api/youhong/ai/guojun/sso/controller/SsoLoginAuthController.java
@@ -0,0 +1,40 @@
+package com.api.youhong.ai.guojun.sso.controller;
+
+import aiyh.utils.Util;
+import com.sun.jersey.api.view.Viewable;
+import org.apache.log4j.Logger;
+import weaver.integration.util.SessionUtil;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Context;
+
+/**
+ * 国泰君安期货poc阶段小程序集成认证
+ *
+ * create: 2023/7/18 11:03
+ *
+ * @author youHong.ai
+ */
+@Path("aiyh/guojun/sso")
+public class SsoLoginAuthController {
+ private final Logger log = Util.getLogger();
+
+ @GET
+ @Path("/auth")
+ public Viewable authSso(@Context HttpServletRequest request, @Context HttpServletResponse response,
+ @QueryParam("account") String account,
+ @QueryParam("redirectChannel") String redirectChannel) {
+ try {
+ String userId = Util.getCusConfigValue(account);
+ SessionUtil.createSession(userId, request, response);
+ response.sendRedirect(redirectChannel);
+ } catch (Exception e) {
+ log.error("认证失败:" + Util.getErrString(e));
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/com/api/youhong/ai/guojun/todolist/controller/WorkflowTaskController.java b/src/main/java/com/api/youhong/ai/guojun/todolist/controller/WorkflowTaskController.java
new file mode 100644
index 0000000..7bb2d76
--- /dev/null
+++ b/src/main/java/com/api/youhong/ai/guojun/todolist/controller/WorkflowTaskController.java
@@ -0,0 +1,42 @@
+package com.api.youhong.ai.guojun.todolist.controller;
+
+import aiyh.utils.ApiResult;
+import com.api.youhong.ai.guojun.todolist.service.WorkflowTaskService;
+import weaver.hrm.HrmUserVarify;
+import weaver.hrm.User;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.MediaType;
+
+/**
+ * 流程待办等信息
+ *
+ * create: 2023/7/18 11:23
+ *
+ * @author youHong.ai
+ */
+@Path("/aiyh/guojun/workflow-task")
+public class WorkflowTaskController {
+
+ private final WorkflowTaskService service = new WorkflowTaskService();
+
+ @Path("/todo-list")
+ @GET
+ @Produces(MediaType.APPLICATION_JSON)
+ @Consumes(MediaType.APPLICATION_JSON)
+ public String getTodoList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
+
+ try {
+ User user = HrmUserVarify.getUser(request, response);
+ return ApiResult.success(service.getTodoList(user), 0, "成功");
+ } catch (Exception e) {
+ return ApiResult.error(-1, "system error");
+ }
+ }
+}
diff --git a/src/main/java/com/api/youhong/ai/guojun/todolist/mapper/WorkflowTaskMapper.java b/src/main/java/com/api/youhong/ai/guojun/todolist/mapper/WorkflowTaskMapper.java
new file mode 100644
index 0000000..2d54e83
--- /dev/null
+++ b/src/main/java/com/api/youhong/ai/guojun/todolist/mapper/WorkflowTaskMapper.java
@@ -0,0 +1,20 @@
+package com.api.youhong.ai.guojun.todolist.mapper;
+
+import aiyh.utils.annotation.recordset.SqlMapper;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ *
+ * create: 2023/7/18 11:33
+ *
+ * @author youHong.ai
+ */
+@SqlMapper
+public interface WorkflowTaskMapper {
+
+
+ List