提交 1ec6d2c9 作者: xiaowang

Merge branch 'develop'

......@@ -20,6 +20,7 @@ import java.io.Serializable;
public class LoginSuccessDTO implements Serializable {
private static final long serialVersionUID = -1200834589953161925L;
private String token;
private String openId;
private Integer userAccountId;
private String accountNo;
private Integer portType;
......
......@@ -8,6 +8,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
......@@ -54,4 +55,10 @@ public class UserAccountSimpleDTO implements Serializable {
private String tagName;
@ApiModelProperty(value = "用户合作标签")
private List<CooperationTagVO> cooperationTagVOS;
}
\ No newline at end of file
@ApiModelProperty(value = "个人简介")
private String briefIntroduction;
@ApiModelProperty(value = "封面背景图")
private String coverPicture;
@ApiModelProperty(value = "地区")
private String region;
}
package com.mmc.iuav.user.model.dto.data;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author LW
* @date 2023/9/16 14:15
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ProductReportDTO {
@ApiModelProperty(value = "入驻商家总数")
private Integer joinStoreCount;
@ApiModelProperty(value = "品牌商")
private Integer brandStore;
@ApiModelProperty(value = "维修商")
private Integer repairStore;
@ApiModelProperty(value = "培训机构")
private Integer trainingInstitution;
@ApiModelProperty(value = "租赁商")
private Integer leaseStore;
@ApiModelProperty(value = "服务商")
private Integer serviceStore;
@ApiModelProperty(value = "销售商品")
private Integer saleProduct;
@ApiModelProperty(value = "出租商品")
private Integer leaseProduct;
@ApiModelProperty(value = "服务商品")
private Integer serviceProduct;
@ApiModelProperty(value = "在线课程")
private Integer onlineCourse;
}
package com.mmc.iuav.user.model.dto.data;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author LW
* @date 2023/9/16 14:15
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class UserReportDTO {
@ApiModelProperty(value = "用户数量")
private Integer userCount;
@ApiModelProperty(value = "实名认证数量")
private Integer realNameCount;
@ApiModelProperty(value = "飞手认证数量")
private Integer dronePilotCount;
@ApiModelProperty(value = "昨日新增用户数量")
private Integer yesterdayAddUserCount;
@ApiModelProperty(value = "昨日活跃用户数量")
private Integer yesterdayActiveUserCount;
}
package com.mmc.iuav.user.model.qo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @Author small
* @Date 2023/9/14 20:03
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserMessageQO {
@ApiModelProperty(value = "用户id")
private Integer id;
@ApiModelProperty(value = "微信头像",example = "http://")
private String userImg;
@ApiModelProperty(value = "封面图片",example = "http://")
private String coverPicture;
@ApiModelProperty(value = "微信昵称",example = "小红花")
private String nickName;
@ApiModelProperty(value = "地区最下级id",example = "130100")
private String districtChildId;
@ApiModelProperty(value = "个人简介",example = "航拍多年")
private String briefIntroduction;
}
......@@ -10,6 +10,7 @@ import lombok.NoArgsConstructor;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
......@@ -32,6 +33,8 @@ public class UserAccountVO implements Serializable {
private String uid;
@ApiModelProperty(value = "手机号")
private String phoneNum;
@ApiModelProperty(value = "openId")
private String openId;
@ApiModelProperty(value = "用户名称")
private String userName;
@ApiModelProperty(value = "用户昵称")
......@@ -77,4 +80,13 @@ public class UserAccountVO implements Serializable {
private Integer xzAuthStatus;
@ApiModelProperty(value = "是否关注公众号")
private Integer subStatus;
@ApiModelProperty(value = "地区")
private String region;
@ApiModelProperty(value = "个人简介")
private String briefIntroduction;
@ApiModelProperty(value = "封面背景图")
private String coverPicture;
}
package com.mmc.iuav.user.model.vo.data;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* @author:lw Date:2023/9/16
* time:11:02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ActiveUserCountVO implements Serializable {
private static final long serialVersionUID = 7301019973858223718L;
private Integer activeUserCount;
private Date activeDate;
}
......@@ -35,6 +35,12 @@
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!-- mybatis驱动&Druid数据源-start -->
<dependency>
<groupId>com.alibaba</groupId>
......
......@@ -42,7 +42,7 @@ public class AuthHandler {
map.put(JwtConstant.USER_ACCOUNT_ID, userAccountVO.getId());
map.put(JwtConstant.TOKEN_TYPE, JwtConstant.IUAV_TOKEN);
String token = JwtUtil.createJwt(map);
LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(userAccountVO.getId()).uid(userAccountVO.getId() + "")
LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).openId(userAccountVO.getOpenId()).userAccountId(userAccountVO.getId()).uid(userAccountVO.getId() + "")
.userName(userAccountVO.getUserName()).nickName(userAccountVO.getNickName()).phoneNum(userAccountVO.getPhoneNum()).portType(UserTypeEnums.APP.getType()).build();
stringRedisTemplate.opsForValue().set(
token, JSONObject.toJSONString(loginSuccessDTO),
......
package com.mmc.iuav.user.config;
import java.lang.annotation.*;
/**
* @author 23214
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface PreventDuplication {
String value() default "value";
long expireSeconds() default 10;
}
package com.mmc.iuav.user.config;
import cn.hutool.core.lang.Assert;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.iuav.response.ResultBody;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.script.DigestUtils;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* @author 23214
*/
@Aspect
@Component
@Slf4j
public class PreventDuplicationAspect {
@Autowired
private RedisTemplate redisTemplate;
@Pointcut("@annotation(com.mmc.iuav.user.config.PreventDuplication)")
public void preventDuplication() {
}
// 使用@Around注解定义一个环绕通知,拦截带有@PreventDuplication注解的方法
@Around("preventDuplication()")
public Object before(ProceedingJoinPoint joinPoint) {
// 获取当前请求的属性
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
// 获取当前请求
HttpServletRequest request = attributes.getRequest();
// 确保请求不为空
Assert.notNull(request, "request cannot be null.");
// 获取被拦截方法的签名,并转换为Method对象
Method method = ((MethodSignature) joinPoint.getSignature()).getMethod();
// 获取被拦截方法上的@PreventDuplication注解
PreventDuplication annotation = method.getAnnotation(PreventDuplication.class);
// 从请求头中获取token
String token = request.getHeader("token");
// 构造Redis的键,由前缀、token和方法签名组成
String redisKey = "prevent_duplication_prefix".concat(token).concat(getMethodSign(method, joinPoint.getArgs()));
// 构造Redis的值,由键、注解的值和一个固定字符串组成
String redisValue = redisKey.concat(annotation.value()).concat("submit duplication");
// 检查Redis中是否已经存在该键
if (!redisTemplate.hasKey(redisKey)) {
// 如果不存在,则将键值对存入Redis,并设置过期时间
redisTemplate.opsForValue().set(redisKey, redisValue, annotation.expireSeconds(), TimeUnit.SECONDS);
try {
// 执行被拦截的方法
return joinPoint.proceed();
} catch (Throwable throwable) {
// 如果执行过程中发生异常,则从Redis中删除该键值对,并抛出异常
redisTemplate.delete(redisKey);
return ResultBody.error(throwable.getMessage());
}
} else {
// 如果已经存在,则返回错误信息,防止重复提交
return ResultBody.error("请勿重复提交");
}
}
// 定义一个私有方法,用于获取方法的签名,包括方法名和参数列表
private String getMethodSign(Method method, Object... args) {
StringBuilder sb = new StringBuilder(method.toString());
for (Object arg : args) {
sb.append(toString(arg));
}
return DigestUtils.sha1DigestAsHex(sb.toString());
}
// 定义一个私有方法,用于将参数转换为字符串
private String toString(Object arg) {
if (Objects.isNull(arg)) {
return "null";
}
if (arg instanceof Number) {
return arg.toString();
}
return JSONObject.toJSONString(arg);
}
}
......@@ -5,6 +5,7 @@ import com.mmc.iuav.group.Update;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.qo.UserMessageQO;
import com.mmc.iuav.user.model.qo.UserRcdQO;
import com.mmc.iuav.user.model.vo.UserAccountVO;
import com.mmc.iuav.user.service.UserAccountService;
......@@ -49,7 +50,7 @@ public class UserAccountController extends BaseController {
return userAccountService.update(userAccountVO);
}
@ApiOperation(value = "获取用户基本信息", hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UserAccountSimpleDTO.class)})
@GetMapping("feignGetUserSimpleInfo")
......@@ -143,4 +144,39 @@ public class UserAccountController extends BaseController {
return userAccountService.getUserAccountByPhoneNum(phoneNum);
}
@ApiOperation(value = "获取修改手机获取验证码")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("getVerifyCode")
public ResultBody getVerifyCode(@RequestParam(value = "userAccountId") Integer userAccountId,
@RequestParam(value = "phoneNum") String phoneNum) {
return userAccountService.getVerifyCode(userAccountId, phoneNum);
}
@ApiOperation(value = "修改用户手机号")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("updatePhoneNum")
public ResultBody updatePhoneNum(@RequestParam(value = "userAccountId") Integer userAccountId,
@RequestParam(value = "verifyCode") String verifyCode) {
return userAccountService.updatePhoneNum(userAccountId, verifyCode);
}
@ApiOperation(value = "new_修改用户信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("/appUpdateUser")
public ResultBody appUpdateUser(@RequestBody UserMessageQO userMessageQO){
return userAccountService.appUpdateUser(userMessageQO);
}
@ApiOperation(value = "内部使用获取用户信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UserAccountVO.class)})
@GetMapping("interiorInfo")
public ResultBody<UserAccountVO> interiorInfo(HttpServletRequest request,Integer userAccountId) {
return ResultBody.success(userAccountService.getUserAccountById(userAccountId));
}
}
package com.mmc.iuav.user.controller.data;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.data.ProductReportDTO;
import com.mmc.iuav.user.model.dto.data.UserReportDTO;
import com.mmc.iuav.user.service.data.UserReportService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* @Author LW
* @date 2023/9/16 11:25
* 概要:
*/
@Api(tags = "云享飞发数据看板")
@RequestMapping("/user/report")
@RestController
public class UserReportController {
@Autowired
private UserReportService userReportService;
@ApiOperation(value = "获取用户报表数据")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = UserReportDTO.class)})
@GetMapping("/getUserReportData")
public ResultBody<UserReportDTO> getUserReportData(@ApiParam(value = "(预留字段暂时不传值)根据时间查询(暂未实现)") @RequestParam(required = false) String date) {
return userReportService.getUserReportData(date);
}
@ApiOperation(value = "获取入驻商家数量")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductReportDTO.class)})
@GetMapping("/getJoinStoreNumber")
@ApiIgnore
public ProductReportDTO getJoinStoreNumber() {
return userReportService.getJoinStoreNumber();
}
}
......@@ -54,8 +54,9 @@ public class ContractController extends BaseController {
@GetMapping("/stamp")
public ResultBody stamp(@ApiParam(value = "合同编号") @RequestParam(value = "contractId") String contractId,
@ApiParam(value = "小程序页面跳转地址") @RequestParam(value = "pages", required = false) String pages,
HttpServletRequest request, @ApiParam(value = "端口:0小程序 1后台") @RequestParam(value = "port") Integer port) {
return contractService.stamp(contractId, this.getUserLoginInfoFromRedis(request), pages, port);
HttpServletRequest request, @ApiParam(value = "端口:0小程序 1后台") @RequestParam(value = "port") Integer port,
@ApiParam(value = "认证类型") @RequestParam(value = "customerId", required = false) String customerId) {
return contractService.stamp(contractId, this.getUserLoginInfoFromRedis(request), pages, port, customerId);
}
@ApiOperation(value = "异步处理手动签署信息")
......
......@@ -41,7 +41,7 @@ public class PayWalletController extends BaseController {
@GetMapping("getPayWalletInfo")
public ResultBody<PayWalletDTO> getPayWalletInfo(
@ApiParam(value = "用户userAccountId", required = true) @RequestParam Integer userAccountId) {
return ResultBody.success(payWalletService.getPayWalletInfo(userAccountId));
return payWalletService.getPayWalletInfo(userAccountId);
}
@ApiOperation(value = "feign-云享金充值增加金额")
......
......@@ -141,4 +141,8 @@ public interface CooperationDao {
int countListCompanyInfoByCoopId(Integer coopId);
List<CompanyInfoDO> listCompanyInfoByCoopId(Integer coopId, Double lon, Double lat, Integer pageNo, Integer pageSize);
int getJoinStoreCount();
int getStoreCountByType(int type);
}
......@@ -33,4 +33,6 @@ public interface RealNameAuthDao {
RealNameAuthDO userDetail(Integer userAccountId);
void updateRealNameAuthRemark(Integer id, String remark);
int getRealNameAuthCount();
}
......@@ -2,8 +2,10 @@ package com.mmc.iuav.user.dao;
import com.mmc.iuav.user.entity.UserAccountDO;
import com.mmc.iuav.user.entity.UserRcdDO;
import com.mmc.iuav.user.entity.data.ActiveUserCountDO;
import com.mmc.iuav.user.entity.fdd.UserFddDO;
import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.qo.UserMessageQO;
import com.mmc.iuav.user.model.qo.UserRcdQO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -170,4 +172,25 @@ public interface UserServiceDao {
UserAccountDO getUserAccountInfoByOpenId(String openid);
List<UserFddDO> listUserFddInfo(@Param(value = "unionId") String unionId, @Param(value = "openid") String openid);
int getUsableUserCount();
int getYesterdayAddUserCount();
void insertActiveUserCount(ActiveUserCountDO activeUserCountDO);
ActiveUserCountDO getActiveUserCountByDayNum();
Integer countPhoneNum(String phoneNum);
int countPhoneNums(String phoneNum, Integer userAccountId);
void updateAccountPhone(Integer userAccountId, String phoneNum);
void appUpdateUser(UserMessageQO userMessageQO);
int selectUserAccount(UserMessageQO userMessageQO);
String getDistrictChild(Integer districtChildId);
}
package com.mmc.iuav.user.dao.data;
import org.apache.ibatis.annotations.Mapper;
/**
* @Author LW
* @date 2023/9/16 11:25
* 概要:
*/
@Mapper
public interface UserReportDao {
}
......@@ -63,4 +63,6 @@ public interface PilotCertificationDao {
int selectFirstApprove(Integer id);
int getDronePilotCount();
}
......@@ -23,6 +23,10 @@ public interface UserFddAuthDao {
UserFddDO getAppUserFddInfo(String unionId);
void updatePersonCertStatus(String customerId, String status);
UserFddDO getAppUserFddInfoByCustomerId(String customerId);
// void insertAppUserFdd(UserFddDO appUserFddDO1);
//
// AppEVerifyInfoDO getCompanyVerifyUrl(String customerId);
......
......@@ -4,12 +4,14 @@ import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.vo.BUserAccountVO;
import com.mmc.iuav.user.model.vo.TopInviteVO;
import com.mmc.iuav.user.model.vo.UserAccountVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.CollectionUtils;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
......@@ -79,6 +81,16 @@ public class UserAccountDO implements Serializable {
private Integer totalPoints;
@ApiModelProperty(value = "地区")
private String region;
@ApiModelProperty(value = "个人简介")
private String briefIntroduction;
@ApiModelProperty(value = "封面背景图")
private String coverPicture;
@ApiModelProperty(value = "地区id")
private Integer districtChildId;
public UserAccountDO(UserAccountVO userAccountVO) {
this.id = userAccountVO.getId();
this.phoneNum = userAccountVO.getPhoneNum();
......@@ -105,7 +117,7 @@ public class UserAccountDO implements Serializable {
}
public UserAccountVO buildUserAccountVO() {
return UserAccountVO.builder().id(this.id).uid(this.id + "").phoneNum(this.phoneNum).userName(this.userName).nickName(this.nickName).userImg(this.userImg)
return UserAccountVO.builder().id(this.id).uid(this.id + "").phoneNum(this.phoneNum).userName(this.userName).nickName(this.nickName).userImg(this.userImg).openId(this.openId)
.userSex(this.userSex).email(this.email).source(this.source).accountStatus(this.accountStatus).remark(this.remark).portType(this.portType).createTime(this.createTime)
.companyAuthStatus(this.companyName == null ? 0 : 1).companyName(this.companyName)
.inviteCount(this.inviteCount)
......@@ -116,6 +128,9 @@ public class UserAccountDO implements Serializable {
.xzAuthStatus(this.xzAuthStatus)
.auditStatus(this.auditStatus)
.totalPoints(this.totalPoints)
.region(this.region)
.briefIntroduction(this.briefIntroduction)
.coverPicture(this.coverPicture)
.build();
}
......@@ -123,6 +138,9 @@ public class UserAccountDO implements Serializable {
return UserAccountSimpleDTO.builder().id(this.id).uid(this.id + "").phoneNum(this.phoneNum).userName(this.userName).nickName(this.nickName)
.userImg(this.userImg).openid(this.openId).userSex(this.userSex).email(this.email).source(this.source).accountStatus(this.accountStatus).portType(this.portType)
.companyAuthStatus(this.companyName == null ? 0 : 1).companyName(this.companyName)
.region(this.region)
.briefIntroduction(this.briefIntroduction)
.coverPicture(this.coverPicture)
.build();
}
......
package com.mmc.iuav.user.entity.data;
import com.mmc.iuav.user.model.vo.data.ActiveUserCountVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* author:zhenjie
* Date:2022/2/14
* time:10:16
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ActiveUserCountDO implements Serializable {
private static final long serialVersionUID = -6791205305246052945L;
private Integer id;
private Integer dayNum;
private Integer activeUserCount;
private Date activeDate;
private Date createTime;
public ActiveUserCountDO(ActiveUserCountVO param) {
this.activeDate = param.getActiveDate();
this.activeUserCount = param.getActiveUserCount();
}
}
package com.mmc.iuav.user.schedule;
import com.mmc.iuav.user.model.vo.data.ActiveUserCountVO;
import com.mmc.iuav.user.service.data.UserReportService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Calendar;
/**
* @author lw
*/
@Component
@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true")
public class ManagerLogSchedule {
@Resource
UserReportService userReportService;
/**
* 统计日活量
*/
@Scheduled(cron = "0 0 10 * * ?")
public void calculateActiveUserCount() {
Integer userActiveCount = userReportService.getUserActiveCount();
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
//记录到数据库
ActiveUserCountVO yxfActiveUserCountVO = new ActiveUserCountVO();
yxfActiveUserCountVO.setActiveDate(calendar.getTime());
yxfActiveUserCountVO.setActiveUserCount(userActiveCount);
userReportService.insertActiveUserCount(yxfActiveUserCountVO);
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.mmc.iuav.user.entity.UserAccountDO;
import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.qo.UserMessageQO;
import com.mmc.iuav.user.model.qo.UserRcdQO;
import com.mmc.iuav.user.model.vo.UserAccountVO;
......@@ -161,4 +162,10 @@ public interface UserAccountService {
* @return
*/
ResultBody getUserAccountByPhoneNum(String phoneNum);
ResultBody getVerifyCode(Integer userAccountId, String phoneNum);
ResultBody updatePhoneNum(Integer userAccountId, String verifyCode);
ResultBody appUpdateUser(UserMessageQO userMessageQO);
}
......@@ -108,4 +108,7 @@ public interface WxService {
ResultBody moveSubUserToTest();
ResultBody moveSubUserUnionIdToTest();
ResultBody getUserPortrait();
}
package com.mmc.iuav.user.service.data;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.dto.data.ProductReportDTO;
import com.mmc.iuav.user.model.dto.data.UserReportDTO;
import com.mmc.iuav.user.model.vo.data.ActiveUserCountVO;
/**
* @Author LW
* @date 2023/9/16 11:25
* 概要:
*/
public interface UserReportService {
ResultBody<UserReportDTO> getUserReportData(String date);
Integer getUserActiveCount();
void insertActiveUserCount(ActiveUserCountVO param);
ProductReportDTO getJoinStoreNumber();
}
package com.mmc.iuav.user.service.data.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.dao.CooperationDao;
import com.mmc.iuav.user.dao.RealNameAuthDao;
import com.mmc.iuav.user.dao.UserServiceDao;
import com.mmc.iuav.user.dao.dronepilot.PilotCertificationDao;
import com.mmc.iuav.user.entity.data.ActiveUserCountDO;
import com.mmc.iuav.user.model.dto.data.ProductReportDTO;
import com.mmc.iuav.user.model.dto.data.UserReportDTO;
import com.mmc.iuav.user.model.vo.data.ActiveUserCountVO;
import com.mmc.iuav.user.service.WxService;
import com.mmc.iuav.user.service.data.UserReportService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @Author LW
* @date 2023/9/16 13:24
* 概要:
*/
@Service
public class UserReportServiceImpl implements UserReportService {
@Resource
private UserServiceDao userServiceDao;
@Resource
private RealNameAuthDao realNameAuthDao;
@Resource
private PilotCertificationDao pilotCertificationDao;
@Resource
private WxService wxService;
@Resource
private CooperationDao cooperationDao;
@Override
public ResultBody<UserReportDTO> getUserReportData(String date) {
UserReportDTO userReportDTO = new UserReportDTO();
// 获取可用用户总数
int userCount = userServiceDao.getUsableUserCount();
userReportDTO.setUserCount(userCount);
// 获取实名认证用户数量
int realNameCount = realNameAuthDao.getRealNameAuthCount();
userReportDTO.setRealNameCount(realNameCount);
// 获取飞手认证用户数量
int dronePilotCount = pilotCertificationDao.getDronePilotCount();
userReportDTO.setDronePilotCount(dronePilotCount);
// 获取昨日新增用户数
int yesterdayUserCount = userServiceDao.getYesterdayAddUserCount();
userReportDTO.setYesterdayAddUserCount(yesterdayUserCount);
// 获取昨日活跃用户数
ActiveUserCountDO activeUserCountByDayNum = userServiceDao.getActiveUserCountByDayNum();
userReportDTO.setYesterdayActiveUserCount(activeUserCountByDayNum.getActiveUserCount());
return ResultBody.success(userReportDTO);
}
@Override
public Integer getUserActiveCount() {
ResultBody resultBody = wxService.getUserPortrait();
if (resultBody != null && resultBody.getCode().equals("200")) {
JSONObject result = JSONObject.parseObject(resultBody.getResult().toString());
JSONArray jsonArray = JSONArray.parseArray(result.get("list").toString());
JSONObject object = (JSONObject) jsonArray.get(0);
return (Integer) object.get("visit_uv");
}
return 0;
}
@Override
public void insertActiveUserCount(ActiveUserCountVO param) {
ActiveUserCountDO activeUserCountDO = new ActiveUserCountDO(param);
userServiceDao.insertActiveUserCount(activeUserCountDO);
}
@Override
public ProductReportDTO getJoinStoreNumber() {
ProductReportDTO productReportDTO = new ProductReportDTO();
// 获取入驻商家数量
int joinStoreCount = cooperationDao.getJoinStoreCount();
productReportDTO.setJoinStoreCount(joinStoreCount);
// 获取品牌商入驻数量
productReportDTO.setBrandStore(cooperationDao.getStoreCountByType(1));
// 获取维修商数量
productReportDTO.setRepairStore(cooperationDao.getStoreCountByType(10));
// 获取培训机构数量
productReportDTO.setTrainingInstitution(cooperationDao.getStoreCountByType(4));
// 获取租赁商数量
productReportDTO.setLeaseStore(cooperationDao.getStoreCountByType(3));
// 获取服务商数量
productReportDTO.setServiceStore(cooperationDao.getStoreCountByType(5));
return productReportDTO;
}
}
......@@ -27,7 +27,7 @@ public interface ContractService {
ResultBody downloadContract(String contractId);
ResultBody stamp(String contractId, LoginSuccessDTO loginSuccessDTO, String pages, Integer port);
ResultBody stamp(String contractId, LoginSuccessDTO loginSuccessDTO, String pages, Integer port, String customerId);
/**
* 异步回调
......
......@@ -9,7 +9,9 @@ import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.constant.fdd.FddConnectConstant;
import com.mmc.iuav.user.constant.fdd.FddConstant;
import com.mmc.iuav.user.dao.UserServiceDao;
import com.mmc.iuav.user.dao.fdd.ContractDao;
import com.mmc.iuav.user.dao.fdd.UserFddAuthDao;
import com.mmc.iuav.user.entity.fdd.ContractInfoDO;
import com.mmc.iuav.user.entity.fdd.UserFddDO;
import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
......@@ -18,6 +20,7 @@ import com.mmc.iuav.user.model.fdd.vo.ContractVO;
import com.mmc.iuav.user.mq.MqProducer;
import com.mmc.iuav.user.service.fdd.ContractService;
import com.mmc.iuav.user.service.fdd.SealManageService;
import com.mmc.iuav.user.service.fdd.UserFddAuthService;
import com.mmc.iuav.user.util.TDateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
......@@ -43,6 +46,12 @@ public class ContractServiceImpl implements ContractService {
SealManageService sealManageService;
@Resource
private MqProducer mqProducer;
@Resource
UserFddAuthService userFddAuthService;
@Resource
UserServiceDao userServiceDao;
@Resource
UserFddAuthDao userFddAuthDao;
/**
* 上传合同
......@@ -120,12 +129,26 @@ public class ContractServiceImpl implements ContractService {
@Override
public ResultBody stamp(String contractId, LoginSuccessDTO loginSuccessDTO, String pages, Integer port) {
ResultBody resultBody = sealManageService.checkAuthStatus(port, loginSuccessDTO);
if (!resultBody.getCode().equals("200")) {
return resultBody;
public ResultBody stamp(String contractId, LoginSuccessDTO loginSuccessDTO, String pages, Integer port, String customerId) {
UserFddDO userFddDO;
if (port.equals(0)) {
// 根据客户id获取认证信息
userFddDO = userFddAuthDao.getAppUserFddInfoByCustomerId(customerId);
if (null == userFddDO) {
return ResultBody.error(ResultEnum.BUSINESS_LICENSE_CHECK_ERROR);
}
boolean isPersonVerified = userFddDO.getAccountType().equals(1) && userFddDO.getPersonVerifyStatus().equals(2);
boolean isEntVerified = userFddDO.getAccountType().equals(2) && userFddDO.getEntVerifyStatus().equals(4);
if (!isPersonVerified && !isEntVerified) {
return ResultBody.error(ResultEnum.BUSINESS_LICENSE_CHECK_NOT_PASS);
}
} else {
ResultBody resultBody = sealManageService.checkAuthStatus(port, loginSuccessDTO);
if (!resultBody.getCode().equals("200")) {
return resultBody;
}
userFddDO = (UserFddDO) resultBody.getResult();
}
UserFddDO userFddDO = (UserFddDO) resultBody.getResult();
// 获取合同信息
ContractInfoDO contractInfo = contractDao.contractInfoByOrderNo(null, contractId);
FddBaseClient baseClient = new FddBaseClient(FddConnectConstant.APP_ID, FddConnectConstant.APP_KEY, FddConnectConstant.VERSION, FddConnectConstant.HOST);
......
......@@ -157,8 +157,8 @@ public class SealManageServiceImpl implements SealManageService {
Integer personVerifyStatus = userFddInfo.getPersonVerifyStatus();
Integer entVerifyStatus = userFddInfo.getEntVerifyStatus();
boolean isPersonVerified = !accountType.equals(1) && personVerifyStatus.equals(2);
boolean isEntVerified = !accountType.equals(2) && entVerifyStatus.equals(4);
boolean isPersonVerified = accountType.equals(1) && !personVerifyStatus.equals(2);
boolean isEntVerified = accountType.equals(2) && !entVerifyStatus.equals(4);
if (isPersonVerified || isEntVerified) {
uid = userFddAuthService.replaceUnableString(userInfo.getOpenId());
......
......@@ -200,9 +200,13 @@ public class UserFddAuthServiceImpl implements UserFddAuthService {
return ResultBody.error(ResultEnum.NOT_FOUND);
}
//修改认证状态
userFddAuthDao.updateCompanyCertStatus(customerId, status);
if (authenticationType.equals("2")) {
userFddAuthDao.updateCompanyCertStatus(customerId, status);
} else {
userFddAuthDao.updatePersonCertStatus(customerId, status);
}
//通过需要申请证书
if ((authenticationType.equals("2") && status.equals("4")) || (authenticationType.equals("1") && status.equals("2"))) {
if (("2".equals(authenticationType) && status.equals("4")) || (authenticationType.equals("1") && status.equals("2"))) {
fddService.getApplyCert(verifyInfoDO.getCustomerId(), verifyInfoDO.getTransactionNo());
}
return ResultBody.success();
......@@ -220,15 +224,20 @@ public class UserFddAuthServiceImpl implements UserFddAuthService {
if (userFddInfo == null) {
uId = userFddAuthService.replaceUnableString(userInfo.getOpenId());
} else {
Integer accountType = userFddInfo.getAccountType();
Integer personVerifyStatus = userFddInfo.getPersonVerifyStatus();
Integer entVerifyStatus = userFddInfo.getEntVerifyStatus();
boolean isPersonVerified = accountType.equals(1) && !personVerifyStatus.equals(2);
boolean isEntVerified = accountType.equals(2) && !entVerifyStatus.equals(4);
if (isPersonVerified || isEntVerified) {
uId = userFddAuthService.replaceUnableString(userInfo.getOpenId());
if (flag.equals(1)) {
Integer accountType = userFddInfo.getAccountType();
Integer personVerifyStatus = userFddInfo.getPersonVerifyStatus();
boolean isPersonVerified = accountType.equals(1) && !personVerifyStatus.equals(2);
if (isPersonVerified) {
uId = userFddAuthService.replaceUnableString(userInfo.getOpenId());
}
} else {
Integer accountType = userFddInfo.getAccountType();
Integer entVerifyStatus = userFddInfo.getEntVerifyStatus();
boolean isEntVerified = accountType.equals(1) && !entVerifyStatus.equals(4);
if (isEntVerified) {
uId = userFddAuthService.replaceUnableString(userInfo.getOpenId());
}
}
}
} else {
......
......@@ -26,6 +26,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.security.NoSuchAlgorithmException;
import java.util.List;
......@@ -205,6 +206,15 @@ public class BackUserAccountServiceImpl implements BackUserAccountService {
return null;
}
List<BackUserAccountVO> accountSimpleDTOS = list.stream().map(BackUserAccountDO::buildBackUserAccountVO).collect(Collectors.toList());
List<CompanyInfoVO> companyInfoVOS = companyService.listCompanyInfoByBUIds(bUserAccountQO.getUserIds());
if (!CollectionUtils.isEmpty(companyInfoVOS)) {
Map<Integer, CompanyInfoVO> userCom = companyInfoVOS.stream().collect(Collectors.toMap(CompanyInfoVO::getBackUserAccountId, v -> v, (v1, v2) -> v2));
for (BackUserAccountVO accountSimpleDTO : accountSimpleDTOS) {
if (userCom.containsKey(accountSimpleDTO.getId())) {
accountSimpleDTO.setCompanyName(userCom.get(accountSimpleDTO.getId()).getCompanyName());
}
}
}
return accountSimpleDTOS;
}
......
......@@ -17,6 +17,7 @@ import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.model.dto.RealNameAuthDTO;
import com.mmc.iuav.user.model.dto.UserAccountSimpleDTO;
import com.mmc.iuav.user.model.qo.UserAccountQO;
import com.mmc.iuav.user.model.qo.UserMessageQO;
import com.mmc.iuav.user.model.qo.UserRcdQO;
import com.mmc.iuav.user.model.vo.CompanyAuthVO;
import com.mmc.iuav.user.model.vo.CooperationTagVO;
......@@ -28,16 +29,21 @@ import com.mmc.iuav.user.service.CompanyAuthService;
import com.mmc.iuav.user.service.RealNameAuthService;
import com.mmc.iuav.user.service.UserAccountService;
import com.mmc.iuav.user.service.WxService;
import com.mmc.iuav.user.util.SmsUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.messaging.simp.annotation.SendToUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.util.CollectionUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
......@@ -81,6 +87,9 @@ public class UserAccountServiceImpl implements UserAccountService {
@Autowired
private UserSubInfoDao userSubInfoDao;
@Autowired
private StringRedisTemplate stringRedisTemplate;
@Override
public UserAccountVO getUserAccountInfoByUnionId(String unionId) {
......@@ -102,6 +111,8 @@ public class UserAccountServiceImpl implements UserAccountService {
if (userAccountDO == null) {
return null;
}
String districtChild = userServiceDao.getDistrictChild(userAccountDO.getDistrictChildId());
userAccountDO.setRegion(districtChild);
UserAccountVO userAccountVO = userAccountDO.buildUserAccountVO();
ResultBody<RealNameAuthDTO> nameAuthDTOResultBody = realNameAuthService.userDetail(userAccountId);
RealNameAuthDTO realNameAuthDTO = nameAuthDTOResultBody.getResult();
......@@ -149,6 +160,8 @@ public class UserAccountServiceImpl implements UserAccountService {
if (userAccountDO == null) {
return null;
}
String districtChild = userServiceDao.getDistrictChild(userAccountDO.getDistrictChildId());
userAccountDO.setRegion(districtChild);
UserAccountSimpleDTO userAccountSimpleDTO = userAccountDO.buildUserAccountSimpleDTO();
CompanyAuthVO companyAuthVO = companyAuthService.getCompanyAuthByUId(userAccountId);
if (companyAuthVO != null) {
......@@ -161,6 +174,10 @@ public class UserAccountServiceImpl implements UserAccountService {
List<CooperationTagVO> cooperationTags = cooperationTagDOS.stream().map(CooperationTagDO::buildCooperationTagVO).collect(Collectors.toList());
userAccountSimpleDTO.setCooperationTagVOS(cooperationTags);
}
ResultBody<RealNameAuthDTO> userDetail = realNameAuthService.userDetail(userAccountId);
if (userDetail.getCode().equals(ResultEnum.SUCCESS.getResultCode()) && userDetail.getResult() != null) {
userAccountSimpleDTO.setUserName(userDetail.getResult().getUserName());
}
return userAccountSimpleDTO;
}
......@@ -438,4 +455,56 @@ public class UserAccountServiceImpl implements UserAccountService {
return ResultBody.success();
}
@Override
public ResultBody getVerifyCode(Integer userAccountId, String phoneNum) {
Integer count= userServiceDao.countPhoneNum(phoneNum);
if(count>0){
return ResultBody.error("手机号已存在");
}
// 根据手机号生成验证码
String verifyCode = CodeUtil.getRandomNum(6);
// 保存到redis中
Map<String, String> redisData = new HashMap<>();
redisData.put("userAccountId", userAccountId + "");
redisData.put("phoneNum", phoneNum);
redisData.put("verifyCode", verifyCode);
stringRedisTemplate.opsForHash().putAll(verifyCode + userAccountId, redisData);
stringRedisTemplate.expire(verifyCode + userAccountId, 60, TimeUnit.SECONDS);
// 发送给用户
SmsUtil.verifyCode(verifyCode, phoneNum);
return ResultBody.success();
}
@Override
public ResultBody updatePhoneNum(Integer userAccountId, String verifyCode) {
Map<Object, Object> redisData = stringRedisTemplate.opsForHash().entries(verifyCode + userAccountId);
if (redisData.isEmpty()) {
return ResultBody.error("验证码错误,请重新输入");
}
String code = redisData.get("verifyCode").toString();
String phoneNum = redisData.get("phoneNum").toString();
// 验证码错误则修改失败,并提醒
if (!code.equals(verifyCode)) {
return ResultBody.error("验证码错误,请重新输入");
}
int count = userServiceDao.countPhoneNums(phoneNum, userAccountId);
if (count > 0) {
return ResultBody.error("手机号已存在");
}
userServiceDao.updateAccountPhone(userAccountId, phoneNum);
return ResultBody.success();
}
@Override
public ResultBody appUpdateUser(UserMessageQO userMessageQO) {
int i = userServiceDao.selectUserAccount(userMessageQO);
if (i!=0){
return ResultBody.error("昵称被占用,请重新修改");
}else{
userServiceDao.appUpdateUser(userMessageQO);
}
return ResultBody.success();
}
}
......@@ -8,12 +8,14 @@ import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.constant.UserSystemConstant;
import com.mmc.iuav.user.constant.WxConstant;
import com.mmc.iuav.user.controller.wx.HttpsOpenUtil;
import com.mmc.iuav.user.dao.UserSubInfoDao;
import com.mmc.iuav.user.entity.UserSubInfoDO;
import com.mmc.iuav.user.model.vo.AppletMsgVO;
import com.mmc.iuav.user.model.vo.WxLoginVO;
import com.mmc.iuav.user.model.vo.WxMsgVO;
import com.mmc.iuav.user.service.WxService;
import com.mmc.iuav.user.util.TDateUtil;
import com.mmc.iuav.user.util.WxApiUtil;
import com.mmc.iuav.user.util.XmlToMapUtil;
import lombok.extern.slf4j.Slf4j;
......@@ -400,4 +402,24 @@ public class WxServiceImpl implements WxService {
return ResultBody.success();
}
@Override
public ResultBody getUserPortrait() {
try {
String accessToken = this.getStableAccessToken();
com.alibaba.fastjson.JSONObject param = new com.alibaba.fastjson.JSONObject();
String date = TDateUtil.getYesterdayDateByType("yyyyMMdd");
param.put("begin_date", date);
// param.put("env_version", UserSystemConstant.AppletEnv);
param.put("end_date", date);
param.put("access_token", accessToken);
String url = "https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend?access_token=" + accessToken;
String res = HttpsOpenUtil.httpSendPost(url, param.toJSONString());
log.info("getUserPortrait: " + JSONObject.toJSONString(res));
return ResultBody.success(res);
} catch (Exception e) {
return ResultBody.error(e.getMessage());
}
}
}
......@@ -605,6 +605,7 @@ public class PayWalletServiceImpl implements PayWalletService {
payLogDO.setUserAccountId(payUavWalletVO.getUserAccountId());
payLogDO.setPayNo(payNo);
payLogDO.setOperateUser(payUavWalletVO.getUserAccountId());
payLogDO.setRemark(payUavWalletVO.getRemark());
// 创建用户钱包
PayWalletDO payWalletDO = new PayWalletDO();
......@@ -683,6 +684,9 @@ public class PayWalletServiceImpl implements PayWalletService {
@Transactional(rollbackFor = Exception.class)
public ResultBody handleConfirmReceipt(PayUavWalletVO payUavWalletVO, PayWalletDO userWalletInfo, PayLogDO payLogDO, PayWalletDO payWalletDO) {
payLogDO.setPayMethod(payUavWalletVO.getOrderStatus());
payLogDO.setCashAmtPaid(payUavWalletVO.getCashAmount());
payLogDO.setSalaryAmtPaid(payUavWalletVO.getSalaryAmount());
// 确认收货,解冻用户钱包信息
payWalletDO.setSalaryFreeze(userWalletInfo.getSalaryFreeze().subtract(payUavWalletVO.getSalaryAmount()));
payWalletDO.setCashFreeze(userWalletInfo.getCashFreeze().subtract(payUavWalletVO.getCashAmount()));
......
......@@ -25,6 +25,8 @@ public class SmsUtil {
private static String COOPERATION_TEMPLATE_PASS_CODE_3 = "SMS_462620535";
private static String COOPERATION_TEMPLATE_PASS_CODE_4 = "SMS_462605558";
private static String COOPERATION_TEMPLATE_PASS_CODE_5 = "SMS_462575668";
//短信验证码模板
private static String VERIFYCODE="SMS_211825548";
/**
* 加盟审核未通过
......@@ -63,4 +65,14 @@ public class SmsUtil {
}
return new Gson().toJson(response.body);
}
/**
* 短信验证码
* @param verifyCode
* @param phone
* @return
*/
public static String verifyCode(String verifyCode,String phone){
return send(VERIFYCODE,"{\"code\":\""+verifyCode+"\"}",phone);
}
}
......@@ -89,7 +89,7 @@ fdd:
appid: 407664
appkey: q146q3Cjmi7Y6BVl8jtZK9pH
version: 2
host: https://testapi.fadada.com:8443/api/
host: https://testapi06.fadada.com/api/
mmc-url: https://test.iuav.shop/userapp/
iuav:
......
......@@ -10,8 +10,9 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
redis:
database: 1
host: 127.0.0.1
host: r-wz9ke310fs684hacn1pd.redis.rds.aliyuncs.com
port: 6379
password: MMC@2022&REDIS
#rabbitMQ
rabbitmq:
host: amqp-cn-zvp2ozhnj001.cn-shenzhen.amqp-0.net.mq.amqp.aliyuncs.com
......@@ -52,7 +53,7 @@ fdd:
appid: 407664
appkey: q146q3Cjmi7Y6BVl8jtZK9pH
version: 2
host: https://testapi.fadada.com:8443/api/
host: https://testapi06.fadada.com/api/
mmc-url: https://test.iuav.shop/userapp/
iuav:
......
......@@ -78,11 +78,11 @@ third-party:
withdrawNotify: https://www.iuav.shop/userapp/xz/xzWithdrawNotify
fdd:
appid: 407664
appkey: q146q3Cjmi7Y6BVl8jtZK9pH
appid: 502624
appkey: mDWdQ0jnx0iEJuJkLdKJsc0l
version: 2
host: https://testapi.fadada.com:8443/api/
mmc-url: https://test.iuav.shop/userapp/
host: https://textapi.fadada.com/api2/
mmc-url: https://www.iuav.shop/userapp/
iuav:
pay:
......
......@@ -166,8 +166,8 @@
<select id="listCompanyInfoByUID" resultType="com.mmc.iuav.user.entity.CompanyInfoDO">
SELECT ci.id, ci.company_type, ci.company_name, ci.full_name, ci.province, ci.city, ci.district, ci.address,
ci.company_user_name,
ci.phone_num, ci.remark, ci.create_time, cbu.back_user_account_id,ci.content, ci.score, ci.back_img
ci.company_user_name, ci.phone_num, ci.remark, ci.create_time, ci.content, ci.score, ci.back_img,
cbu.back_user_account_id
FROM company_info ci INNER JOIN company_back_user cbu ON ci.id = cbu.company_info_id
WHERE 1 = 1
<if test="backUserIds != null">
......
......@@ -436,11 +436,13 @@
<select id="countListCompanyInfoByCoopId" resultType="java.lang.Integer">
SELECT count(*)
FROM user_apply_tag uat
INNER JOIN cooperation_tag ct ON uat.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = uat.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
INNER JOIN cooperation_tag ct ON uat.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = uat.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
WHERE ct.id = #{coopId}
and uat.is_deleted = 0 and uat.apply_status = 1 and ci.is_deleted = 0
and uat.is_deleted = 0
and uat.apply_status = 1
and ci.is_deleted = 0
</select>
<select id="listCompanyInfoByCoopId" resultType="com.mmc.iuav.user.entity.CompanyInfoDO">
......@@ -454,15 +456,30 @@
ci.brand_name,
ci.brand_logo,
cbu.back_user_account_id,
round(st_distance_sphere(point(ci.lon, ci.lat),point(#{lon}, #{lat}))/1000, 2) AS distance
round(st_distance_sphere(point(ci.lon, ci.lat), point(#{lon}, #{lat})) / 1000, 2) AS distance
FROM user_apply_tag uat
INNER JOIN cooperation_tag ct ON uat.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = uat.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
INNER JOIN company_back_user cbu ON cbu.company_info_id = ci.id
WHERE ct.id = #{coopId}
and uat.is_deleted = 0 and uat.apply_status = 1 and ci.is_deleted = 0
ORDER BY distance ASC
and uat.is_deleted = 0
and uat.apply_status = 1
and ci.is_deleted = 0
ORDER BY distance ASC
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="getJoinStoreCount" resultType="java.lang.Integer">
select count(*)
from user_apply_tag
where is_deleted = 0
and apply_status = 1
</select>
<select id="getStoreCountByType" resultType="java.lang.Integer">
select count(*)
from user_apply_tag
where is_deleted = 0
and apply_status = 1
and cooperation_tag_id = #{type}
</select>
</mapper>
......@@ -6,10 +6,12 @@
<insert id="addRealNameAuth" parameterType="com.mmc.iuav.user.entity.RealNameAuthDO" useGeneratedKeys="true"
keyProperty="id">
insert into real_name_auth(user_account_id, union_id, front_id_img, back_id_img, id_number, user_name, sex, nationality,
insert into real_name_auth(user_account_id, union_id, front_id_img, back_id_img, id_number, user_name, sex,
nationality,
birthday, address, issue,
start_date, end_date, is_fake_front, is_fake_back, check_status, remark, create_time)
values (#{userAccountId}, #{unionId}, #{frontIdImg}, #{backIdImg}, #{idNumber}, #{userName}, #{sex}, #{nationality},
values (#{userAccountId}, #{unionId}, #{frontIdImg}, #{backIdImg}, #{idNumber}, #{userName}, #{sex},
#{nationality},
#{birthday}, #{address}, #{issue},
#{startDate}, #{endDate}, #{fakeFront}, #{fakeBack}, #{checkStatus}, #{remark}, NOW())
</insert>
......@@ -70,41 +72,100 @@
</update>
<update id="updateRealNameAuthRemark">
update real_name_auth set remark = #{remark} where id = #{id}
update real_name_auth
set remark = #{remark}
where id = #{id}
</update>
<select id="existHasBeenAuth" resultType="java.lang.Integer">
select count(*) from real_name_auth where union_id <![CDATA[<>]]> #{unionId} and id_number = #{idNumber} and check_status = 1
select count(*)
from real_name_auth
where union_id <![CDATA[<>]]> #{unionId}
and id_number = #{idNumber}
and check_status = 1
</select>
<select id="getRealNameAuthByUnionId" resultType="com.mmc.iuav.user.entity.RealNameAuthDO">
select rna.id, rna.user_account_id, rna.union_id, rna.front_id_img, rna.back_id_img, rna.id_number, rna.user_name, rna.sex, rna.nationality,
rna.birthday, rna.address, rna.issue, rna.start_date, rna.end_date, rna.is_fake_front, rna.is_fake_back, rna.check_status, rna.remark,
rna.create_time
from real_name_auth rna
where rna.union_id = #{unionId} and rna.is_deleted = 0
select rna.id,
rna.user_account_id,
rna.union_id,
rna.front_id_img,
rna.back_id_img,
rna.id_number,
rna.user_name,
rna.sex,
rna.nationality,
rna.birthday,
rna.address,
rna.issue,
rna.start_date,
rna.end_date,
rna.is_fake_front,
rna.is_fake_back,
rna.check_status,
rna.remark,
rna.create_time
from real_name_auth rna
where rna.union_id = #{unionId}
and rna.is_deleted = 0
</select>
<select id="getRealNameAuthBakByUnionId" resultType="com.mmc.iuav.user.entity.RealNameAuthDO">
select rna.id, rna.user_account_id, rna.union_id, rna.front_id_img, rna.back_id_img, rna.id_number, rna.user_name, rna.sex, rna.nationality,
rna.birthday, rna.address, rna.issue, rna.start_date, rna.end_date, rna.is_fake_front, rna.is_fake_back, rna.check_status, rna.remark,
rna.create_time
from real_name_auth_bak rna
where rna.union_id = #{unionId} and rna.is_deleted = 0 and rna.check_status = 1
select rna.id,
rna.user_account_id,
rna.union_id,
rna.front_id_img,
rna.back_id_img,
rna.id_number,
rna.user_name,
rna.sex,
rna.nationality,
rna.birthday,
rna.address,
rna.issue,
rna.start_date,
rna.end_date,
rna.is_fake_front,
rna.is_fake_back,
rna.check_status,
rna.remark,
rna.create_time
from real_name_auth_bak rna
where rna.union_id = #{unionId}
and rna.is_deleted = 0
and rna.check_status = 1
</select>
<select id="getRealNameAuthByUId" resultType="com.mmc.iuav.user.entity.RealNameAuthDO">
select rna.id,rna.union_id,rna.user_name,rna.id_number,rna.check_status,rna.sex
from real_name_auth rna
where rna.user_account_id = #{userAccountId} and rna.is_deleted = 0
select rna.id, rna.union_id, rna.user_name, rna.id_number, rna.check_status, rna.sex
from real_name_auth rna
where rna.user_account_id = #{userAccountId}
and rna.is_deleted = 0
</select>
<select id="getRealNameAuthById" resultType="com.mmc.iuav.user.entity.RealNameAuthDO">
select rna.id, rna.user_account_id, rna.union_id, rna.front_id_img, rna.back_id_img, rna.id_number, rna.user_name, rna.sex, rna.nationality,
rna.birthday, rna.address, rna.issue, rna.start_date, rna.end_date, rna.is_fake_front, rna.is_fake_back, rna.check_status, rna.remark,
rna.create_time
from real_name_auth rna
where rna.id = #{id} and rna.is_deleted = 0
select rna.id,
rna.user_account_id,
rna.union_id,
rna.front_id_img,
rna.back_id_img,
rna.id_number,
rna.user_name,
rna.sex,
rna.nationality,
rna.birthday,
rna.address,
rna.issue,
rna.start_date,
rna.end_date,
rna.is_fake_front,
rna.is_fake_back,
rna.check_status,
rna.remark,
rna.create_time
from real_name_auth rna
where rna.id = #{id}
and rna.is_deleted = 0
</select>
<select id="countListRealNameAuth" resultType="java.lang.Integer">
......@@ -141,10 +202,32 @@
</select>
<select id="userDetail" resultType="com.mmc.iuav.user.entity.RealNameAuthDO">
select rna.id, rna.user_account_id, rna.union_id, rna.front_id_img, rna.back_id_img, rna.id_number, rna.user_name, rna.sex, rna.nationality,
rna.birthday, rna.address, rna.issue, rna.start_date, rna.end_date, rna.is_fake_front, rna.is_fake_back, rna.check_status, rna.remark,
rna.create_time
from real_name_auth rna
where rna.user_account_id = #{userAccountId} and rna.is_deleted = 0
select rna.id,
rna.user_account_id,
rna.union_id,
rna.front_id_img,
rna.back_id_img,
rna.id_number,
rna.user_name,
rna.sex,
rna.nationality,
rna.birthday,
rna.address,
rna.issue,
rna.start_date,
rna.end_date,
rna.is_fake_front,
rna.is_fake_back,
rna.check_status,
rna.remark,
rna.create_time
from real_name_auth rna
where rna.user_account_id = #{userAccountId}
and rna.is_deleted = 0
</select>
<select id="getRealNameAuthCount" resultType="java.lang.Integer">
select count(*)
from real_name_auth
where is_deleted = 0
</select>
</mapper>
\ No newline at end of file
......@@ -47,6 +47,11 @@
insert into user_rcd (user_account_id, rcd_user_id, create_time)
values (#{userAccountId}, #{rcdUserId}, NOW());
</insert>
<insert id="insertActiveUserCount">
insert into active_user_count
(active_user_count, active_date, create_time)
values (#{activeUserCount}, #{activeDate}, NOW())
</insert>
<update id="update" parameterType="com.mmc.iuav.user.entity.UserAccountDO">
update user_account
......@@ -140,7 +145,10 @@
ua.create_time,
ua.update_time,
pc.audit_status,
up.total_points
up.total_points,
ua.brief_introduction,
ua.cover_picture,
ua.district_child_id
FROM user_account ua
LEFT JOIN pilot_certification pc ON pc.user_account_id = ua.id
LEFT JOIN user_points up ON up.user_account_id = ua.id
......@@ -165,7 +173,12 @@
parameterType="com.mmc.iuav.user.model.qo.UserAccountQO">
select ua.id, ua.phone_num, rna.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.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus
ua.port_type, ua.disable, ua.create_time, ua.update_time, ca.auth_status as companyAuthStatus,
ua.latitude,
ua.longitude,
ua.region,
ua.brief_introduction,
ua.cover_picture
from user_account ua left join company_auth ca on ua.id = ca.user_account_id left join real_name_auth rna on
ua.id = rna.user_account_id
where ua.disable = 0
......@@ -479,5 +492,77 @@
</if>
</where>
</select>
<select id="getUsableUserCount" resultType="java.lang.Integer">
select count(*)
from user_account
where disable = 0
</select>
<select id="getYesterdayAddUserCount" resultType="java.lang.Integer">
SELECT count(*)
FROM user_account
WHERE DATE (create_time) = CURDATE() - INTERVAL 1 DAY;
</select>
<select id="getActiveUserCountByDayNum" resultType="com.mmc.iuav.user.entity.data.ActiveUserCountDO">
SELECT 1 AS day_num,
COALESCE(SUM(auc.active_user_count), 0) AS active_user_count
FROM active_user_count auc
WHERE (TO_DAYS(NOW()) - TO_DAYS(auc.active_date)) = 1
</select>
<select id="countPhoneNum" resultType="java.lang.Integer">
select count(*) from user_account where phone_num = #{phoneNum} and `disable`=0 and account_status=1
</select>
<select id="countPhoneNums" resultType="java.lang.Integer">
select count(*) from user_account where phone_num = #{phoneNum}
and `disable`=0 and account_status=1 and id=#{userAccountId}
</select>
<select id="updateAccountPhone" >
update user_account
<set>
phone_num = #{phoneNum}
</set>
where id = #{userAccountId}
</select>
<update id="appUpdateUser" parameterType="com.mmc.iuav.user.model.qo.UserMessageQO">
update user_account
<set>
<if test="userImg!='' and userImg!=null ">
user_img=#{userImg},
</if>
<if test="coverPicture!='' and coverPicture!=null">
cover_picture=#{coverPicture},
</if>
<if test="nickName!='' and nickName!=null ">
nick_name=#{nickName},
</if>
<if test="districtChildId!=null">
district_child_id=#{districtChildId},
</if>
<if test="briefIntroduction!='' and briefIntroduction!=null">
brief_introduction=#{briefIntroduction},
</if>
</set>
where id=#{id}
</update>
<select id="selectUserAccount" resultType="java.lang.Integer"
parameterType="com.mmc.iuav.user.model.qo.UserMessageQO">
select count(*) from user_account where disable=0 and nick_name=#{nickName} and id!=#{id}
</select>
<select id="getDistrictChild" resultType="java.lang.String">
SELECT
concat( p1.`name`, p2.`name` ) AS region
FROM
sys_district p1,
sys_district p2
WHERE
p2.LEVEL != 3
AND p1.id = p2.pid
AND p2.id = #{districtChildId}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.mmc.iuav.user.dao.data.UserReportDao"></mapper>
\ No newline at end of file
......@@ -360,4 +360,9 @@
from pilot_certification
where id = #{id}
</select>
<select id="getDronePilotCount" resultType="java.lang.Integer">
select count(*)
from pilot_certification
where audit_status = 1
</select>
</mapper>
......@@ -31,6 +31,11 @@
set ent_verify_status = #{status}
where customer_id = #{customerId}
</update>
<update id="updatePersonCertStatus">
update user_fdd
set person_verify_status = #{status}
where customer_id = #{customerId}
</update>
<select id="checkRegisterFdd" resultType="com.mmc.iuav.user.entity.fdd.UserFddDO">
select id,
union_id,
......@@ -62,5 +67,17 @@
from user_fdd
where union_id = #{unionId}
</select>
<select id="getAppUserFddInfoByCustomerId" resultType="com.mmc.iuav.user.entity.fdd.UserFddDO">
select id,
customer_id,
union_id,
person_verify_status,
ent_verify_status,
account_type,
create_time,
update_time
from user_fdd
where customer_id = #{customerId}
</select>
</mapper>
\ No newline at end of file
......@@ -37,4 +37,5 @@ data-filter:
- /userapp/pay/feignPayUavWallet
- /userapp/fdd/contract/notifyStamp
- /userapp/fdd/auth/notifyECertRes
- /userapp/user-account/interiorInfo
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: a9be43318a9913f15ec9657f2d026666e62514e0
newTag: 1a3da0e43c06ec7fab39ac8e4cdeeaac1f142807
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论