diff --git a/jeecg-boot-module/jeecg-module-service/src/main/java/org/jeecg/modules/service/controller/AuthUserController.java b/jeecg-boot-module/jeecg-module-service/src/main/java/org/jeecg/modules/service/controller/AuthUserController.java index b7ee1bf..bb2997f 100644 --- a/jeecg-boot-module/jeecg-module-service/src/main/java/org/jeecg/modules/service/controller/AuthUserController.java +++ b/jeecg-boot-module/jeecg-module-service/src/main/java/org/jeecg/modules/service/controller/AuthUserController.java @@ -25,11 +25,10 @@ import org.jeecg.modules.service.dto.CardApplicationDTO; import org.jeecg.modules.service.entity.AuthUser; import org.jeecg.modules.service.service.IAuthUserService; -import org.jeecg.modules.service.vo.DispatchDetailVO; -import org.jeecg.modules.service.vo.DispatchUserVO; -import org.jeecg.modules.service.vo.MyGroupMemberVO; -import org.jeecg.modules.service.vo.RecommendUserVO; +import org.jeecg.modules.service.vo.*; import org.jeecg.modules.system.entity.CardApplicationCustomers; +import org.jeecg.modules.system.entity.CardDeliveryPerson; +import org.jeecg.modules.system.mapper.CardDeliveryPersonMapper; import org.jeecg.modules.system.service.ICardApplicationCustomersService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; @@ -37,6 +36,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -64,6 +64,9 @@ @Autowired private ICardApplicationCustomersService cardApplicationCustomersService; + @Autowired + private CardDeliveryPersonMapper cardDeliveryPersonMapper; + /** *我的-推荐用户列表 */ @@ -92,9 +95,23 @@ * 我的资料 */ @RequestMapping(value = "/detail", method = RequestMethod.GET) - public Result detail(@RequestParam (name = "id",required=false) String id) { + public Result detail(@RequestParam (name = "id",required=false) String id) { + AuthUserVO vo = new AuthUserVO(); AuthUser authUser = authUserService.getById(id); - return Result.OK(authUser); + if (authUser == null){ + return Result.error("用户不存在"); + } + BeanUtils.copyProperties(authUser,vo); + vo.setIsCardMan(false); + if (authUser.getWxPhone() != null){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("phone", authUser.getWxPhone()); + CardDeliveryPerson cardDeliveryPerson = cardDeliveryPersonMapper.selectOne(queryWrapper); + if (cardDeliveryPerson != null){ + vo.setIsCardMan(true); + } + } + return Result.OK(vo); } @RequestMapping(value = "/update", method = RequestMethod.POST)