From 220947922692dc8c41e2de39fd90b61907fe6d42 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 3 Jul 2023 15:34:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=91=98=E5=B7=A5=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ding/controller/DingInfoPullController.java | 30 ++++++++++++++++++++++ .../pmapi/user/manage/UserInfoManage.java | 1 + .../pmapi/user/model/vo/ResUserDetailVO.java | 3 +++ 3 files changed, 34 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java index b2ebe61..0c781e9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java @@ -1,10 +1,17 @@ package com.ningdatech.pmapi.ding.controller; +import com.alibaba.fastjson.JSON; +import com.ningdatech.pmapi.common.util.CryptUtils; +import com.ningdatech.pmapi.common.util.RefreshKeyUtil; import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; import com.ningdatech.pmapi.ding.task.GovBusinessStripsTask; import com.ningdatech.pmapi.ding.task.OrganizationBatchGetTask; import lombok.RequiredArgsConstructor; +import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import org.springframework.web.client.RestTemplate; + +import java.security.NoSuchAlgorithmException; /** *

@@ -58,4 +65,27 @@ public class DingInfoPullController { public void getBatchEmployeeByCode(@PathVariable String orgCode) { employeeBatchGetTask.getBatchEmployeeByCode(orgCode); } + + @GetMapping("/test-app") + public void testApp() throws NoSuchAlgorithmException { + long timestamp = System.currentTimeMillis(); + String areaCode = "331121"; + String appKey = "A331101453557202109017383"; + String appScret = "496f0f2a19994f76b4fd9dae087366c7"; + + String requestSecret = RefreshKeyUtil.getRequestSecret(appKey, appScret); + String capCode = CryptUtils.MD5Encode(timestamp + areaCode); + String capTime = String.valueOf(timestamp); + String sign = CryptUtils.MD5Encode(appKey + requestSecret + timestamp); + String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/94wbaL1I1Pbz0648.htm?requestTime=" + timestamp + + "&sign=" + sign + "&appKey=" + appKey + "&capCode=" + capCode + "&capTime=" + capTime + + "&baseProjSys=测试应用&areaCode=331121&baseProjName=nsl-丽水演示项目&baseProjId=331100230130112233001" + + "&isEffective=1&baseProjSysCode=25083657"; + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity forEntity = restTemplate.getForEntity(url, String.class); + + System.out.println(JSON.toJSONString(forEntity)); + } + + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java index 932a2dd..2d4b1a9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java @@ -409,6 +409,7 @@ public class UserInfoManage { resUserDetailVO.setPhoneNo(userInfo.getMobile()); resUserDetailVO.setStatus(userInfo.getAvailable()); resUserDetailVO.setEmployeeCode(userInfo.getEmployeeCode()); + resUserDetailVO.setAvatar(userInfo.getAvatar()); // 装配用户角色信息列表 List userRoleList = iUserRoleService.list(Wrappers.lambdaQuery(UserRole.class) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java index f5b50e8..4d4ed26 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java @@ -59,6 +59,9 @@ public class ResUserDetailVO { @ApiModelProperty("更新时间") private LocalDateTime updateTime; + @ApiModelProperty("头像") + private String avatar; + //是否是市级单位 public Boolean getIsMunicipalOrg(){ //如果是丽水市本级的code 就是