提交 990a7a39 作者: xiaowang

Merge branch 'develop'

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