feat:
1. modify market info
This commit is contained in:
@@ -131,4 +131,12 @@ public class MarketInfoController extends BladeController {
|
||||
return R.status(marketInfoService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
@PostMapping("/reset-password")
|
||||
@ApiOperationSupport(order = 8)
|
||||
@Operation(summary = "初始化密码", description = "传入userId集合")
|
||||
public R resetPassword(@Parameter(description = "userId集合", required = true) @RequestParam String userIds) {
|
||||
boolean temp = marketInfoService.resetPassword(userIds);
|
||||
return R.status(temp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,30 +2,29 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.market.mapper.MarketInfoMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="marketInfoResultMap" type="org.springblade.modules.market.pojo.entity.MarketInfoEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="pid" property="pid"/>
|
||||
<result column="has_synchronized" property="hasSynchronized"/>
|
||||
<result column="vendor" property="vendor"/>
|
||||
<result column="e_signed" property="eSigned"/>
|
||||
<result column="e_signed_url" property="eSignedUrl"/>
|
||||
<result column="verified" property="verified"/>
|
||||
<result column="verified_date" property="verifiedDate"/>
|
||||
<result column="real_name" property="realName"/>
|
||||
<result column="id_card" property="idCard"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectMarketInfoPage" resultMap="marketInfoResultMap">
|
||||
select * from user_market_info where is_deleted = 0
|
||||
<select id="selectMarketInfoPage" resultType="org.springblade.modules.market.pojo.vo.MarketInfoVO">
|
||||
select bu.id as id,
|
||||
bu.account as account,
|
||||
umi.real_name as realName,
|
||||
umi.id_card as idNumber,
|
||||
umi.vendor as vendor,
|
||||
i.account as invitor,
|
||||
bu.create_time as userCreateTime,
|
||||
i.create_time as invitorCreateTime
|
||||
from blade_user bu
|
||||
left join user_market_info umi on bu.id = umi.id
|
||||
left join blade_user i on umi.pid = i.id
|
||||
where bu.user_type = 2
|
||||
and umi.is_deleted = 0
|
||||
<if test="marketInfo.account !=null">
|
||||
and bu.account = #{marketInfo.account}
|
||||
</if>
|
||||
<if test="marketInfo.invitor !=null">
|
||||
and i.account = #{marketInfo.invitor}
|
||||
</if>
|
||||
<if test="marketInfo.realName !=null">
|
||||
and umi.real_name = #{marketInfo.realName}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -25,10 +25,15 @@
|
||||
*/
|
||||
package org.springblade.modules.market.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户拓展信息表 视图实体类
|
||||
@@ -37,9 +42,26 @@ import java.io.Serial;
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MarketInfoVO extends MarketInfoEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
public class MarketInfoVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String account;
|
||||
|
||||
private String realName;
|
||||
|
||||
private String idNumber;
|
||||
|
||||
private Integer vendor;
|
||||
|
||||
private String invitor;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date userCreateTime;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date invitorCreateTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -48,4 +48,6 @@ public interface IMarketInfoService extends BaseService<MarketInfoEntity> {
|
||||
IPage<MarketInfoVO> selectMarketInfoPage(IPage<MarketInfoVO> page, MarketInfoVO marketInfo);
|
||||
|
||||
boolean initInfo(User user, User invitor);
|
||||
|
||||
boolean resetPassword(String userIds);
|
||||
}
|
||||
|
||||
@@ -25,17 +25,28 @@
|
||||
*/
|
||||
package org.springblade.modules.market.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springblade.common.cache.ParamCache;
|
||||
import org.springblade.common.constant.CommonConstant;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.tool.utils.DigestUtil;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springblade.modules.auth.provider.UserType;
|
||||
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||
import org.springblade.modules.market.pojo.vo.MarketInfoVO;
|
||||
import org.springblade.modules.market.mapper.MarketInfoMapper;
|
||||
import org.springblade.modules.market.service.IMarketInfoService;
|
||||
import org.springblade.modules.system.pojo.entity.User;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import static org.springblade.common.constant.CommonConstant.DEFAULT_PARAM_PASSWORD;
|
||||
|
||||
/**
|
||||
* 用户拓展信息表 服务实现类
|
||||
*
|
||||
@@ -43,8 +54,11 @@ import java.util.Optional;
|
||||
* @since 2026-02-05
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class MarketInfoServiceImpl extends BaseServiceImpl<MarketInfoMapper, MarketInfoEntity> implements IMarketInfoService {
|
||||
|
||||
private IUserService userService;
|
||||
|
||||
@Override
|
||||
public IPage<MarketInfoVO> selectMarketInfoPage(IPage<MarketInfoVO> page, MarketInfoVO marketInfo) {
|
||||
return page.setRecords(baseMapper.selectMarketInfoPage(page, marketInfo));
|
||||
@@ -58,4 +72,13 @@ public class MarketInfoServiceImpl extends BaseServiceImpl<MarketInfoMapper, Mar
|
||||
return save(info);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resetPassword(String userIds) {
|
||||
User user = new User();
|
||||
String initPassword = ParamCache.getValue(DEFAULT_PARAM_PASSWORD);// 获取默认密码配置
|
||||
user.setPassword(DigestUtil.encrypt(Func.toStr(initPassword, CommonConstant.DEFAULT_PASSWORD)));
|
||||
user.setUpdateTime(DateUtil.now());
|
||||
return userService.update(user, Wrappers.<User>update().lambda().in(User::getId, Func.toLongList(userIds)).eq(User::getUserType, UserType.APP.getCategory()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user