From 81e00cd2e26e387d8ab2077ccd982072d6eb865b Mon Sep 17 00:00:00 2001 From: 姜友瑶 <935090232@qq.com> Date: Tue, 17 May 2022 15:40:31 +0800 Subject: [PATCH] Merge branch 'developer' into alpha --- zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java | 28 ++++++++++++++++++++++------ 1 files changed, 22 insertions(+), 6 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java index f2ab628..76fdd77 100644 --- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java +++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiCommonAction.java @@ -2,6 +2,7 @@ import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.TypeReference; import com.matrix.component.tools.HttpCurlUtil; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.*; @@ -59,6 +60,9 @@ @RestController @RequestMapping(value = "/api/common") public class ApiCommonAction { + @Autowired + UploadUtil uploadUtil; + @Autowired private SysUsersService sysUsersService; @@ -169,11 +173,12 @@ EXT_LIST.add(FileType.PNG); } + @ApiOperation(value = "表单图片上传接口", notes = "表单图片上传接口") @PostMapping(value = "/uploadImg") public AjaxResult uploadImg(HttpServletResponse response, MultipartHttpServletRequest request) throws IOException, FileUploadException, NoSuchAlgorithmException { - Map<String, String> fileMap = UploadUtil.doUpload(request, EXT_LIST, folderType, 1L); + Map<String, String> fileMap = uploadUtil.doUpload(request, EXT_LIST, folderType, 1L); AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("上传成功"); ajaxResult.putInMap("file", fileMap.get("visitPath")); return ajaxResult; @@ -190,7 +195,7 @@ return AjaxResult.buildFailInstance("该手机号不存在"); } - String codeExist = LocalCache.get(smsCodeDto.getTelphone()); + String codeExist = LocalCache.get(smsCodeDto.getTelphone(),new TypeReference<String>(){}); if (StringUtils.isNotBlank(codeExist)) { return AjaxResult.buildFailInstance("请勿重复发送验证码"); } @@ -211,7 +216,7 @@ return AjaxResult.buildFailInstance("该手机号不存在"); } - String code = LocalCache.get(pwdResetDto.getTelphone()); + String code = LocalCache.get(pwdResetDto.getTelphone(),new TypeReference<String>(){}); if (StringUtils.isBlank(code)) { return AjaxResult.buildFailInstance("验证码已失效,请重新发送"); } @@ -293,7 +298,7 @@ return AjaxResult.buildFailInstance("code不存在"); } AjaxResult res = new AjaxResult(); - String requrl = weChatApiTools.getXcxLoginUrl(code, HostInterceptor.getCompanyId(), AppConstance.MINI_PROGRAM_MANAGER_APP_ID); + String requrl = weChatApiTools.getManagerXcxLoginUrl(code); String resultData = HttpCurlUtil.sendGetHttp(requrl, null); JSONObject json = JSONObject.fromObject(resultData); @@ -321,6 +326,12 @@ authorityManager.initUserPower(res, hasBind); UserInfoVo userInfoVo = new UserInfoVo(); + if(hasBind.getShopId()!=null){ + SysShopInfo shopInfo = sysShopInfoService.findById(hasBind.getShopId()); + hasBind.setShopName(shopInfo.getShopName()); + userInfoVo.setShopName(shopInfo.getShopShortName()); + } + userInfoVo.setId(hasBind.getSuId()); userInfoVo.setName(hasBind.getSuName()); userInfoVo.setRoleName(hasBind.getRoleName()); @@ -347,6 +358,12 @@ authorityManager.initUserPower(result, user); UserInfoVo userInfoVo = new UserInfoVo(); + if(user.getShopId()!=null){ + SysShopInfo shopInfo = sysShopInfoService.findById(user.getShopId()); + user.setShopName(shopInfo.getShopName()); + userInfoVo.setShopName(shopInfo.getShopShortName()); + } + userInfoVo.setId(user.getSuId()); userInfoVo.setName(user.getSuName()); userInfoVo.setRoleName(user.getRoleName()); @@ -362,8 +379,7 @@ List<String> openIds = StrUtil.split(hasBind.getOpenIds(), ','); openIds.remove(loginDto.getOpenId()); - hasBind.setOpenIds(CollUtil.join(openIds, ",")); - sysUsersService.modifyByModel(hasBind); + sysUsersService.modifyUserOpenId(CollUtil.join(openIds, ","), hasBind.getSuId()); } } -- Gitblit v1.9.1