|
@@ -360,6 +360,34 @@ public class DistributionSellerServiceImpl extends ServiceImpl<DistributionSelle
|
|
|
return this.save(inertData);
|
|
return this.save(inertData);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean insertBatchByAddBo(DistributionSellerAddBo bo) {
|
|
|
|
|
+ for(Long userId:bo.getUserIds()){
|
|
|
|
|
+ User user = iUserService.getOne(new LambdaQueryWrapper<User>()
|
|
|
|
|
+ .eq(User::getUserId,userId));
|
|
|
|
|
+ if(Validator.isEmpty(user.getIdCard())){
|
|
|
|
|
+ throw new CustomException(user.getUserId()+"没有身份证信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ DistributionSeller sellerIdCard = getOne(new LambdaQueryWrapper<DistributionSeller>()
|
|
|
|
|
+ .eq(DistributionSeller::getIdCard,EncryptHandler.encrypt(user.getIdCard())).last("limit 1"));
|
|
|
|
|
+ if(Validator.isNotEmpty(sellerIdCard)){
|
|
|
|
|
+ if(Validator.isEmpty(sellerIdCard.getUserId())){
|
|
|
|
|
+ sellerIdCard.setUserId(user.getUserId());
|
|
|
|
|
+ sellerIdCard.setUpdateTime(DateUtils.getNowTime());
|
|
|
|
|
+ updateById(sellerIdCard);
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ DistributionSellerAddBo bo1 = new DistributionSellerAddBo();
|
|
|
|
|
+ bo1.setIdCard(user.getIdCard());
|
|
|
|
|
+ bo1.setTelphone(user.getTelphone());
|
|
|
|
|
+ bo1.setRealname(user.getRealname());
|
|
|
|
|
+ insertByAddBo(bo1);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public Boolean updateByEditBo(DistributionSellerEditBo bo) {
|
|
public Boolean updateByEditBo(DistributionSellerEditBo bo) {
|
|
|
DistributionSeller update = BeanUtil.toBean(bo, DistributionSeller.class);
|
|
DistributionSeller update = BeanUtil.toBean(bo, DistributionSeller.class);
|