1. modify market info
This commit is contained in:
2026-02-07 16:53:09 +08:00
parent 63fed8b70b
commit 40b8931ee2
5 changed files with 82 additions and 28 deletions

View File

@@ -131,4 +131,12 @@ public class MarketInfoController extends BladeController {
return R.status(marketInfoService.deleteLogic(Func.toLongList(ids))); 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);
}
} }

View File

@@ -2,30 +2,29 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!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"> <mapper namespace="org.springblade.modules.market.mapper.MarketInfoMapper">
<!-- 通用查询映射结果 --> <select id="selectMarketInfoPage" resultType="org.springblade.modules.market.pojo.vo.MarketInfoVO">
<resultMap id="marketInfoResultMap" type="org.springblade.modules.market.pojo.entity.MarketInfoEntity"> select bu.id as id,
<result column="id" property="id"/> bu.account as account,
<result column="pid" property="pid"/> umi.real_name as realName,
<result column="has_synchronized" property="hasSynchronized"/> umi.id_card as idNumber,
<result column="vendor" property="vendor"/> umi.vendor as vendor,
<result column="e_signed" property="eSigned"/> i.account as invitor,
<result column="e_signed_url" property="eSignedUrl"/> bu.create_time as userCreateTime,
<result column="verified" property="verified"/> i.create_time as invitorCreateTime
<result column="verified_date" property="verifiedDate"/> from blade_user bu
<result column="real_name" property="realName"/> left join user_market_info umi on bu.id = umi.id
<result column="id_card" property="idCard"/> left join blade_user i on umi.pid = i.id
<result column="create_user" property="createUser"/> where bu.user_type = 2
<result column="create_dept" property="createDept"/> and umi.is_deleted = 0
<result column="create_time" property="createTime"/> <if test="marketInfo.account !=null">
<result column="update_user" property="updateUser"/> and bu.account = #{marketInfo.account}
<result column="update_time" property="updateTime"/> </if>
<result column="status" property="status"/> <if test="marketInfo.invitor !=null">
<result column="is_deleted" property="isDeleted"/> and i.account = #{marketInfo.invitor}
</resultMap> </if>
<if test="marketInfo.realName !=null">
and umi.real_name = #{marketInfo.realName}
<select id="selectMarketInfoPage" resultMap="marketInfoResultMap"> </if>
select * from user_market_info where is_deleted = 0
</select> </select>
</mapper> </mapper>

View File

@@ -25,10 +25,15 @@
*/ */
package org.springblade.modules.market.pojo.vo; 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 org.springblade.modules.market.pojo.entity.MarketInfoEntity;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serial; import java.io.Serial;
import java.util.Date;
/** /**
* 用户拓展信息表 视图实体类 * 用户拓展信息表 视图实体类
@@ -37,9 +42,26 @@ import java.io.Serial;
* @since 2026-02-05 * @since 2026-02-05
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true) public class MarketInfoVO {
public class MarketInfoVO extends MarketInfoEntity {
@Serial private Long id;
private static final long serialVersionUID = 1L;
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;
} }

View File

@@ -48,4 +48,6 @@ public interface IMarketInfoService extends BaseService<MarketInfoEntity> {
IPage<MarketInfoVO> selectMarketInfoPage(IPage<MarketInfoVO> page, MarketInfoVO marketInfo); IPage<MarketInfoVO> selectMarketInfoPage(IPage<MarketInfoVO> page, MarketInfoVO marketInfo);
boolean initInfo(User user, User invitor); boolean initInfo(User user, User invitor);
boolean resetPassword(String userIds);
} }

View File

@@ -25,17 +25,28 @@
*/ */
package org.springblade.modules.market.service.impl; 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.entity.MarketInfoEntity;
import org.springblade.modules.market.pojo.vo.MarketInfoVO; import org.springblade.modules.market.pojo.vo.MarketInfoVO;
import org.springblade.modules.market.mapper.MarketInfoMapper; import org.springblade.modules.market.mapper.MarketInfoMapper;
import org.springblade.modules.market.service.IMarketInfoService; import org.springblade.modules.market.service.IMarketInfoService;
import org.springblade.modules.system.pojo.entity.User; import org.springblade.modules.system.pojo.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.Optional; 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 * @since 2026-02-05
*/ */
@Service @Service
@AllArgsConstructor
public class MarketInfoServiceImpl extends BaseServiceImpl<MarketInfoMapper, MarketInfoEntity> implements IMarketInfoService { public class MarketInfoServiceImpl extends BaseServiceImpl<MarketInfoMapper, MarketInfoEntity> implements IMarketInfoService {
private IUserService userService;
@Override @Override
public IPage<MarketInfoVO> selectMarketInfoPage(IPage<MarketInfoVO> page, MarketInfoVO marketInfo) { public IPage<MarketInfoVO> selectMarketInfoPage(IPage<MarketInfoVO> page, MarketInfoVO marketInfo) {
return page.setRecords(baseMapper.selectMarketInfoPage(page, marketInfo)); return page.setRecords(baseMapper.selectMarketInfoPage(page, marketInfo));
@@ -58,4 +72,13 @@ public class MarketInfoServiceImpl extends BaseServiceImpl<MarketInfoMapper, Mar
return save(info); 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()));
}
} }