Commit 6c948192 authored by zhengyi's avatar zhengyi

web-app的用户信息中返回其客户档案部分设置数据,以提供给前端做发货等操作数据判断

parent 8673c525
......@@ -6,9 +6,12 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO;
import cn.iocoder.yudao.module.customer.service.customer.CustomerService;
import cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService;
import cn.iocoder.yudao.module.ecw.api.paramValid.ParamValidatorApi;
import cn.iocoder.yudao.module.ecw.dal.dataobject.country.CountryDO;
import cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO;
import cn.iocoder.yudao.module.ecw.service.internalMessage.WebInternalMessageService;
import cn.iocoder.yudao.module.ecw.service.region.RegionService;
......@@ -54,6 +57,7 @@ import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
......@@ -79,6 +83,8 @@ public class AppUserController {
@Resource
private CustomerContactsService customerContactsService;
@Resource
private CustomerService customerService;
@Resource
private UserEnterpriseAuthService userEnterpriseAuthService;
@Resource
......@@ -155,6 +161,29 @@ public class AppUserController {
if (passwordEncoder.matches("88888888", user.getPassword())) {
respVO.setIsSimplePassword(Boolean.TRUE);
}
// 根据会员ID获取客户联系人ID与客户ID,并返回部分客户档案设置
CustomerContactsDO customerContacts =
customerContactsService.getOne(new LambdaQueryWrapper<CustomerContactsDO>()
.and(we -> we.eq(CustomerContactsDO::getUserid, user.getId())
.or()
.eq(CustomerContactsDO::getPhoneNew, user.getMobile())
.eq(CustomerContactsDO::getAreaCode, user.getAreaCode())).eq(CustomerContactsDO::getDeleted, 0).last("limit 1"));
if (Objects.isNull(customerContacts)) {
respVO.setDefaultPay(Boolean.FALSE);
respVO.setNoConsignee(Boolean.FALSE);
}else {
CustomerDO customerDO = customerService.getCustomer(customerContacts.getCustomerId());
if (customerDO != null) {
respVO.setDefaultPay(customerDO.getDefaultPay());
respVO.setNoConsignee(customerDO.getNoConsignee());
respVO.setFirstDealTime(customerDO.getFirstDealTime());
}else {
respVO.setDefaultPay(Boolean.FALSE);
respVO.setNoConsignee(Boolean.FALSE);
}
}
//获取用户积分信息
AppMemberUserScoreInfoRespVO userScoreInfo = memberUserScoreService.getUserScoreInfo(user.getId());
respVO.setUserScoreLevelInfo(userScoreInfo);
......
......@@ -67,6 +67,17 @@ public class AppUserInfoRespVO {
@ApiModelProperty(value = "是否简单密码", example = "false")
private Boolean isSimplePassword = Boolean.FALSE;
@ApiModelProperty(value = "客户档案设置的是否默认付款:1 是 0 否")
private Boolean defaultPay ;
@ApiModelProperty(value = "客户档案设置的是否允许控货无收货人:1 是 0 否")
private Boolean noConsignee ;
@ApiModelProperty(value = "客户档案记录的首次成交时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date firstDealTime;
@ApiModelProperty(value = "会员积分信息")
private AppMemberUserScoreInfoRespVO userScoreLevelInfo;
@ApiModelProperty(value = "会员国家id")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment