This commit is contained in:
shuo.wang
2025-04-29 20:13:43 +08:00
parent fcc86e38f0
commit 921447d672
6 changed files with 29 additions and 11 deletions

View File

@@ -101,6 +101,9 @@ public class HyPartnerUserInfoDAO {
* @description: 数据处理专用只处理,盐值 密码 第二密码
*/
public Integer dataHandle(List<HyPartnerUserInfoDO> hyPartnerUserInfoDOList){
if (CollectionUtils.isEmpty(hyPartnerUserInfoDOList)){
return 0;
}
return hyPartnerUserInfoMapper.dataHandle(hyPartnerUserInfoDOList);
}
}

View File

@@ -175,13 +175,13 @@
<foreach collection="list" item="item" separator=";">
update xfsg_partner_user_info
<set>
<if test="record.downstreamSystemSalting != null">
<if test="item.downstreamSystemSalting != null">
downstream_system_salting = #{item.downstreamSystemSalting},
</if>
<if test="record.downstreamSystemPassword != null">
<if test="item.downstreamSystemPassword != null">
downstream_system_password = #{item.downstreamSystemPassword},
</if>
<if test="record.downstreamSystemSecondaryPassword != null">
<if test="item.downstreamSystemSecondaryPassword != null">
downstream_system_secondary_password = #{item.downstreamSystemSecondaryPassword},
</if>
</set>

View File

@@ -162,13 +162,13 @@
<foreach collection="list" item="item" separator=";">
update xfsg_shop_account
<set>
<if test="record.passwordSalt != null">
<if test="item.passwordSalt != null">
password_salt = #{item.passwordSalt},
</if>
<if test="record.password != null">
<if test="item.password != null">
password = #{item.password},
</if>
<if test="record.secondaryPassword != null">
<if test="item.secondaryPassword != null">
secondary_password = #{item.secondaryPassword},
</if>
</set>

View File

@@ -5,7 +5,7 @@ import lombok.Data;
import java.util.Date;
import javax.persistence.*;
@Table(name = "xfsg_shop_accounts")
@Table(name = "xfsg_shop_account")
@Data
public class ShopAccountDO {
/**

View File

@@ -268,12 +268,16 @@ public class ShopAccountServiceImpl implements ShopAccountService {
@Transactional(rollbackFor = Exception.class)
public Boolean handleOldData() {
List<ShopInfoDO> shopList = shopInfoDAO.getListByTime();
if (CollectionUtils.isEmpty(shopList)) {
return false;
}
Map<String, List<ShopInfoDO>> shopMap = shopList.stream().collect(Collectors.groupingBy(ShopInfoDO::getPartnerId));
Set<String> partnerIds = shopList.stream().map(ShopInfoDO::getPartnerId).collect(Collectors.toSet());
Set<Long> lineIdSet = shopList.stream().map(ShopInfoDO::getLineId).collect(Collectors.toSet());
List<HyPartnerUserInfoDO> hyPartnerUserInfoDOS = hyPartnerUserInfoDAO.selectByPartnerIds(new ArrayList<>(partnerIds));
List<QualificationsInfoDO> qualificationsInfoDOList = qualificationsInfoDAO.getByLineIds(new ArrayList<>(lineIdSet));
Map<String, QualificationsInfoDO> qualificationsInfoDOMap = qualificationsInfoDOList.stream().collect(Collectors.toMap(QualificationsInfoDO::getPartnerId, Function.identity()));
List<ShopAccountDO> updateList = new ArrayList<>();
for (HyPartnerUserInfoDO hyPartnerUserInfoDO : hyPartnerUserInfoDOS) {
QualificationsInfoDO qualificationsInfoDO = qualificationsInfoDOMap.get(hyPartnerUserInfoDO.getPartnerId());
List<ShopInfoDO> shopInfos = shopMap.get(hyPartnerUserInfoDO.getPartnerId());
@@ -293,12 +297,17 @@ public class ShopAccountServiceImpl implements ShopAccountService {
hyPartnerUserInfoDO.setDownstreamSystemSecondaryPassword(downstreamSystemSecondaryPassword);
//循环修改 门店账户表
for (ShopAccountDO shopAccountDO : accountDOList) {
hyPartnerUserInfoDO.setDownstreamSystemPassword(shopAccountDO.getPassword());
hyPartnerUserInfoDO.setDownstreamSystemSalting(shopAccountDO.getPasswordSalt());
hyPartnerUserInfoDO.setDownstreamSystemSecondaryPassword(shopAccountDO.getSecondaryPassword());
if (shopAccountDO.getSystemName().equals(ShopAccountEnum.YLS.getSystemName())
|| shopAccountDO.getSystemName().equals(ShopAccountEnum.XZG.getSystemName())
|| shopAccountDO.getSystemName().equals(ShopAccountEnum.HUOMA.getSystemName())) {
shopAccountDO.setPassword(password);
shopAccountDO.setPasswordSalt(salt);
shopAccountDO.setSecondaryPassword(downstreamSystemSecondaryPassword);
updateList.add(shopAccountDO);
}
}
shopAccountDAO.dateHandle(accountDOList);
}
shopAccountDAO.dateHandle(updateList);
hyPartnerUserInfoDAO.dataHandle(hyPartnerUserInfoDOS);
return true;
}

View File

@@ -73,6 +73,12 @@ public class ShopAccountController {
return ResponseResult.success(accountService.accountEntryStatusChange(dto));
}
@ApiOperation("密码数据处理")
@GetMapping("/handleOldData")
public ResponseResult<Boolean> handleOldData() {
return ResponseResult.success(accountService.handleOldData());
}
}