puhanshu
2022-08-31 d5208f24fbf0e71d21171a06b64ce457bad40d43
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/api/UserApi.java
@@ -4,10 +4,16 @@
import javax.annotation.Resource;
import cn.hutool.core.util.StrUtil;
import com.panzhihua.common.model.dtos.DataKanBansDto;
import com.panzhihua.common.model.dtos.community.convenient.ConvenientMerchantDTO;
import com.panzhihua.common.model.dtos.community.convenient.DisableOrEnableConvenientMerchantDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.BindUserPhoneDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import com.panzhihua.common.model.dtos.PageDTO;
@@ -51,8 +57,8 @@
     */
    @PostMapping("/addOrUpdate")
    public R addOrUpdate(@RequestParam("openid") String openid, @RequestParam("sessionKey") String sessionKey,
        @RequestParam("unionid") String unionid) {
        return userService.updateInsertUser(openid, sessionKey, unionid);
        @RequestParam("unionid") String unionid,@RequestParam("appId")String appId) {
        return userService.updateInsertUser(openid, sessionKey, unionid,appId);
    }
    /**
@@ -98,10 +104,13 @@
     */
    @PostMapping("/getUserInfo")
    public R<LoginUserInfoVO> getUserInfo(@RequestParam("userName") String userName) {
        int index = userName.lastIndexOf("_");
        String type = userName.substring(index + 1);
        String name = userName.substring(0, index);
        return userService.getUserInfo(name, Integer.parseInt(type));
        int index2 = userName.lastIndexOf("_");
        String appid=userName.substring(index2+1);
        String username=userName.substring(0,index2);
        int index = username.lastIndexOf("_");
        String type = username.substring(index + 1);
        String name = username.substring(0, index);
        return userService.getUserInfo(name, Integer.parseInt(type),appid);
    }
    /**
@@ -168,7 +177,7 @@
    /**
     * 微心愿搜索社区团队人员列表
     *
     *
     * @param param
     *            请求参数
     * @param communityId
@@ -244,7 +253,7 @@
     * @return 人员详情
     */
    @PostMapping("detailuser")
    public R detailUser(@RequestParam("userId") Long userId) {
    public R<LoginUserInfoVO> detailUser(@RequestParam("userId") Long userId) {
        return userService.detailUser(userId);
    }
@@ -394,6 +403,18 @@
    @PostMapping("putuserbackstage")
    R putUserBackstage(@RequestBody AdministratorsUserVO administratorsUserVO) {
        return userService.putUserBackstage(administratorsUserVO);
    }
    /**
     * 更新
     *
     * @param administratorsUserVO
     *            编辑账户内容
     * @return 编辑结果
     */
    @PostMapping("updateStreet")
    R updateStreet(@RequestBody AdministratorsUserVO administratorsUserVO) {
        return userService.updateStreetId(administratorsUserVO);
    }
    /**
@@ -547,8 +568,8 @@
     * @return 协议内容
     */
    @PostMapping("useragreement")
    public R userAgreement(@RequestParam("type") int type) {
        return userService.userAgreement(type);
    public R userAgreement(@RequestParam("type") int type,@RequestParam("appid")String appId) {
        return userService.userAgreement(type,appId);
    }
    /**
@@ -629,8 +650,8 @@
     * @return 运营后台数据看板
     */
    @PostMapping("datakanban")
    public R dataKanban() {
        return userService.dataKanban();
    public R dataKanban(@RequestParam("areaCode")String areaCode) {
        return userService.dataKanban(areaCode);
    }
    /**
@@ -679,9 +700,14 @@
        return userService.updateUserIsPartymember(idCard);
    }
    @PostMapping("updateuserispartymemberByPhone")
    public R updateUserIsPartymemberByPhone(@RequestParam("phone") String phone) {
        return userService.updateUserIsPartymemberByPhone(phone);
    }
    /**
     * 修改用户为非党员状态
     *
     *
     * @param idCard
     *            身份证号
     * @return 修改结果
@@ -699,8 +725,8 @@
     * @return 协议内容
     */
    @PostMapping("agreement")
    public R agreement(@RequestParam("type") Integer type) {
        return userService.agreement(type);
    public R agreement(@RequestParam("type") Integer type,@RequestParam("appId")String appId) {
        return userService.agreement(type,appId);
    }
    /**
@@ -1027,7 +1053,7 @@
    /**
     * 修改app用户密码
     *
     *
     * @param userInfoAppDTO
     *            请求参数
     * @return 修改结果
@@ -1039,7 +1065,7 @@
    /**
     * 添加网格员
     *
     *
     * @param eventGridMemberAddDTO
     *            请求参数
     * @return 结果
@@ -1051,7 +1077,7 @@
    /**
     * 网格员管理
     *
     *
     * @param memberRelationDTO
     *            请求参数
     * @return 网格员列表
@@ -1063,7 +1089,7 @@
    /**
     * 修改网格员信息
     *
     *
     * @param gridMemberDTO
     *            请求参数
     * @return 修改结果
@@ -1075,7 +1101,7 @@
    /**
     * 重置网格员密码
     *
     *
     * @param gridMemberDTO
     *            请求参数
     * @return 重置结果
@@ -1087,7 +1113,7 @@
    /**
     * 批量删除网格员
     *
     *
     * @param Ids
     *            网格员id集合
     * @return 删除结果
@@ -1109,7 +1135,7 @@
    /**
     * 查询社区的收益说明
     *
     *
     * @param communityId
     *            社区id
     * @return 收益说明
@@ -1131,7 +1157,7 @@
    /**
     * 根据用户id查询用户openid
     *
     *
     * @param userId
     *            用户id
     * @return openid
@@ -1143,7 +1169,7 @@
    /**
     * 查询社区后台工作人员列表
     *
     *
     * @param communityId
     *            社区id
     * @return 社区后台工作人员列表
@@ -1219,13 +1245,13 @@
     * @return  用户数据统计汇总
     */
    @GetMapping("community/statistics")
    public R communityStatistics() {
        return userService.communityStatistics();
    public R communityStatistics(@RequestParam("areaCode") String areaCode) {
        return userService.communityStatistics(areaCode);
    }
    @GetMapping("community/statistics/export")
    public R communityStatisticsExport() {
        return userService.communityStatisticsExport();
    public R communityStatisticsExport(@RequestParam("areaCode") String areaCode) {
        return userService.communityStatisticsExport(areaCode);
    }
    /**
@@ -1281,7 +1307,7 @@
    }
    /**
     * 发送验证码登录
     * 发送验证码
     * @param phone 手机号
     * @param clientIP 用户ip
     * @param prefixKey redis Key 前缀
@@ -1289,12 +1315,139 @@
     * @param timeout 超次数获取时间等待
     * @return
     */
    @GetMapping("/sendMessageCodeForLogin")
    public R sendMessageCodeForLogin(@RequestParam("phone") String phone,
    @GetMapping("/sendMessageCode")
    public R sendMessageCode(@RequestParam("phone") String phone,
                                     @RequestParam(value = "clientIP", required = false) String clientIP,
                                     @RequestParam("prefixKey") String prefixKey,
                                     @RequestParam("limit") Integer limit,
                                     @RequestParam("timeout") Integer timeout) {
        return userService.sendMessageCodeForLogin(phone, clientIP, prefixKey, limit, timeout);
        return userService.sendMessageCode(phone, clientIP, prefixKey, limit, timeout);
    }
    /**
     * 根据openId获取微商业街用户
     * @param openid
     * @return
     */
    @GetMapping("/getMcsUserByOpenId")
    public R getMcsUserByOpenId(@RequestParam("openid") String openid) {
        return userService.getMcsUserByOpenId(openid);
    }
    /**
     * 商业街用户微信授权-绑定手机号
     * @param bindUserPhoneDTO
     * @return
     */
    @PostMapping("/mcs/bindPhone")
    public R bindOrAddMcsUser(@RequestBody BindUserPhoneDTO bindUserPhoneDTO) {
        return userService.bindOrAddMcsUser(bindUserPhoneDTO);
    }
    /**
     * 删除用户信息缓存
     * @param phone
     */
    @DeleteMapping("/deleteUserCashByPhone")
    public R deleteUserCashByPhone(@RequestParam("phone") String phone) {
        return userService.deleteUserCashByPhone(phone);
    }
    @PostMapping("/update/user/party/status")
    public R updateUserPartyStatus(@RequestParam("userId") Long userId) {
        return userService.updateUserPartyStatus(userId);
    }
    @PostMapping("/uuLogin")
    public R uuLogin(@RequestBody UuLoginVO uuLoginVO){
        return userService.uuLogin(uuLoginVO);
    }
    /**
     * 数据看板:数据总览
     * @return
     */
    @GetMapping("/indexData/totalData")
    public R indexData(@RequestParam(value = "type",required = false) Integer type,
                       @RequestParam(value = "streetId",required = false) Long streetId,
                       @RequestParam(value = "areaCode",required = false) Long areaCode,@RequestParam("appId")String appId){
        return userService.newIndexData(type,streetId,areaCode,appId);
    }
    /**
     * 数据看板:用户占比
     * @return
     */
    @GetMapping("/indexData/userRate")
    public R userRate(@RequestParam(value = "type",required = false) Integer type,
                          @RequestParam(value = "streetId",required = false) Long streetId,
                          @RequestParam(value = "areaCode",required = false) Long areaCode,
                      @RequestParam(value = "range",required = false) Integer range,@RequestParam("appId")String appId){
        return userService.userRate(type,streetId,areaCode,range,appId);
    }
    /**
     * 数据看板:真实用户统计
     * @return
     */
    @GetMapping("/indexData/realUser")
    public R realUser(@RequestParam(value = "type",required = false) Integer type,
                      @RequestParam(value = "streetId",required = false) Long streetId,
                      @RequestParam(value = "areaCode",required = false) Long areaCode,
                      @RequestParam(value = "range",required = false) Integer range,@RequestParam(value = "appId",required = false)String appId){
        return userService.realUser(type,streetId,areaCode,range,appId);
    }
    @GetMapping("/indexData/userActivity")
    public R userActivity(@RequestParam(value = "type",required = false) Integer type,
                          @RequestParam(value = "streetId",required = false) Long streetId,
                          @RequestParam(value = "areaCode",required = false) Long areaCode,
                          @RequestParam(value = "range",required = false) Integer range,
                          @RequestParam(value = "appId",required = false) String appId){
        return userService.userActivity(type,streetId,areaCode,range, appId);
    }
    /**
     *导出验证密码
     */
    @GetMapping("/checkExport")
    public R checkExport(@RequestParam("account")String account,@RequestParam("password")String password,@RequestParam("oldPassword")String oldPassword){
        return userService.checkExport(account,password,oldPassword);
    }
    /**
     * uu洗车推送
     * @param washPhone
     * @param phone
     * @param washName
     * @param orderStatus
     * @return
     */
    @GetMapping("/uuPush")
    public R uuPush(@RequestParam(value = "washPhone",required = false)String washPhone,@RequestParam("phone")String phone,@RequestParam(value = "washName",required = false)String washName,@RequestParam("orderStatus")Integer orderStatus){
        return userService.uuPush(washPhone,phone,washName,orderStatus);
    }
    @GetMapping("/indexData/getAreaAndStreet")
    public R getAreaAndStreet(){
        return userService.getAreaAndStreet();
    }
    @GetMapping("/communityList")
    public R getCommunityList(@RequestParam("name") String name, @RequestParam(value = "id",required = false) Long id){
        return userService.getCommunityList(name,id);
    }
    @GetMapping("/resetPasswordAccount")
    public R resetPasswordAccount(@RequestParam("type")Integer type,@RequestParam("account")String account){
        return userService.resetPassword(type,account);
    }
    @PostMapping("/tfLogin")
    public R tfLogin(@RequestBody UuLoginVO uuLoginVO){
        return userService.tfLogin(uuLoginVO);
    }
}