| | |
| | | package com.panzhihua.service_user.api; |
| | | |
| | | import com.panzhihua.common.model.dtos.PageDTO; |
| | | import com.panzhihua.common.model.dtos.community.ExportUserDTO; |
| | | import com.panzhihua.common.model.dtos.community.NoticeReadDTO; |
| | | import com.panzhihua.common.model.dtos.user.EexcelUserDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; |
| | | import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; |
| | | import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.SystemmanagementConfigVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.service_user.service.SysUserInputService; |
| | | import com.panzhihua.service_user.service.UserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | * @author: huang.hongfa weixin hhf9596 qq 959656820 |
| | | * @create: 2020-11-24 09:00 |
| | | **/ |
| | | @Slf4j |
| | | @RestController("/") |
| | | public class UserApi { |
| | | @Resource |
| | | private UserService userService; |
| | | @Resource |
| | | private SysUserInputService sysUserInputService; |
| | | |
| | | /** |
| | | * 新增微信用户 |
| | |
| | | public R addNotice(@RequestBody SysUserNoticeVO sysUserNoticeVO){ |
| | | return userService.addNotice(sysUserNoticeVO); |
| | | } |
| | | |
| | | /** |
| | | * 修改用户的党员状态 |
| | | * @param idCard 身份证号 |
| | | * @return 修改结果 |
| | | */ |
| | | @PostMapping("updateuserispartymember") |
| | | public R updateUserIsPartymember(@RequestParam("idCard")String idCard){ |
| | | return userService.updateUserIsPartymember(idCard); |
| | | } |
| | | |
| | | /** |
| | | * 获取各种协议 |
| | | * @param type 1居民端app协议 2网格员端app协议 3商家端app协议 4隐私政策 |
| | | * @return 协议内容 |
| | | */ |
| | | @PostMapping("agreement") |
| | | public R agreement(@RequestParam("type")Integer type){ |
| | | return userService.agreement(type); |
| | | } |
| | | |
| | | /** |
| | | * 维护用户最后登录时间 |
| | | * @param userId 用户主键 |
| | | * @return 维护结果 |
| | | */ |
| | | @PostMapping("putuserlastlogintime") |
| | | public R putUserLastLoginTime(@RequestParam("userId")Long userId){ |
| | | return userService.putUserLastLoginTime(userId); |
| | | } |
| | | |
| | | /** |
| | | * 删除意见反馈 |
| | | * @param id 主键 |
| | | * @return 删除结果 |
| | | */ |
| | | @PostMapping("deletefeedback") |
| | | public R deleteFeedback(@RequestParam("id")Long id){ |
| | | return userService.deleteFeedback(id); |
| | | } |
| | | |
| | | /** |
| | | * 校验小区是否存在 |
| | | * @param areaName 小区名字 |
| | | * @return 校验结果 |
| | | */ |
| | | @PostMapping("checkaereaname") |
| | | public R checkAereaName(@RequestParam("areaName")String areaName){ |
| | | return userService.checkAereaName(areaName); |
| | | } |
| | | |
| | | /** |
| | | * 批量导入居民用户 |
| | | * @param list 居民用户集合 |
| | | * @param areaName 小区名字 |
| | | * @return 导入结果 |
| | | */ |
| | | @PostMapping("batchsaveuser") |
| | | public R batchSaveUser(@RequestBody List<EexcelUserDTO> list,@RequestParam("areaName")StringBuffer areaName){ |
| | | R r = null; |
| | | try { |
| | | r = sysUserInputService.batchSaveUser(list, areaName); |
| | | } catch (Exception e) { |
| | | String message = e.getMessage(); |
| | | log.error(message); |
| | | if (message.contains("unique_id_card")) { |
| | | int i = message.indexOf("'"); |
| | | String idcard = message.substring(i + 1, message.indexOf("'", i + 1)); |
| | | // System.out.println(idcard); |
| | | return R.fail("身份证存在重复"+idcard); |
| | | }else { |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | /** |
| | | * 社区人员详情包括导入人员 |
| | | * @param userId 人员id |
| | | * @return CommunityUserInfoVO |
| | | */ |
| | | @PostMapping("detailusercomunity") |
| | | public R detailUserComunity(@RequestParam("userId")Long userId){ |
| | | CommunityUserInfoVO communityUserInfoVO=new CommunityUserInfoVO(); |
| | | if(userId<100000000l){ |
| | | communityUserInfoVO=userService.detailUserComunity(userId); |
| | | }else{ |
| | | communityUserInfoVO=sysUserInputService.detailUserComunity(userId); |
| | | } |
| | | return R.ok(communityUserInfoVO); |
| | | } |
| | | |
| | | /** |
| | | * 用户搜索了就下载搜索的用户否则下载所有用户 |
| | | * @param exportUserDTO 用户搜索内容 |
| | | * @return List<EexcelUserDTO> excel内容 |
| | | */ |
| | | @PostMapping("export") |
| | | public R export(@RequestBody ExportUserDTO exportUserDTO){ |
| | | return userService.export(exportUserDTO); |
| | | } |
| | | } |