提交 e66d97b8 作者: zhenjie

Merge branch 'develop'

FROM openjdk:8-jdk-alpine FROM openjdk:8-jdk-alpine
#VOLUME ["/tmp","/files","/var/logs/"] VOLUME ["/var/log/app/"]
ARG JAVA_OPTS ARG JAVA_OPTS
ENV JAVA_OPTS=$JAVA_OPTS ENV JAVA_OPTS=$JAVA_OPTS
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
......
package com.mmc.iuav.user.model.dto; package com.mmc.iuav.user.model.dto;
import com.mmc.iuav.user.model.vo.CompanyAuthVO;
import com.mmc.iuav.user.model.vo.CooperationTagVO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -48,4 +50,8 @@ public class UserAccountSimpleDTO implements Serializable { ...@@ -48,4 +50,8 @@ public class UserAccountSimpleDTO implements Serializable {
private Integer companyAuthStatus; private Integer companyAuthStatus;
@ApiModelProperty(value = "合作标签id") @ApiModelProperty(value = "合作标签id")
private Integer cooperationTagId; private Integer cooperationTagId;
@ApiModelProperty(value = "认证企业")
private String companyName;
@ApiModelProperty(value = "合作标签")
private String tagName;
} }
\ No newline at end of file
package com.mmc.iuav.user.model.qo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.domain.Page;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/6/6 20:41
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserAccountQO implements Serializable {
private static final long serialVersionUID = -6821428525057467450L;
@ApiModelProperty(value = "关键字", required = false, example = "lux")
private String keyword;
@ApiModelProperty(value = "电话号码", required = false)
private String phoneNum;
@ApiModelProperty(value = "用户名", required = false, hidden = true)
private String userName;
@ApiModelProperty(value = "开始时间", example = "2023-05-18 00:00:00")
private String startTime;
@ApiModelProperty(value = "结束时间", example = "2023-10-18 23:59:59")
private String endTime;
@ApiModelProperty(value = "实名认证状态(0未通过,1通过)", hidden = true)
private Integer realAuthStatus;
@ApiModelProperty(value = "企业认证状态(0未通过,1通过)", example = "1")
private Integer companyAuthStatus;
@ApiModelProperty(value = "电子签章认证状态(0未通过,1通过)", hidden = true)
private Integer entVerifyStatus;
@ApiModelProperty(value = "用户来源:0自然流,1海报,2抖音,3公众号,4社群,5招投标,默认0", hidden = true)
private Integer source;
@ApiModelProperty(value = "页码", required = true, example = "1")
@NotNull(message = "页码不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true, example = "10")
@NotNull(message = "每页显示数不能为空", groups = Page.class)
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
...@@ -59,5 +59,9 @@ public class UserAccountVO implements Serializable { ...@@ -59,5 +59,9 @@ public class UserAccountVO implements Serializable {
private Integer companyAuthStatus; private Integer companyAuthStatus;
@ApiModelProperty(value = "合作标签id") @ApiModelProperty(value = "合作标签id")
private Integer cooperationTagId; private Integer cooperationTagId;
@ApiModelProperty(value = "企业名称")
private String companyName;
@ApiModelProperty(value = "合作标签名称")
private String tagName;
} }
package com.mmc.iuav.user.model.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* @author: zj
* @Date: 2023/6/8 15:19
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class WalletUsersVO implements Serializable {
private static final long serialVersionUID = 7932918047614895003L;
@ApiModelProperty(value = "repo_account_id")
@NotNull(message = "账号id")
private Integer repoAccountId;
}
package com.mmc.iuav.group;
/**
* @author 作者 geDuo
* @version 创建时间:2021年8月28日 下午5:37:58
* @explain 类说明
*/
public interface Page {
}
...@@ -2,6 +2,8 @@ package com.mmc.iuav.user; ...@@ -2,6 +2,8 @@ package com.mmc.iuav.user;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
/** /**
* @author:zhenjie * @author:zhenjie
...@@ -12,4 +14,9 @@ public class UserApplication { ...@@ -12,4 +14,9 @@ public class UserApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(UserApplication.class, args); SpringApplication.run(UserApplication.class, args);
} }
@Bean
public RestTemplate restTemplate(){
return new RestTemplate();
}
} }
package com.mmc.iuav.user.client;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.vo.WalletUsersVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
/**
* @author: zj
* @Date: 2023/6/8 15:16
*/
@Component
public class PayClient {
@Value("${iuav.pay.uri}")
private String payAppUri;
@Autowired
private RestTemplate restTemplate;
public ResultBody createWallet(Integer userAccountId){
WalletUsersVO walletUsersVO = new WalletUsersVO();
walletUsersVO.setRepoAccountId(userAccountId);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> entity = new HttpEntity<>(JSONObject.toJSONString(walletUsersVO), headers);
ResponseEntity<ResultBody> responseEntity = restTemplate.exchange(payAppUri + "/payment/repocash/walletUsers", HttpMethod.POST, entity, ResultBody.class);
return responseEntity.getBody();
}
}
...@@ -4,6 +4,7 @@ import com.mmc.iuav.group.Create; ...@@ -4,6 +4,7 @@ import com.mmc.iuav.group.Create;
import com.mmc.iuav.group.Update; import com.mmc.iuav.group.Update;
import com.mmc.iuav.group.UpdatePassword; import com.mmc.iuav.group.UpdatePassword;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.client.PayClient;
import com.mmc.iuav.user.model.dto.BaseAccountDTO; import com.mmc.iuav.user.model.dto.BaseAccountDTO;
import com.mmc.iuav.user.model.dto.LoginSuccessDTO; import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO; import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
...@@ -15,6 +16,7 @@ import io.swagger.annotations.*; ...@@ -15,6 +16,7 @@ import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -50,7 +52,7 @@ public class BackUserAccountController extends BaseController{ ...@@ -50,7 +52,7 @@ public class BackUserAccountController extends BaseController{
@ApiOperation(value = "账号-删除") @ApiOperation(value = "账号-删除")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("removeBAccount") @GetMapping("removeBAccount")
public ResultBody removeBAccount(@RequestParam Integer userAccountId, HttpServletRequest request) { public ResultBody removeBAccount(@RequestParam Integer userAccountId, HttpServletRequest request) {
return userAccountService.removeBAccount(userAccountId); return userAccountService.removeBAccount(userAccountId);
} }
...@@ -86,10 +88,13 @@ public class BackUserAccountController extends BaseController{ ...@@ -86,10 +88,13 @@ public class BackUserAccountController extends BaseController{
return userAccountService.feignAuthUserPwd(id, authPwd); return userAccountService.feignAuthUserPwd(id, authPwd);
} }
@Autowired
private PayClient payClient;
@ApiOperation(value = "test") @ApiOperation(value = "test")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("listTest") @PostMapping("listTest")
public ResultBody listTest(HttpServletRequest request) { public ResultBody listTest(HttpServletRequest request) {
return ResultBody.success(); return ResultBody.success(payClient.createWallet(999));
} }
} }
...@@ -12,6 +12,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -12,6 +12,7 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.List;
/** /**
* @author: zj * @author: zj
...@@ -28,7 +29,7 @@ public class CooperationController extends BaseController{ ...@@ -28,7 +29,7 @@ public class CooperationController extends BaseController{
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class) }) @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class) })
@GetMapping("listTag") @GetMapping("listTag")
public ResultBody listTag() { public ResultBody listTag() {
return cooperationService.listTag(); return ResultBody.success(cooperationService.listTag());
} }
@ApiOperation(value = "根据id获取标签信息") @ApiOperation(value = "根据id获取标签信息")
...@@ -53,4 +54,11 @@ public class CooperationController extends BaseController{ ...@@ -53,4 +54,11 @@ public class CooperationController extends BaseController{
public ResultBody changeUserTag(@RequestParam("userAccountId") Integer userAccountId, @RequestParam("cooperationTagId") Integer cooperationTagId) { public ResultBody changeUserTag(@RequestParam("userAccountId") Integer userAccountId, @RequestParam("cooperationTagId") Integer cooperationTagId) {
return cooperationService.changeUserTag(userAccountId, cooperationTagId); return cooperationService.changeUserTag(userAccountId, cooperationTagId);
} }
@ApiOperation(value = "获取合作渠道标签", hidden = true)
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = CooperationTagVO.class) })
@GetMapping("feignListCooperationTag")
public List<CooperationTagVO> feignListCooperationTag(){
return cooperationService.listTag();
}
} }
package com.mmc.iuav.user.controller; package com.mmc.iuav.user.controller;
import com.mmc.iuav.group.Page;
import com.mmc.iuav.group.Update; import com.mmc.iuav.group.Update;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO; import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.vo.UserAccountVO; import com.mmc.iuav.user.model.vo.UserAccountVO;
import com.mmc.iuav.user.service.UserAccountService; import com.mmc.iuav.user.service.UserAccountService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
...@@ -25,6 +27,13 @@ public class UserAccountController extends BaseController{ ...@@ -25,6 +27,13 @@ public class UserAccountController extends BaseController{
@Autowired @Autowired
private UserAccountService userAccountService; private UserAccountService userAccountService;
@ApiOperation(value = "客户列表")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountVO.class) })
@PostMapping("listAppUser")
public ResultBody<UserAccountVO> listAppUser(@Validated(value = {Page.class})@RequestBody UserAccountQO userAccountQO){
return userAccountService.listAppUser(userAccountQO);
}
@ApiOperation(value = "获取用户信息") @ApiOperation(value = "获取用户信息")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountVO.class) }) @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountVO.class) })
@GetMapping("info") @GetMapping("info")
...@@ -61,4 +70,32 @@ public class UserAccountController extends BaseController{ ...@@ -61,4 +70,32 @@ public class UserAccountController extends BaseController{
return userAccountService.getUserPhoneNumber(this.getUserLoginInfoFromRedis(request).getUserAccountId(), code); return userAccountService.getUserPhoneNumber(this.getUserLoginInfoFromRedis(request).getUserAccountId(), code);
} }
@ApiOperation(value = "根据用户id查询用户信息", hidden = true)
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountSimpleDTO.class) })
@PostMapping("feignListUserAccountByIds")
public List<UserAccountSimpleDTO> feignListUserAccountByIds(@RequestBody List<Integer> ids){
return userAccountService.feignListUserAccountByIds(ids);
}
@ApiOperation(value = "根据用户ids上级推荐人信息", hidden = true)
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountSimpleDTO.class) })
@PostMapping("feignListRcdUserInfo")
public List<UserAccountSimpleDTO> feignListRcdUserInfo(@RequestBody List<Integer> userIds){
return userAccountService.feignListRcdUserInfo(userIds);
}
@ApiOperation(value = "查询上级推荐人id", hidden = true)
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = Integer.class) })
@GetMapping("feignGetSuperiorRef")
public Integer feignGetSuperiorRef(@RequestParam Integer userAccountId){
return userAccountService.feignGetSuperiorRef(userAccountId);
}
@ApiOperation(value = "查询上级推荐人信息", hidden = true)
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = UserAccountSimpleDTO.class) })
@GetMapping("feignGetUserRcdInfo")
public UserAccountSimpleDTO feignGetUserRcdInfo(@RequestParam Integer userAccountId){
return userAccountService.feignGetUserRcdInfo(userAccountId);
}
} }
package com.mmc.iuav.user.dao; package com.mmc.iuav.user.dao;
import com.mmc.iuav.user.entity.UserAccountDO; import com.mmc.iuav.user.entity.UserAccountDO;
import com.mmc.iuav.user.entity.UserRcdDO;
import com.mmc.iuav.user.model.qo.BUserAccountQO; import com.mmc.iuav.user.model.qo.BUserAccountQO;
import com.mmc.iuav.user.model.qo.UserAccountQO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -104,4 +107,46 @@ public interface UserServiceDao { ...@@ -104,4 +107,46 @@ public interface UserServiceDao {
* @return * @return
*/ */
UserAccountDO getUserAuthPwdInfo(Integer id); UserAccountDO getUserAuthPwdInfo(Integer id);
/**
* 根据id查询用户信息
* @param userIds
* @return
*/
List<UserAccountDO> listUserAccountByIds(@Param("userIds")List<Integer> userIds);
/**
* 获取用户推荐人信息
* @param userIds
* @return
*/
List<UserAccountDO> feignListRcdUserInfo(@Param("userIds") List<Integer> userIds);
/**
* 获取推荐人信息
* @param userAccountId
* @return
*/
UserAccountDO getUserRcdByAccountId(Integer userAccountId);
/**
* 获取用户推荐信息
* @param userAccountId
* @return
*/
UserRcdDO getUserRcdDO(Integer userAccountId);
/**
* 用户数量
* @param param
* @return
*/
int countListAppUser(UserAccountQO param);
/**
* 用户信息
* @param param
* @return
*/
List<UserAccountDO> listAppUser(UserAccountQO param);
} }
...@@ -46,6 +46,8 @@ public class UserAccountDO implements Serializable { ...@@ -46,6 +46,8 @@ public class UserAccountDO implements Serializable {
private Integer cooperationTagId; private Integer cooperationTagId;
private Integer companyAuthStatus; private Integer companyAuthStatus;
private String companyName;
private String tagName;
public UserAccountDO(UserAccountVO userAccountVO) { public UserAccountDO(UserAccountVO userAccountVO) {
this.id = userAccountVO.getId(); this.id = userAccountVO.getId();
...@@ -76,13 +78,14 @@ public class UserAccountDO implements Serializable { ...@@ -76,13 +78,14 @@ public class UserAccountDO implements Serializable {
public UserAccountVO buildUserAccountVO() { public UserAccountVO buildUserAccountVO() {
return UserAccountVO.builder().id(this.id).uid(this.uid).accountNo(this.accountNo).accountType(this.accountType).phoneNum(this.phoneNum).userName(this.userName).nickName(this.nickName) return UserAccountVO.builder().id(this.id).uid(this.uid).accountNo(this.accountNo).accountType(this.accountType).phoneNum(this.phoneNum).userName(this.userName).nickName(this.nickName)
.userImg(this.userImg).userSex(this.userSex).email(this.email).source(this.source).accountStatus(this.accountStatus).remark(this.remark).portType(this.portType) .userImg(this.userImg).userSex(this.userSex).email(this.email).source(this.source).accountStatus(this.accountStatus).remark(this.remark).portType(this.portType)
.createTime(this.createTime).companyAuthStatus(this.companyAuthStatus).cooperationTagId(this.cooperationTagId).build(); .createTime(this.createTime).companyAuthStatus(this.companyAuthStatus == null || this.companyAuthStatus != 1 ? 0 : 1).cooperationTagId(this.cooperationTagId).companyName(this.companyName)
.tagName(this.tagName).build();
} }
public UserAccountSimpleDTO buildUserAccountSimpleDTO() { public UserAccountSimpleDTO buildUserAccountSimpleDTO() {
return UserAccountSimpleDTO.builder().id(this.id).uid(this.uid).accountNo(this.accountNo).accountType(this.accountType).phoneNum(this.phoneNum).userName(this.userName).nickName(this.nickName) return UserAccountSimpleDTO.builder().id(this.id).uid(this.uid).accountNo(this.accountNo).accountType(this.accountType).phoneNum(this.phoneNum).userName(this.userName).nickName(this.nickName)
.userImg(this.userImg).userSex(this.userSex).email(this.email).source(this.source).accountStatus(this.accountStatus).portType(this.portType) .userImg(this.userImg).userSex(this.userSex).email(this.email).source(this.source).accountStatus(this.accountStatus).portType(this.portType)
.companyAuthStatus(this.companyAuthStatus == null || this.companyAuthStatus != 1 ? 0 : 1).cooperationTagId(this.cooperationTagId) .companyAuthStatus(this.companyAuthStatus == null || this.companyAuthStatus != 1 ? 0 : 1).cooperationTagId(this.cooperationTagId).companyName(this.companyName)
.build(); .build();
} }
} }
package com.mmc.iuav.user.entity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @author: zj
* @Date: 2023/6/6 17:13
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserRcdDO implements Serializable {
private static final long serialVersionUID = 5407029715338119583L;
private Integer id;
private Integer userAccountId;
private Integer rcdUserId;
private String remark;
private Date createTime;
}
package com.mmc.iuav.user.service; package com.mmc.iuav.user.service;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.vo.CooperationTagVO;
import com.mmc.iuav.user.model.vo.UserApplyTagVO; import com.mmc.iuav.user.model.vo.UserApplyTagVO;
import java.util.List;
/** /**
* @author: zj * @author: zj
* @Date: 2023/5/17 21:19 * @Date: 2023/5/17 21:19
...@@ -12,7 +15,7 @@ public interface CooperationService { ...@@ -12,7 +15,7 @@ public interface CooperationService {
* 加盟标签列表 * 加盟标签列表
* @return * @return
*/ */
ResultBody listTag(); List<CooperationTagVO> listTag();
/** /**
* 用户申请加盟 * 用户申请加盟
......
...@@ -5,6 +5,7 @@ import com.mmc.iuav.user.entity.UserAccountDO; ...@@ -5,6 +5,7 @@ import com.mmc.iuav.user.entity.UserAccountDO;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO; import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.qo.BUserAccountQO; import com.mmc.iuav.user.model.qo.BUserAccountQO;
import com.mmc.iuav.user.model.qo.LoginUserQO; import com.mmc.iuav.user.model.qo.LoginUserQO;
import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.vo.BUserAccountVO; import com.mmc.iuav.user.model.vo.BUserAccountVO;
import com.mmc.iuav.user.model.vo.UserAccountVO; import com.mmc.iuav.user.model.vo.UserAccountVO;
...@@ -123,4 +124,39 @@ public interface UserAccountService { ...@@ -123,4 +124,39 @@ public interface UserAccountService {
* @return * @return
*/ */
ResultBody getUserPhoneNumber(Integer id, String code); ResultBody getUserPhoneNumber(Integer id, String code);
/**
* 根据id获取用户信息
* @param ids
* @return
*/
List<UserAccountSimpleDTO> feignListUserAccountByIds(List<Integer> ids);
/**
* 根据用户id获取推荐人信息
* @param userIds
* @return
*/
List<UserAccountSimpleDTO> feignListRcdUserInfo(List<Integer> userIds);
/**
* 获取推荐人id
* @param userAccountId
* @return
*/
Integer feignGetSuperiorRef(Integer userAccountId);
/**
* 获取推荐人信息
* @param userAccountId
* @return
*/
UserAccountSimpleDTO feignGetUserRcdInfo(Integer userAccountId);
/**
* 用户列表
* @param userAccountQO
* @return
*/
ResultBody listAppUser(UserAccountQO userAccountQO);
} }
...@@ -9,6 +9,7 @@ import com.mmc.iuav.http.BizException; ...@@ -9,6 +9,7 @@ import com.mmc.iuav.http.BizException;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.response.ResultEnum; import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.auth.PwdUtil; import com.mmc.iuav.user.auth.PwdUtil;
import com.mmc.iuav.user.client.PayClient;
import com.mmc.iuav.user.constant.WxConstant; import com.mmc.iuav.user.constant.WxConstant;
import com.mmc.iuav.user.dao.CompanyAuthDao; import com.mmc.iuav.user.dao.CompanyAuthDao;
import com.mmc.iuav.user.entity.CompanyAuthDO; import com.mmc.iuav.user.entity.CompanyAuthDO;
...@@ -27,6 +28,7 @@ import org.apache.commons.lang.StringUtils; ...@@ -27,6 +28,7 @@ import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.HashMap; import java.util.HashMap;
...@@ -53,6 +55,10 @@ public class AuthServiceImpl implements AuthService { ...@@ -53,6 +55,10 @@ public class AuthServiceImpl implements AuthService {
@Autowired @Autowired
private CompanyAuthDao companyAuthDao; private CompanyAuthDao companyAuthDao;
@Autowired
private PayClient payClient;
@Transactional
@Override @Override
public ResultBody appletLogin(WxLoginVO wxLoginVO) { public ResultBody appletLogin(WxLoginVO wxLoginVO) {
String unionId; String unionId;
...@@ -106,6 +112,7 @@ public class AuthServiceImpl implements AuthService { ...@@ -106,6 +112,7 @@ public class AuthServiceImpl implements AuthService {
userAccountDO.setSource(wxLoginVO.getSource()); userAccountDO.setSource(wxLoginVO.getSource());
userAccountService.insertUserAccount(userAccountDO); userAccountService.insertUserAccount(userAccountDO);
userAccountVO = userAccountDO.buildUserAccountVO(); userAccountVO = userAccountDO.buildUserAccountVO();
payClient.createWallet(userAccountDO.getId());
}else { }else {
uid = userAccountVO.getUid(); uid = userAccountVO.getUid();
CompanyAuthDO companyAuthDO = companyAuthDao.getCompanyAuth(userAccountVO.getId()); CompanyAuthDO companyAuthDO = companyAuthDao.getCompanyAuth(userAccountVO.getId());
...@@ -134,7 +141,6 @@ public class AuthServiceImpl implements AuthService { ...@@ -134,7 +141,6 @@ public class AuthServiceImpl implements AuthService {
public ResultBody backEndLogin(LoginUserQO param) { public ResultBody backEndLogin(LoginUserQO param) {
//查询用户信息 //查询用户信息
UserAccountDO user = userAccountService.getUserLoginInfo(param.getAccountNo(), param.getPassWord()); UserAccountDO user = userAccountService.getUserLoginInfo(param.getAccountNo(), param.getPassWord());
System.out.println("login user:---------------->" + user.toString() );
if (user == null) { if (user == null) {
return ResultBody.error(ResultEnum.LOGIN_ACCOUNT_NOT_EXIT_ERROR); return ResultBody.error(ResultEnum.LOGIN_ACCOUNT_NOT_EXIT_ERROR);
} }
...@@ -157,7 +163,7 @@ public class AuthServiceImpl implements AuthService { ...@@ -157,7 +163,7 @@ public class AuthServiceImpl implements AuthService {
map.put(JwtConstant.TOKEN_TYPE, JwtConstant.M_TOKEN); map.put(JwtConstant.TOKEN_TYPE, JwtConstant.M_TOKEN);
String token = JwtUtil.createJwt(map); String token = JwtUtil.createJwt(map);
LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(user.getId()).accountNo(user.getAccountNo()).uid(user.getUid()) LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(user.getId()).accountNo(user.getAccountNo()).uid(user.getUid())
.userName(user.getUserName()).nickName(user.getNickName()).phoneNum(user.getPhoneNum()).build(); .userName(user.getUserName()).nickName(user.getNickName()).phoneNum(user.getPhoneNum()).portType(user.getPortType()).build();
stringRedisTemplate.opsForValue().set( stringRedisTemplate.opsForValue().set(
token, JSONObject.toJSONString(loginSuccessDTO), token, JSONObject.toJSONString(loginSuccessDTO),
JwtConstant.EXPIRATION, TimeUnit.MILLISECONDS); JwtConstant.EXPIRATION, TimeUnit.MILLISECONDS);
......
...@@ -30,10 +30,10 @@ public class CooperationServiceImpl implements CooperationService { ...@@ -30,10 +30,10 @@ public class CooperationServiceImpl implements CooperationService {
private CompanyAuthDao companyAuthDao; private CompanyAuthDao companyAuthDao;
@Override @Override
public ResultBody listTag() { public List<CooperationTagVO> listTag() {
List<CooperationTagDO> list = cooperationDao.listTags(); List<CooperationTagDO> list = cooperationDao.listTags();
List<CooperationTagVO> resList = list.stream().map(CooperationTagDO::buildCooperationTagVO).collect(Collectors.toList()); List<CooperationTagVO> resList = list.stream().map(CooperationTagDO::buildCooperationTagVO).collect(Collectors.toList());
return ResultBody.success(resList); return resList;
} }
@Override @Override
......
...@@ -7,10 +7,13 @@ import com.mmc.iuav.response.ResultEnum; ...@@ -7,10 +7,13 @@ import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.auth.PwdUtil; import com.mmc.iuav.user.auth.PwdUtil;
import com.mmc.iuav.user.dao.CooperationDao; import com.mmc.iuav.user.dao.CooperationDao;
import com.mmc.iuav.user.dao.UserServiceDao; import com.mmc.iuav.user.dao.UserServiceDao;
import com.mmc.iuav.user.entity.CooperationTagDO;
import com.mmc.iuav.user.entity.UserAccountDO; import com.mmc.iuav.user.entity.UserAccountDO;
import com.mmc.iuav.user.entity.UserRcdDO;
import com.mmc.iuav.user.entity.UserTagDO; import com.mmc.iuav.user.entity.UserTagDO;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO; import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.qo.BUserAccountQO; import com.mmc.iuav.user.model.qo.BUserAccountQO;
import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.vo.BUserAccountVO; import com.mmc.iuav.user.model.vo.BUserAccountVO;
import com.mmc.iuav.user.model.vo.CompanyAuthVO; import com.mmc.iuav.user.model.vo.CompanyAuthVO;
import com.mmc.iuav.user.model.vo.UserAccountVO; import com.mmc.iuav.user.model.vo.UserAccountVO;
...@@ -20,9 +23,12 @@ import com.mmc.iuav.user.service.WxService; ...@@ -20,9 +23,12 @@ import com.mmc.iuav.user.service.WxService;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -229,11 +235,76 @@ public class UserAccountServiceImpl implements UserAccountService { ...@@ -229,11 +235,76 @@ public class UserAccountServiceImpl implements UserAccountService {
if (StringUtils.isBlank(userPhoneNumber)){ if (StringUtils.isBlank(userPhoneNumber)){
return ResultBody.error(ResultEnum.AUTH_PHONE_NUMBER_ERROR); return ResultBody.error(ResultEnum.AUTH_PHONE_NUMBER_ERROR);
} }
System.out.println("userPhoneNumber:"+userPhoneNumber);
UserAccountDO userAccount = new UserAccountDO(); UserAccountDO userAccount = new UserAccountDO();
userAccount.setId(id); userAccount.setId(id);
userAccount.setPhoneNum(userPhoneNumber); userAccount.setPhoneNum(userPhoneNumber);
userServiceDao.update(userAccount); userServiceDao.update(userAccount);
return ResultBody.success(); return ResultBody.success();
} }
@Override
public List<UserAccountSimpleDTO> feignListUserAccountByIds(List<Integer> ids) {
List<UserAccountDO> userAccountDOS = userServiceDao.listUserAccountByIds(ids);
if (!CollectionUtils.isEmpty(userAccountDOS)){
List<UserAccountSimpleDTO> userAccountSimpleDTOS = userAccountDOS.stream().map(UserAccountDO::buildUserAccountSimpleDTO).collect(Collectors.toList());
return userAccountSimpleDTOS;
}
return null;
}
@Override
public List<UserAccountSimpleDTO> feignListRcdUserInfo(List<Integer> userIds) {
List<UserAccountDO> userAccountDOS = userServiceDao.feignListRcdUserInfo(userIds);
if (!CollectionUtils.isEmpty(userAccountDOS)){
List<UserAccountSimpleDTO> userAccountSimpleDTOS = userAccountDOS.stream().map(UserAccountDO::buildUserAccountSimpleDTO).collect(Collectors.toList());
return userAccountSimpleDTOS;
}
return null;
}
@Override
public Integer feignGetSuperiorRef(Integer userAccountId) {
UserRcdDO userRcdDO = userServiceDao.getUserRcdDO(userAccountId);
if (userRcdDO != null){
return userRcdDO.getId();
}
return null;
}
@Override
public UserAccountSimpleDTO feignGetUserRcdInfo(Integer userAccountId) {
UserAccountDO rcdAccountDO = userServiceDao.getUserRcdByAccountId(userAccountId);
if (rcdAccountDO != null){
return rcdAccountDO.buildUserAccountSimpleDTO();
}
return null;
}
@Override
public ResultBody listAppUser(UserAccountQO param) {
int count = userServiceDao.countListAppUser(param);
if (count == 0){
return ResultBody.success(PageResult.buildPage(param.getPageNo(), param.getPageSize(), count));
}
int pageNo = param.getPageNo();
param.buildCurrentPage();
List<UserAccountDO> userAccountDOList = userServiceDao.listAppUser(param);
List<UserAccountDO> res = buildTagInfo(userAccountDOList);
List<UserAccountVO> userAccountVOS = res.stream().map(UserAccountDO::buildUserAccountVO).collect(Collectors.toList());
return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, userAccountVOS));
}
private List<UserAccountDO> buildTagInfo(List<UserAccountDO> userAccountDOList) {
List<CooperationTagDO> cooperationTagDOS = cooperationDao.listTags();
Map<Integer, CooperationTagDO> cooperationTagDOMap = cooperationTagDOS.stream().collect(Collectors.toMap(CooperationTagDO::getId, d -> d, (k1, k2) -> k2));
for (UserAccountDO userAccountDO : userAccountDOList) {
CooperationTagDO cooperationTagDO = cooperationTagDOMap.get(userAccountDO.getCooperationTagId());
if (cooperationTagDO != null){
userAccountDO.setTagName(cooperationTagDO.getTagName());
}
}
return userAccountDOList;
}
} }
...@@ -59,4 +59,8 @@ third-party: ...@@ -59,4 +59,8 @@ third-party:
app-code: 524b1864a88f47458c1061bae3811570 app-code: 524b1864a88f47458c1061bae3811570
qcc: qcc:
app-key: 5015e664848d406ab1ca4b505c3da803 app-key: 5015e664848d406ab1ca4b505c3da803
secret-key: 7C4DB8CCECC148175E46392CC0A1B410 secret-key: 7C4DB8CCECC148175E46392CC0A1B410
\ No newline at end of file
iuav:
pay:
uri: http://payment-svc:8088
\ No newline at end of file
...@@ -31,4 +31,8 @@ third-party: ...@@ -31,4 +31,8 @@ third-party:
app-code: 524b1864a88f47458c1061bae3811570 app-code: 524b1864a88f47458c1061bae3811570
qcc: qcc:
app-key: 5015e664848d406ab1ca4b505c3da803 app-key: 5015e664848d406ab1ca4b505c3da803
secret-key: 7C4DB8CCECC148175E46392CC0A1B410 secret-key: 7C4DB8CCECC148175E46392CC0A1B410
\ No newline at end of file
iuav:
pay:
uri: http://127.0.0.1:8088
\ No newline at end of file
...@@ -59,4 +59,8 @@ third-party: ...@@ -59,4 +59,8 @@ third-party:
app-code: 524b1864a88f47458c1061bae3811570 app-code: 524b1864a88f47458c1061bae3811570
qcc: qcc:
app-key: 5015e664848d406ab1ca4b505c3da803 app-key: 5015e664848d406ab1ca4b505c3da803
secret-key: 7C4DB8CCECC148175E46392CC0A1B410 secret-key: 7C4DB8CCECC148175E46392CC0A1B410
\ No newline at end of file
iuav:
pay:
uri: http://payment-svc:8088
\ No newline at end of file
...@@ -10,6 +10,8 @@ spring: ...@@ -10,6 +10,8 @@ spring:
jackson: jackson:
date-format: yyyy-MM-dd HH:mm:ss date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8 time-zone: GMT+8
main:
banner-mode: off
#mybatis #mybatis
mybatis: mybatis:
...@@ -18,6 +20,9 @@ mybatis: ...@@ -18,6 +20,9 @@ mybatis:
type-aliases-package: com.mmc.iuav.user type-aliases-package: com.mmc.iuav.user
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true
logging:
file:
name: "/var/log/app/${spring.application.name}.log}"
--- ---
spring: spring:
......
...@@ -125,7 +125,8 @@ ...@@ -125,7 +125,8 @@
ua.pass_word, ua.pass_word,
ua.account_status, ua.account_status,
ua.account_type, ua.account_type,
ua.user_name ua.user_name,
ua.port_type
from user_account ua from user_account ua
where ua.is_deleted = 0 where ua.is_deleted = 0
and BINARY ua.account_no = #{accountNo} and BINARY ua.account_no = #{accountNo}
...@@ -213,4 +214,104 @@ ...@@ -213,4 +214,104 @@
and id = and id =
#{id} #{id}
</select> </select>
<select id="listUserAccountByIds" resultType="com.mmc.iuav.user.entity.UserAccountDO">
select ua.id, ua.account_type, ua.account_no, ua.uid, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id, ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.is_deleted as deleted, ua.create_time, ua.update_time, ut.cooperation_tag_id, ca.auth_status as companyAuthStatus, ca.company_name
from user_account ua left join user_tag ut on ua.id = ut.user_account_id left join company_auth ca on ua.id = ca.user_account_id
where ua.is_deleted = 0
<if test=" userIds != null ">
<foreach collection="userIds" item="id" open="and ua.id in (" close=")" separator=",">
#{id}
</foreach>
</if>
</select>
<select id="feignListRcdUserInfo" resultType="com.mmc.iuav.user.entity.UserAccountDO">
select ua.id, ua.account_type, ua.account_no, ua.uid, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id, ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.is_deleted as deleted, ua.create_time, ua.update_time, ut.cooperation_tag_id, ca.auth_status as companyAuthStatus, ca.company_name
from user_rcd ur inner join user_account ua on ua.id = ur.rcd_user_id left join user_tag ut on ua.id = ut.user_account_id left join company_auth ca on ua.id = ca.user_account_id
where ua.is_deleted = 0
<if test=" userIds != null ">
<foreach collection="userIds" item="id" open="and ur.user_account_id in (" close=")" separator=",">
#{id}
</foreach>
</if>
</select>
<select id="getUserRcdByAccountId" resultType="com.mmc.iuav.user.entity.UserAccountDO">
select ua.id, ua.account_type, ua.account_no, ua.uid, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id, ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.is_deleted as deleted, ua.create_time, ua.update_time, ut.cooperation_tag_id, ca.auth_status as companyAuthStatus, ca.company_name
from user_rcd ur inner join user_account ua on ua.id = ur.rcd_user_id left join user_tag ut on ua.id = ut.user_account_id left join company_auth ca on ua.id = ca.user_account_id
where ua.is_deleted = 0 and ur.user_account_id = #{userAccountId}
</select>
<select id="getUserRcdDO" resultType="com.mmc.iuav.user.entity.UserRcdDO">
select id, user_account_id,rcd_user_id from user_rcd where user_account_id = #{userAccountId}
</select>
<select id="countListAppUser" resultType="int" parameterType="com.mmc.iuav.user.model.qo.UserAccountQO">
SELECT
count(*)
FROM
user_account ua
LEFT JOIN company_auth ca ON ua.id = ca.user_account_id
WHERE
ua.is_deleted = 0 and ua.port_type = 100
<if test="phoneNum != null and phoneNum != '' ">
and ( ua.phone_num like CONCAT("%",#{phoneNum},"%") )
</if>
<if test="companyAuthStatus != null">
AND IFNULL(ca.auth_status, 0) = #{companyAuthStatus}
</if>
<if test="startTime != null ">
AND ua.create_time >= #{startTime}
</if>
<if test="endTime != null ">
and #{endTime} >= ua.create_time
</if>
<if test="source != null ">
and ua.source = #{source}
</if>
<if test="keyword != null and keyword != '' ">
and (
ua.user_name like CONCAT("%",#{keyword},"%")
or ua.nick_name like CONCAT("%",#{keyword},"%")
or ua.uid like CONCAT("%",#{keyword},"%")
)
</if>
</select>
<select id="listAppUser" resultType="com.mmc.iuav.user.entity.UserAccountDO" parameterType="com.mmc.iuav.user.model.qo.UserAccountQO">
select ua.id, ua.account_type, ua.account_no, ua.uid, ua.phone_num, ua.user_name, ua.nick_name, ua.user_img, ua.open_id, ua.union_id, ua.user_sex, ua.email, ua.source, ua.account_status, ua.remark,
ua.port_type, ua.is_deleted as deleted, ua.create_time, ua.update_time, ut.cooperation_tag_id, IFNULL(ca.auth_status, 0) as companyAuthStatus, ca.company_name
from user_account ua left join user_tag ut on ua.id = ut.user_account_id left join company_auth ca on ua.id = ca.user_account_id
where
ua.is_deleted = 0 and ua.port_type = 100
<if test="phoneNum != null and phoneNum != '' ">
and ( ua.phone_num like CONCAT("%",#{phoneNum},"%") )
</if>
<if test="companyAuthStatus != null">
AND IFNULL(ca.auth_status, 0) = #{companyAuthStatus}
</if>
<if test="startTime != null ">
AND ua.create_time >= #{startTime}
</if>
<if test="endTime != null ">
and #{endTime} >= ua.create_time
</if>
<if test="source != null ">
and ua.source = #{source}
</if>
<if test="keyword != null and keyword != '' ">
and (
ua.user_name like CONCAT("%",#{keyword},"%")
or ua.nick_name like CONCAT("%",#{keyword},"%")
or ua.uid like CONCAT("%",#{keyword},"%")
)
</if>
order by ua.create_time desc
limit #{pageNo}, #{pageSize}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -9,9 +9,12 @@ data-filter: ...@@ -9,9 +9,12 @@ data-filter:
- /userapp/auth/backEndLogin - /userapp/auth/backEndLogin
- /userapp/auth/testAppletLogin - /userapp/auth/testAppletLogin
- /userapp/auth/appletLogin - /userapp/auth/appletLogin
- /userapp/auth/backEndLogin
- /userapp/cooperation/listTag - /userapp/cooperation/listTag
- /userapp/cooperation/feignListCooperationTag
- /userapp/cooperation/getTagById - /userapp/cooperation/getTagById
- /userapp/temp-auth/getLoginInfo - /userapp/temp-auth/getLoginInfo
- /userapp/wx/getAppletQRCode - /userapp/wx/getAppletQRCode
- /userapp/wx/wxSendMessage - /userapp/wx/wxSendMessage
- /userapp/user-account/feignListUserAccountIds - /userapp/user-account/feignListUserAccountIds
- /userapp/back-user/listTest
...@@ -18,6 +18,9 @@ spec: ...@@ -18,6 +18,9 @@ spec:
containers: containers:
- name: cms - name: cms
image: REGISTRY/NAMESPACE/IMAGE:TAG image: REGISTRY/NAMESPACE/IMAGE:TAG
volumeMounts:
- name: log-of-app
mountPath: /var/log/app
resources: resources:
limits: limits:
memory: 1024Mi memory: 1024Mi
...@@ -29,4 +32,8 @@ spec: ...@@ -29,4 +32,8 @@ spec:
valueFrom: valueFrom:
configMapKeyRef: configMapKeyRef:
name: cms-map name: cms-map
key: SPRING_PROFILES_ACTIVE key: SPRING_PROFILES_ACTIVE
\ No newline at end of file volumes:
- name: log-of-app
hostPath:
path: /var/log/app
\ No newline at end of file
...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: b90d96ef7a2c68fe49e89e0462cba4d37baf7716 newTag: 1892dbcdb20f1882a6eda0f2d3f299d03df97df9
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论