Compare commits
3 Commits
8a02234dcc
...
ed9c2d43c0
| Author | SHA1 | Date |
|---|---|---|
|
|
ed9c2d43c0 | |
|
|
b283264d19 | |
|
|
4940ebddeb |
|
|
@ -35,7 +35,8 @@
|
||||||
"Bash(cat \"/e/code/智柜宝/shop-back-end/agileboot-domain/src/main/java/com/agileboot/domain/system/user/dto/UserDTO.java\")",
|
"Bash(cat \"/e/code/智柜宝/shop-back-end/agileboot-domain/src/main/java/com/agileboot/domain/system/user/dto/UserDTO.java\")",
|
||||||
"Bash(cat \"/e/code/智柜宝/shop-back-end/agileboot-domain/src/main/java/com/agileboot/domain/system/user/query/SearchUserQuery.java\")",
|
"Bash(cat \"/e/code/智柜宝/shop-back-end/agileboot-domain/src/main/java/com/agileboot/domain/system/user/query/SearchUserQuery.java\")",
|
||||||
"Bash(./mvnw clean compile -pl agileboot-api -am -DskipTests)",
|
"Bash(./mvnw clean compile -pl agileboot-api -am -DskipTests)",
|
||||||
"Bash(./mvnw clean compile -pl agileboot-api,agileboot-domain -am -DskipTests)"
|
"Bash(./mvnw clean compile -pl agileboot-api,agileboot-domain -am -DskipTests)",
|
||||||
|
"Bash(./mvnw clean compile -pl agileboot-domain -am -DskipTests)"
|
||||||
],
|
],
|
||||||
"deny": [],
|
"deny": [],
|
||||||
"ask": []
|
"ask": []
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ import com.agileboot.domain.qywx.authCorpInfo.AuthCorpInfoApplicationService;
|
||||||
import com.agileboot.domain.qywx.authCorpInfo.db.QyAuthCorpInfoEntity;
|
import com.agileboot.domain.qywx.authCorpInfo.db.QyAuthCorpInfoEntity;
|
||||||
import com.agileboot.domain.qywx.user.db.QyUserEntity;
|
import com.agileboot.domain.qywx.user.db.QyUserEntity;
|
||||||
import com.agileboot.domain.qywx.user.db.QyUserService;
|
import com.agileboot.domain.qywx.user.db.QyUserService;
|
||||||
|
import com.agileboot.domain.wx.user.db.WxUserEntity;
|
||||||
|
import com.agileboot.domain.wx.user.db.WxUserService;
|
||||||
import com.agileboot.domain.shop.approval.command.AddReturnApprovalCommand;
|
import com.agileboot.domain.shop.approval.command.AddReturnApprovalCommand;
|
||||||
import com.agileboot.domain.shop.approval.command.UpdateReturnApprovalCommand;
|
import com.agileboot.domain.shop.approval.command.UpdateReturnApprovalCommand;
|
||||||
import com.agileboot.domain.shop.approval.model.ReturnApprovalModel;
|
import com.agileboot.domain.shop.approval.model.ReturnApprovalModel;
|
||||||
|
|
@ -93,6 +95,7 @@ public class OrderApplicationService {
|
||||||
private final AccessTokenApplicationService accessTokenApplicationService;
|
private final AccessTokenApplicationService accessTokenApplicationService;
|
||||||
private final QyUserService qyUserService;
|
private final QyUserService qyUserService;
|
||||||
private final Ab98UserService ab98UserService;
|
private final Ab98UserService ab98UserService;
|
||||||
|
private final WxUserService wxUserService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private WxshopConfig wxshopConfig;
|
private WxshopConfig wxshopConfig;
|
||||||
|
|
||||||
|
|
@ -513,6 +516,14 @@ public class OrderApplicationService {
|
||||||
wrapper.or()
|
wrapper.or()
|
||||||
.eq("openid", ab98User.getOpenid());
|
.eq("openid", ab98User.getOpenid());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果该 ab98UserId 在 wx_user 表中存在绑定的微信用户,则查询条件再加上 openid
|
||||||
|
WxUserEntity wxUser = wxUserService.getByAb98UserId(ab98User.getAb98UserId());
|
||||||
|
if (wxUser != null && StringUtils.isNotBlank(wxUser.getOpenid())) {
|
||||||
|
// 添加 or 条件,根据 wx_user 表中的 openid 查询订单
|
||||||
|
wrapper.or()
|
||||||
|
.eq("openid", wxUser.getOpenid());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,10 @@ import com.agileboot.domain.wx.user.dto.WxUserDTO;
|
||||||
import com.agileboot.domain.wx.user.model.WxUserModel;
|
import com.agileboot.domain.wx.user.model.WxUserModel;
|
||||||
import com.agileboot.domain.wx.user.model.WxUserModelFactory;
|
import com.agileboot.domain.wx.user.model.WxUserModelFactory;
|
||||||
import com.agileboot.domain.wx.user.query.SearchWxUserQuery;
|
import com.agileboot.domain.wx.user.query.SearchWxUserQuery;
|
||||||
|
import com.agileboot.domain.qywx.user.db.QyUserEntity;
|
||||||
|
import com.agileboot.domain.qywx.user.db.QyUserService;
|
||||||
|
import com.agileboot.domain.qywx.user.dto.QyUserDTO;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -48,6 +52,8 @@ public class WxUserApplicationService {
|
||||||
|
|
||||||
private final Ab98UserApplicationService ab98UserApplicationService;
|
private final Ab98UserApplicationService ab98UserApplicationService;
|
||||||
|
|
||||||
|
private final QyUserService qyUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取微信用户列表(分页)
|
* 获取微信用户列表(分页)
|
||||||
*/
|
*/
|
||||||
|
|
@ -215,6 +221,32 @@ public class WxUserApplicationService {
|
||||||
userDTO = getUserDetailByOpenid(openid);
|
userDTO = getUserDetailByOpenid(openid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果该用户绑定了ab98UserId,则查询Ab98User信息并设置到DTO中
|
||||||
|
if (userDTO != null && userDTO.getAb98UserId() != null) {
|
||||||
|
Ab98UserEntity ab98UserEntity = ab98UserService.getById(userDTO.getAb98UserId());
|
||||||
|
if (ab98UserEntity != null) {
|
||||||
|
userDTO.setAb98Name(ab98UserEntity.getName());
|
||||||
|
userDTO.setAb98FaceImg(ab98UserEntity.getFaceImg());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询是否有企业微信用户绑定了该ab98UserId
|
||||||
|
LambdaQueryWrapper<QyUserEntity> qyWrapper = new LambdaQueryWrapper<>();
|
||||||
|
qyWrapper.eq(QyUserEntity::getAb98UserId, userDTO.getAb98UserId())
|
||||||
|
.eq(QyUserEntity::getDeleted, false);
|
||||||
|
QyUserEntity qyUserEntity = qyUserService.getOne(qyWrapper);
|
||||||
|
if (qyUserEntity != null) {
|
||||||
|
userDTO.setQyUserId(qyUserEntity.getId().longValue());
|
||||||
|
|
||||||
|
// 构建qyUser Map,包含id、userid、name、avatar字段
|
||||||
|
java.util.Map<String, Object> qyUserMap = new java.util.HashMap<>();
|
||||||
|
qyUserMap.put("id", qyUserEntity.getId());
|
||||||
|
qyUserMap.put("userid", qyUserEntity.getUserid());
|
||||||
|
qyUserMap.put("name", qyUserEntity.getName());
|
||||||
|
qyUserMap.put("avatar", qyUserEntity.getAvatar());
|
||||||
|
userDTO.setQyUser(qyUserMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return userDTO;
|
return userDTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,4 +62,12 @@ public interface WxUserService extends IService<WxUserEntity> {
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
boolean updateBalance(Long wxUserId, Integer balance);
|
boolean updateBalance(Long wxUserId, Integer balance);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ab98UserId获取微信用户
|
||||||
|
*
|
||||||
|
* @param ab98UserId 汇邦云用户ID
|
||||||
|
* @return 微信用户信息
|
||||||
|
*/
|
||||||
|
WxUserEntity getByAb98UserId(Long ab98UserId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,4 +98,17 @@ public class WxUserServiceImpl extends ServiceImpl<WxUserMapper, WxUserEntity> i
|
||||||
|
|
||||||
return this.updateById(entity);
|
return this.updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxUserEntity getByAb98UserId(Long ab98UserId) {
|
||||||
|
if (ab98UserId == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
LambdaQueryWrapper<WxUserEntity> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(WxUserEntity::getAb98UserId, ab98UserId)
|
||||||
|
.eq(WxUserEntity::getDeleted, 0);
|
||||||
|
|
||||||
|
return this.getOne(wrapper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,4 +68,16 @@ public class WxUserDTO {
|
||||||
|
|
||||||
@ExcelColumn(name = "备注")
|
@ExcelColumn(name = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "汇邦云用户名")
|
||||||
|
private String ab98Name;
|
||||||
|
|
||||||
|
@ExcelColumn(name = "汇邦云用户头像")
|
||||||
|
private String ab98FaceImg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业微信用户信息Map
|
||||||
|
* 包含: id, userid, name, avatar
|
||||||
|
*/
|
||||||
|
private Object qyUser;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue