提交 990a7a39 作者: xiaowang

Merge branch 'develop'

......@@ -86,6 +86,10 @@ public class UserAccountVO implements Serializable {
private String briefIntroduction;
@ApiModelProperty(value = "封面背景图")
private String coverPicture;
@ApiModelProperty(value = "地区最下级id",example = "130100")
private Integer districtChildId;
......
......@@ -3,12 +3,14 @@ package com.mmc.iuav.user;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
/**
* @author:zhenjie
* @Date:2023/5/15 15:35
*/
@EnableScheduling
@SpringBootApplication
public class UserApplication {
public static void main(String[] args) {
......@@ -16,7 +18,7 @@ public class UserApplication {
}
@Bean
public RestTemplate restTemplate(){
public RestTemplate restTemplate() {
return new RestTemplate();
}
}
......@@ -192,5 +192,7 @@ public interface UserServiceDao {
int selectUserAccount(UserMessageQO userMessageQO);
int selectUserAccountNickName(UserAccountDO userAccountDO);
String getDistrictChild(Integer districtChildId);
}
......@@ -11,7 +11,6 @@ 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;
......@@ -102,6 +101,12 @@ public class UserAccountDO implements Serializable {
this.accountStatus = userAccountVO.getAccountStatus();
this.remark = userAccountVO.getRemark();
this.portType = userAccountVO.getPortType();
this.userImg = userAccountVO.getUserImg();
this.coverPicture = userAccountVO.getCoverPicture();
this.nickName = userAccountVO.getNickName();
this.districtChildId = userAccountVO.getDistrictChildId();
this.briefIntroduction = userAccountVO.getBriefIntroduction();
}
public UserAccountDO(BUserAccountVO bUserAccountVO) {
......@@ -131,6 +136,7 @@ public class UserAccountDO implements Serializable {
.region(this.region)
.briefIntroduction(this.briefIntroduction)
.coverPicture(this.coverPicture)
.districtChildId(this.districtChildId)
.build();
}
......@@ -146,6 +152,6 @@ public class UserAccountDO implements Serializable {
public TopInviteVO buildTopInviteVO() {
return TopInviteVO.builder().id(this.id).uid(this.id + "").nickName(this.nickName).userName(this.userName).phoneNum(this.phoneNum)
.inviteCount(this.inviteCount).build();
.inviteCount(this.inviteCount).userImg(this.userImg).build();
}
}
......@@ -2,6 +2,7 @@ package com.mmc.iuav.user.schedule;
import com.mmc.iuav.user.model.vo.data.ActiveUserCountVO;
import com.mmc.iuav.user.service.data.UserReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
......@@ -14,6 +15,7 @@ import java.util.Calendar;
*/
@Component
@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true")
@Slf4j
public class ManagerLogSchedule {
@Resource
UserReportService userReportService;
......@@ -21,10 +23,10 @@ public class ManagerLogSchedule {
/**
* 统计日活量
*/
@Scheduled(cron = "0 0 10 * * ?")
@Scheduled(cron = "0 0 8 * * ?")
public void calculateActiveUserCount() {
log.info("统计日活量");
Integer userActiveCount = userReportService.getUserActiveCount();
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
//记录到数据库
......
......@@ -149,6 +149,10 @@ public class UserAccountServiceImpl implements UserAccountService {
@Override
public ResultBody update(UserAccountVO userAccountVO) {
UserAccountDO userAccountDO = new UserAccountDO(userAccountVO);
int i = userServiceDao.selectUserAccountNickName(userAccountDO);
if (i!=0){
return ResultBody.error("昵称被占用,请重新修改");
}
userServiceDao.update(userAccountDO);
mqProducer.sentUserInfoChangedMsg(userAccountVO);
return ResultBody.success();
......@@ -193,6 +197,13 @@ public class UserAccountServiceImpl implements UserAccountService {
if (list == null) {
return null;
}
for (UserAccountDO userAccountDO : list) {
Integer districtChildId = userAccountDO.getDistrictChildId();
if (districtChildId!=null){
String districtChild = userServiceDao.getDistrictChild(districtChildId);
userAccountDO.setRegion(districtChild);
}
}
List<UserAccountSimpleDTO> accountSimpleDTOS = list.stream().map(UserAccountDO::buildUserAccountSimpleDTO).collect(Collectors.toList());
//设置用户的渠道等级
buildCooperationTagVO(accountSimpleDTOS);
......@@ -459,7 +470,7 @@ public class UserAccountServiceImpl implements UserAccountService {
public ResultBody getVerifyCode(Integer userAccountId, String phoneNum) {
Integer count= userServiceDao.countPhoneNum(phoneNum);
if(count>0){
return ResultBody.error("手机号已存在");
return ResultBody.error("80001","手机号已存在");
}
// 根据手机号生成验证码
String verifyCode = CodeUtil.getRandomNum(6);
......@@ -489,7 +500,7 @@ public class UserAccountServiceImpl implements UserAccountService {
}
int count = userServiceDao.countPhoneNums(phoneNum, userAccountId);
if (count > 0) {
return ResultBody.error("手机号已存在");
return ResultBody.error("80001","手机号已存在");
}
userServiceDao.updateAccountPhone(userAccountId, phoneNum);
return ResultBody.success();
......
......@@ -96,4 +96,6 @@ iuav:
pay:
uri: http://payment-svc:8088
pms:
uri: http://pms-svc:8099
\ No newline at end of file
uri: http://pms-svc:8099
scheduling:
enabled: true
\ No newline at end of file
......@@ -88,4 +88,6 @@ iuav:
pay:
uri: http://payment-svc:8088
pms:
uri: http://pms-svc:8099
\ No newline at end of file
uri: http://pms-svc:8099
scheduling:
enabled: true
\ No newline at end of file
......@@ -470,16 +470,22 @@
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 count(*)
FROM user_apply_tag ua
INNER JOIN cooperation_tag ct ON ua.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = ua.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
WHERE ua.is_deleted = 0
AND ua.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}
from user_apply_tag ua
INNER JOIN cooperation_tag ct ON ua.cooperation_tag_id = ct.id
INNER JOIN company_member cm ON cm.user_account_id = ua.user_account_id
INNER JOIN company_info ci ON cm.company_info_id = ci.id
where ua.is_deleted = 0
and ua.cooperation_tag_id = #{type}
and ua.apply_status = 1
</select>
</mapper>
......@@ -226,8 +226,13 @@
and rna.is_deleted = 0
</select>
<select id="getRealNameAuthCount" resultType="java.lang.Integer">
select count(*)
from real_name_auth
where is_deleted = 0
SELECT count(*)
FROM user_account ua
LEFT JOIN company_member cm ON cm.user_account_id = ua.id
LEFT JOIN company_info ci ON ci.id = cm.company_info_id
LEFT JOIN real_name_auth rna ON rna.user_account_id = ua.id
WHERE ua.DISABLE = 0
AND ua.port_type = 100
and rna.check_status = 1
</select>
</mapper>
\ No newline at end of file
......@@ -90,7 +90,16 @@
remark = #{remark},
</if>
<if test="portType != null">
port_type = #{portType}
port_type = #{portType},
</if>
<if test="coverPicture!='' and coverPicture!=null">
cover_picture=#{coverPicture},
</if>
<if test="districtChildId!=null">
district_child_id=#{districtChildId},
</if>
<if test="briefIntroduction!='' and briefIntroduction!=null">
brief_introduction=#{briefIntroduction}
</if>
</set>
<where>
......@@ -493,9 +502,13 @@
</where>
</select>
<select id="getUsableUserCount" resultType="java.lang.Integer">
select count(*)
from user_account
where disable = 0
SELECT count(*)
FROM user_account ua
LEFT JOIN company_member cm ON cm.user_account_id = ua.id
LEFT JOIN company_info ci ON ci.id = cm.company_info_id
LEFT JOIN real_name_auth rna ON rna.user_account_id = ua.id
WHERE ua.DISABLE = 0
AND ua.port_type = 100
</select>
<select id="getYesterdayAddUserCount" resultType="java.lang.Integer">
SELECT count(*)
......@@ -510,15 +523,23 @@
</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 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 count(*)
from user_account
where phone_num = #{phoneNum}
and `disable` = 0
and account_status = 1
and id = #{userAccountId}
</select>
<select id="updateAccountPhone" >
<select id="updateAccountPhone">
update user_account
<set>
phone_num = #{phoneNum}
......@@ -550,17 +571,27 @@
<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 count(*)
from user_account
where disable = 0
and nick_name = #{nickName}
and id!=#{id}
</select>
<select id="selectUserAccountNickName" resultType="java.lang.Integer"
parameterType="com.mmc.iuav.user.entity.UserAccountDO">
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
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>
......
......@@ -361,8 +361,10 @@
where id = #{id}
</select>
<select id="getDronePilotCount" resultType="java.lang.Integer">
select count(*)
from pilot_certification
where audit_status = 1
SELECT count(*)
FROM pilot_certification pc
LEFT JOIN user_account ua ON pc.user_account_id = ua.id
WHERE pc.audit_status = 1
AND ua.`disable` = 0
</select>
</mapper>
......@@ -37,5 +37,6 @@ data-filter:
- /userapp/pay/feignPayUavWallet
- /userapp/fdd/contract/notifyStamp
- /userapp/fdd/auth/notifyECertRes
- /userapp/user-account/interiorInfo
- /userapp/user-account/interiorInfo
- /userapp/user/report/getJoinStoreNumber
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: 1a3da0e43c06ec7fab39ac8e4cdeeaac1f142807
newTag: 6dd626898acea6649ad018cdc47aa0c2a5ca213d
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论