Merge remote-tracking branch 'origin/feature/REQ-3193' into release-20241113
This commit is contained in:
commit
7de897972d
@ -124,6 +124,15 @@
|
||||
<groupId>cn.axzo.maokai</groupId>
|
||||
<artifactId>maokai-api</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.axzo.trade</groupId>
|
||||
<artifactId>trade-data-security-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.axzo.trade</groupId>
|
||||
<artifactId>trade-data-security-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -2,6 +2,7 @@ package cn.axzo.riven.controller;
|
||||
|
||||
import cn.axzo.framework.domain.web.result.ApiResult;
|
||||
import cn.axzo.framework.jackson.utility.JSON;
|
||||
import cn.axzo.riven.third.job.RepairThirdPersonEncryptJob;
|
||||
import cn.axzo.riven.third.job.TaiZhouProjectPersonIncJob;
|
||||
import cn.axzo.riven.third.job.TaiZhouProjectPersonJob;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -27,6 +28,7 @@ public class PrivateController {
|
||||
|
||||
private final TaiZhouProjectPersonJob taiZhouProjectPersonJob;
|
||||
private final TaiZhouProjectPersonIncJob taiZhouProjectPersonIncJob;
|
||||
private final RepairThirdPersonEncryptJob repairThirdPersonEncryptJob;
|
||||
|
||||
@PostMapping("/job/run")
|
||||
public ApiResult reconsumeMessage(@RequestBody RunJobParam param) throws Exception {
|
||||
@ -45,6 +47,13 @@ public class PrivateController {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
})
|
||||
.put("repairThirdPersonEncryptJob", p -> {
|
||||
try {
|
||||
return repairThirdPersonEncryptJob.execute(p.getParam() == null ? null : p.getParam().toString());
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
})
|
||||
.build();
|
||||
Optional.ofNullable(jobRunners.get(param.getJobName())).ifPresent(c -> c.apply(param));
|
||||
return ApiResult.ok("job ran. -> " + JSON.toJSONString(param));
|
||||
|
||||
@ -0,0 +1,67 @@
|
||||
package cn.axzo.riven.job;
|
||||
|
||||
import cn.axzo.basics.common.constant.enums.TableIsDeleteEnum;
|
||||
import cn.axzo.riven.repository.entity.ThirdPartyUser;
|
||||
import cn.axzo.riven.repository.service.ThirdPartyUserDao;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.handler.IJobHandler;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import com.xxl.job.core.log.XxlJobLogger;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class RepairThirdPartUserEncryptJob extends IJobHandler {
|
||||
|
||||
@Autowired
|
||||
private ThirdPartyUserDao thirdPartyUserDao;
|
||||
|
||||
@XxlJob("repairThirdPartyUserEncryptJob")
|
||||
@Override
|
||||
public ReturnT<String> execute(String s) throws Exception {
|
||||
|
||||
XxlJobLogger.log("repairThirdPartyUserEncryptJob 开始, param = " + s);
|
||||
Param param = StringUtils.isNotEmpty(s) ? JSON.parseObject(s, Param.class) : new Param();
|
||||
|
||||
List<ThirdPartyUser> allThirdPeople = thirdPartyUserDao.lambdaQuery()
|
||||
.in(CollUtil.isNotEmpty(param.getIds()), ThirdPartyUser::getId, param.getIds())
|
||||
.in(CollUtil.isNotEmpty(param.getUserPhones()), ThirdPartyUser::getUserPhone, param.getUserPhones())
|
||||
.eq(ThirdPartyUser::getIsDelete, TableIsDeleteEnum.NORMAL.value)
|
||||
.list().stream()
|
||||
.map(tp -> {
|
||||
ThirdPartyUser thirdPerson = new ThirdPartyUser();
|
||||
thirdPerson.setId(tp.getId());
|
||||
thirdPerson.setUserPhone(tp.getUserPhone());
|
||||
thirdPerson.setUpdateAt(tp.getUpdateAt());
|
||||
return thirdPerson;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
thirdPartyUserDao.saveOrUpdateBatch(allThirdPeople);
|
||||
|
||||
XxlJobLogger.log("repairThirdPartyUserEncryptJob 结束,处理条数 - " + allThirdPeople.size());
|
||||
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
public static class Param {
|
||||
private Set<Long> ids;
|
||||
private Set<String> userPhones;
|
||||
}
|
||||
}
|
||||
@ -51,7 +51,7 @@ public class ThirdPartyUser extends BaseEntity<ThirdPartyUser> {
|
||||
/**
|
||||
* 三方用户手机号
|
||||
*/
|
||||
@CryptField
|
||||
// @CryptField // 此前该注解未生效。修复时,发现有其他应用(测试 python直接连接数据库,查询手机号的情况,先取消加密,等测试侧改造完成后,再进行加密)
|
||||
private String userPhone;
|
||||
|
||||
/** 三方用户邮箱 **/
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package cn.axzo.riven.third.entity;
|
||||
|
||||
import cn.axzo.framework.data.mybatisplus.model.BaseEntity;
|
||||
import cn.axzo.trade.datasecurity.core.annotation.CryptField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@ -28,6 +29,7 @@ public class ThirdPerson extends BaseEntity<ThirdPerson> {
|
||||
/**
|
||||
* 三方人员手机号
|
||||
*/
|
||||
@CryptField
|
||||
private String thirdPersonPhone;
|
||||
|
||||
/**
|
||||
|
||||
@ -0,0 +1,65 @@
|
||||
package cn.axzo.riven.third.job;
|
||||
|
||||
import cn.axzo.riven.third.dao.ThirdPersonDao;
|
||||
import cn.axzo.riven.third.entity.ThirdPerson;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.xxl.job.core.biz.model.ReturnT;
|
||||
import com.xxl.job.core.handler.IJobHandler;
|
||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
||||
import com.xxl.job.core.log.XxlJobLogger;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class RepairThirdPersonEncryptJob extends IJobHandler {
|
||||
|
||||
@Autowired
|
||||
private ThirdPersonDao thirdPersonDao;
|
||||
|
||||
@XxlJob("repairThirdPersonEncryptJob")
|
||||
@Override
|
||||
public ReturnT<String> execute(String s) throws Exception {
|
||||
|
||||
XxlJobLogger.log("repairThirdPersonEncryptJob 开始, param = " + s);
|
||||
Param param = StringUtils.isNotEmpty(s) ? JSON.parseObject(s, Param.class) : new Param();
|
||||
|
||||
List<ThirdPerson> allThirdPeople = thirdPersonDao.lambdaQuery()
|
||||
.in(CollUtil.isNotEmpty(param.getIds()), ThirdPerson::getId, param.getIds())
|
||||
.in(CollUtil.isNotEmpty(param.getThirdPersonPhones()), ThirdPerson::getThirdPersonPhone, param.getThirdPersonPhones())
|
||||
.list().stream()
|
||||
.map(tp -> {
|
||||
ThirdPerson thirdPerson = new ThirdPerson();
|
||||
thirdPerson.setId(tp.getId());
|
||||
thirdPerson.setThirdPersonPhone(tp.getThirdPersonPhone());
|
||||
thirdPerson.setUpdateAt(tp.getUpdateAt());
|
||||
return thirdPerson;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
thirdPersonDao.saveOrUpdateBatch(allThirdPeople);
|
||||
|
||||
XxlJobLogger.log("repairThirdPersonEncryptJob 结束,处理条数 - " + allThirdPeople.size());
|
||||
|
||||
return ReturnT.SUCCESS;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
public static class Param {
|
||||
private Set<Long> ids;
|
||||
private Set<String> thirdPersonPhones;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user