From 9db67591a04f4059fdeab11eaf5cb79812e7a76e Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Wed, 30 Apr 2025 17:50:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E8=88=AA=E5=AF=8C=E5=A3=AB=E8=BE=BE?= =?UTF-8?q?=E4=BA=BA=E4=BA=8B=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ExamineRankingService.java | 8 +++++++ .../impl/ExamineRankingServiceImpl.java | 12 ++++++++++ .../web/ExamineRankingAction.java | 23 ++++++++++++++++--- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/src/com/engine/forstarsecond/service/ExamineRankingService.java b/src/com/engine/forstarsecond/service/ExamineRankingService.java index 62fcd19..bfa5f8b 100644 --- a/src/com/engine/forstarsecond/service/ExamineRankingService.java +++ b/src/com/engine/forstarsecond/service/ExamineRankingService.java @@ -42,4 +42,12 @@ public interface ExamineRankingService { */ List calculateWorkersByYear(String khqj,String yglb); + /** + * @Description: 获取人员图像 + * @Author: liang.cheng + * @Date: 2025/4/30 14:35 + * @param: [resourceId] + * @return: java.lang.String + */ + String resourceImage(String billid); } diff --git a/src/com/engine/forstarsecond/service/impl/ExamineRankingServiceImpl.java b/src/com/engine/forstarsecond/service/impl/ExamineRankingServiceImpl.java index 05bccc6..d50619f 100644 --- a/src/com/engine/forstarsecond/service/impl/ExamineRankingServiceImpl.java +++ b/src/com/engine/forstarsecond/service/impl/ExamineRankingServiceImpl.java @@ -3,8 +3,10 @@ package com.engine.forstarsecond.service.impl; import com.engine.core.impl.Service; import com.engine.forstarsecond.entity.ExamineRanking; import com.engine.forstarsecond.service.ExamineRankingService; +import lombok.SneakyThrows; import weaver.conn.RecordSet; import weaver.general.Util; +import weaver.hrm.resource.ResourceComInfo; import java.util.ArrayList; import java.util.List; @@ -85,6 +87,16 @@ public class ExamineRankingServiceImpl extends Service implements ExamineRanking return examineRankings; } + @SneakyThrows + @Override + public String resourceImage(String billid) { + RecordSet rs = new RecordSet(); + rs.executeQuery("select ryid from uf_hr_employee where id = ?",billid); + rs.next(); + String ryid = Util.null2String(rs.getString("ryid")); + return new ResourceComInfo().getMessagerUrls(ryid); + } + /** * 通用排名计算方法 * @param dataList diff --git a/src/com/engine/forstarsecond/web/ExamineRankingAction.java b/src/com/engine/forstarsecond/web/ExamineRankingAction.java index 67fbaaf..cd724e9 100644 --- a/src/com/engine/forstarsecond/web/ExamineRankingAction.java +++ b/src/com/engine/forstarsecond/web/ExamineRankingAction.java @@ -11,9 +11,7 @@ import weaver.hrm.User; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import java.util.HashMap; @@ -46,6 +44,25 @@ public class ExamineRankingAction { } return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect); } + + @GET + @Path("/resourceImage") + @Produces(MediaType.TEXT_PLAIN) + public String resourceImage(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("billid") String billid) { + Map data = new HashMap<>(8); + try { + User user = HrmUserVarify.getUser(request, response); + data.put("url", getService(user).resourceImage(billid)); + data.put("code", 200); + } catch (Exception e) { + data.put("code", 500); + data.put("msg", "catch exception : " + e.getMessage()); + } + return JSONObject.toJSONString(data, SerializerFeature.DisableCircularReferenceDetect); + } + + + }