Commit f2920c14 authored by 332784038@qq.com's avatar 332784038@qq.com

Merge remote-tracking branch 'origin/dev' into dev

parents 2e9e848c fbd88a3f
-- 添加新字段
alter table `ecw_customer` add column `no_consignee` bit(1) NOT NULL DEFAULT b'0' COMMENT '控货无收货人';
alter table `ecw_customer` add column `default_pay` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否默认付款';
-- 添加新字段
alter table `ecw_warehouse` add column `rent_free_days` int DEFAULT NULL COMMENT '仓库免租期';
alter table `ecw_warehouse` add column `lock_recipient_days` int DEFAULT NULL COMMENT '锁定收货人天数';
......@@ -98,8 +98,8 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
"left join ecw_country country on c.country = country.id",
"left join ecw_product_type pt on c.product_type = pt.id",
"left join system_user u on c.customer_service = u.id",
"left join system_user uc on c.creator = u.id",
"left join system_user uu on c.updater = u.id",
"left join system_user uc on c.creator = uc.id",
"left join system_user uu on c.updater = uu.id",
"where c.id = #{id}",
"</script>"
})
......
......@@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.member.controller.app.user;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.validation.PhoneUtil;
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;
......@@ -11,13 +10,11 @@ import cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.Customer
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.region.RegionDO;
import cn.iocoder.yudao.module.ecw.service.internalMessage.InternalMessageService;
import cn.iocoder.yudao.module.ecw.service.internalMessage.WebInternalMessageService;
import cn.iocoder.yudao.module.ecw.service.region.RegionService;
import cn.iocoder.yudao.module.member.controller.app.auth.vo.AppEmailUpdateReqVO;
import cn.iocoder.yudao.module.member.service.level.MemberUserLevelConfigService;
import cn.iocoder.yudao.module.member.vo.member.MemberUpdateReqVO;
import cn.iocoder.yudao.module.member.controller.app.user.vo.*;
import cn.iocoder.yudao.module.member.controller.app.userScore.vo.AppMemberUserScoreInfoRespVO;
import cn.iocoder.yudao.module.member.convert.user.UserConvert;
import cn.iocoder.yudao.module.member.convert.userCardAuth.UserCardAuthConvert;
import cn.iocoder.yudao.module.member.convert.userEnterprise.UserEnterpriseConvert;
......@@ -27,10 +24,13 @@ import cn.iocoder.yudao.module.member.dal.dataobject.userCardAuth.UserCardAuthDO
import cn.iocoder.yudao.module.member.dal.dataobject.userEnterprise.UserEnterpriseDO;
import cn.iocoder.yudao.module.member.dal.dataobject.userEnterpriseAuth.UserEnterpriseAuthDO;
import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.member.service.level.MemberUserLevelConfigService;
import cn.iocoder.yudao.module.member.service.score.MemberUserScoreService;
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
import cn.iocoder.yudao.module.member.service.userCardAuth.UserCardAuthService;
import cn.iocoder.yudao.module.member.service.userEnterprise.UserEnterpriseService;
import cn.iocoder.yudao.module.member.service.userEnterpriseAuth.UserEnterpriseAuthService;
import cn.iocoder.yudao.module.member.vo.member.MemberUpdateReqVO;
import cn.iocoder.yudao.module.member.vo.userCardAuth.UserCardAuthBackVO;
import cn.iocoder.yudao.module.member.vo.userCardAuth.UserCardAuthCreateReqVO;
import cn.iocoder.yudao.module.member.vo.userEnterprise.UserEnterpriseBackVO;
......@@ -38,12 +38,9 @@ import cn.iocoder.yudao.module.member.vo.userEnterprise.UserEnterpriseCreateReqV
import cn.iocoder.yudao.module.member.vo.userEnterprise.UserEnterpriseUpdateReqVO;
import cn.iocoder.yudao.module.member.vo.userEnterpriseAuth.UserEnterpriseAuthBackVO;
import cn.iocoder.yudao.module.member.vo.userEnterpriseAuth.UserEnterpriseAuthCreateReqVO;
import cn.iocoder.yudao.module.member.vo.userLevel.MemberUserLevelConfigBaseRespVO;
import cn.iocoder.yudao.module.member.vo.userLevel.MemberUserScoreLevelVO;
import cn.iocoder.yudao.module.product.service.coupon.CouponService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
......@@ -54,11 +51,9 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
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;
......@@ -109,6 +104,9 @@ public class AppUserController {
@Resource
private RegionService regionService;
@Resource
private MemberUserScoreService memberUserScoreService;
@PutMapping("/update-nickname")
@ApiOperation("修改用户昵称")
......@@ -157,16 +155,9 @@ public class AppUserController {
if (passwordEncoder.matches("88888888", user.getPassword())) {
respVO.setIsSimplePassword(Boolean.TRUE);
}
MemberUserLevelConfigBaseRespVO userScoreLevelVO = memberUserLevelConfigService.getLevelByCount(user.getTotalScore());
MemberUserScoreLevelVO scoreLevelVO = MemberUserScoreLevelVO.builder().memberId(user.getId())
.memberCode(user.getMemberCode())
.holdScore(user.getHoldScore())
.expiredScore(user.getExpiredScore())
.usedScore(user.getUsedScore())
.levelIcon(userScoreLevelVO.getIcon())
.levelName(userScoreLevelVO.getName())
.build();
respVO.setUserScoreLevelInfo(scoreLevelVO);
//获取用户积分信息
AppMemberUserScoreInfoRespVO userScoreInfo = memberUserScoreService.getUserScoreInfo(user.getId());
respVO.setUserScoreLevelInfo(userScoreInfo);
if (user.getCountry() != null) {
RegionDO region = regionService.getRegion(Long.valueOf(user.getCountry()));
respVO.setCountryTitleEn(region.getTitleEn());
......
package cn.iocoder.yudao.module.member.controller.app.user.vo;
import cn.iocoder.yudao.module.member.vo.userLevel.MemberUserScoreLevelVO;
import cn.iocoder.yudao.module.member.controller.app.userScore.vo.AppMemberUserScoreInfoRespVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -10,7 +10,6 @@ import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
......@@ -69,7 +68,7 @@ public class AppUserInfoRespVO {
private Boolean isSimplePassword = Boolean.FALSE;
@ApiModelProperty(value = "会员积分信息")
private MemberUserScoreLevelVO userScoreLevelInfo;
private AppMemberUserScoreInfoRespVO userScoreLevelInfo;
@ApiModelProperty(value = "会员国家id")
private Integer country;
@ApiModelProperty(value = "会员国家中文")
......
......@@ -40,7 +40,7 @@ public class AppMemberUserScoreController {
@ApiOperation("获得会员积分基本信息")
//@PreAuthenticated
public CommonResult<AppMemberUserScoreInfoRespVO> getUserScoreInfo(@Valid @RequestBody AppMemberUserIdQueryVO idQuery) {
AppMemberUserScoreInfoRespVO scoreInfo = userScoreService.getUserScoreInfo(idQuery);
AppMemberUserScoreInfoRespVO scoreInfo = userScoreService.getUserScoreInfo(idQuery.getId());
return success(scoreInfo);
}
......
......@@ -27,4 +27,6 @@ public class AppMemberUserScoreInfoRespVO {
private Integer lowerCount;
@ApiModelProperty(value = "积分范围 上界")
private Integer upperCount;
@ApiModelProperty(value = "图标")
private String levelIcon;
}
......@@ -55,8 +55,8 @@ public interface MemberUserScoreService extends IService<MemberUserScoreDO> {
/**
* 获取会员积分及会员等级信息
* @param id
* @param memberId
* @return
*/
AppMemberUserScoreInfoRespVO getUserScoreInfo(AppMemberUserIdQueryVO id);
AppMemberUserScoreInfoRespVO getUserScoreInfo(Long memberId);
}
......@@ -110,14 +110,14 @@ public class MemberUserScoreServiceImpl extends AbstractService<MemberUserScoreM
}
@Override
public AppMemberUserScoreInfoRespVO getUserScoreInfo(AppMemberUserIdQueryVO id) {
MemberUserScoreDO userScoreDO = userScoreMapper.getByMemberId(id.getId());
public AppMemberUserScoreInfoRespVO getUserScoreInfo(Long memberId) {
MemberUserScoreDO userScoreDO = userScoreMapper.getByMemberId(memberId);
Integer userScoreTotal = 0;
AppMemberUserScoreInfoRespVO infoRespVO;
if (userScoreDO == null) {
infoRespVO = AppMemberUserScoreInfoRespVO.builder()
.holdScore(0)
.id(id.getId())
.id(memberId)
.totalScore(userScoreTotal)
.usedScore(0)
.build();
......@@ -125,7 +125,7 @@ public class MemberUserScoreServiceImpl extends AbstractService<MemberUserScoreM
userScoreTotal = userScoreDO.getHoldScore() + userScoreDO.getUsedScore() + userScoreDO.getExpiredScore();
infoRespVO = AppMemberUserScoreInfoRespVO.builder()
.holdScore(userScoreDO.getHoldScore())
.id(id.getId())
.id(memberId)
.totalScore(userScoreTotal)
.usedScore(userScoreDO.getUsedScore())
.build();
......@@ -135,6 +135,7 @@ public class MemberUserScoreServiceImpl extends AbstractService<MemberUserScoreM
infoRespVO.setLevelName(level.getName());
infoRespVO.setLowerCount(level.getLowerCount());
infoRespVO.setUpperCount(level.getUpperCount());
infoRespVO.setLevelIcon(level.getIcon());
}
return infoRespVO;
}
......
package cn.iocoder.yudao.module.member.service.user;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.StrUtil;
......@@ -259,7 +260,11 @@ public class MemberUserServiceImpl implements MemberUserService {
@Override
public MemberUserDO info(Long id) {
// 一个会员可能绑定了多个用户
return memberUserMapper.info(id).get(0);
List<MemberUserDO> info = memberUserMapper.info(id);
if (CollUtil.isEmpty(info)) {
return null;
}
return info.get(0);
}
@Override
......
......@@ -2272,24 +2272,12 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
String consignorPhone = orderConsignorDO.getPhone();
Long consignorCustomerId = orderConsignorDO.getCustomerId();
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId)
.last("limit 1"));
// 收货人 短信发送信息
String consigneeCountryCode = orderConsigneeDO.getCountryCode();
String consigneePhone = orderConsigneeDO.getPhone();
Long consigneeCustomerId = orderConsigneeDO.getCustomerId();
// 查询仓库
LogisticsInfoDto logisticsInfoDto = warehouseLineMapper.getStartInfoAndDestInfoByLineId(orderDO.getLineId());
String consignorStartWarehouseName = consignorCountryCode.equals("86") ? logisticsInfoDto.getStartTitleZh() : logisticsInfoDto.getStartTitleEn();
String consignorDestWearehouseName = consignorCountryCode.equals("86") ? logisticsInfoDto.getDestTitleZh() : logisticsInfoDto.getDestTitleEn();
String consigneeStartWarehouseName = consigneeCountryCode.equals("86") ? logisticsInfoDto.getStartTitleZh() : logisticsInfoDto.getStartTitleEn();
String consigneeDestWearehouseName = consigneeCountryCode.equals("86") ? logisticsInfoDto.getDestTitleZh() : logisticsInfoDto.getDestTitleEn();
DateTime ruchang = DateTime.of(orderDO.getRucangTime());
// 追加短信
......@@ -2396,22 +2384,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
consignorParamMap.put("cmb", chargeVolume);
consignorParamMap.put("kg", chargeWeight);
Map<String, Object> consigneeParamMap = new HashMap<>();
if (!StringUtils.equals(consignorCountryCode.concat(consignorPhone), consigneeCountryCode.concat(consigneePhone))) {
consigneeParamMap.put("date", DateUtils.formatDateTime(orderDO.getRucangTime()));
consigneeParamMap.put("cnts", orderDO.getSumNum()); // 多少箱
consigneeParamMap.put("warehouse", consigneeStartWarehouseName); // 入仓名
consigneeParamMap.put("year", ruchang.year());
consigneeParamMap.put("month", ruchang.month() + 1);
consigneeParamMap.put("day", ruchang.dayOfMonth());
consigneeParamMap.put("order", orderDO.getOrderNo()); // orderNo
consigneeParamMap.put("branch", consigneeDestWearehouseName); // 提货点
consigneeParamMap.put("box", orderDO.getSumNum()); // 多少箱
consigneeParamMap.put("marks", marks);
consigneeParamMap.put("cmb", chargeVolume);
consigneeParamMap.put("kg", chargeWeight);
}
if (orderDO.getIsCollection()) {
Map<Integer, CurrencyRespDTO> currencyRespDTOMap = currencyApi.getAllCurrency();
......@@ -2430,9 +2404,39 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
}
// 给发货人发送短信
this.smsSendNotice(consignorCountryCode, consignorPhone, consignorCustomerId, templateCode, consignorParamMap);
if (!StringUtils.equals(consignorCountryCode.concat(consignorPhone), consigneeCountryCode.concat(consigneePhone))) {
// 给收货人发送短信
this.smsSendNotice(consigneeCountryCode, consigneePhone, consigneeCustomerId, templateCode, consigneeParamMap);
// 收货人 短信发送信息
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId)
.last("limit 1"));
if (orderConsigneeDO != null) {
String consigneeCountryCode = orderConsigneeDO.getCountryCode();
String consigneePhone = orderConsigneeDO.getPhone();
Long consigneeCustomerId = orderConsigneeDO.getCustomerId();
String consigneeStartWarehouseName = consigneeCountryCode.equals("86") ? logisticsInfoDto.getStartTitleZh() : logisticsInfoDto.getStartTitleEn();
String consigneeDestWearehouseName = consigneeCountryCode.equals("86") ? logisticsInfoDto.getDestTitleZh() : logisticsInfoDto.getDestTitleEn();
if (!StringUtils.equals(consignorCountryCode.concat(consignorPhone), consigneeCountryCode.concat(consigneePhone))) {
consigneeParamMap.put("date", DateUtils.formatDateTime(orderDO.getRucangTime()));
consigneeParamMap.put("cnts", orderDO.getSumNum()); // 多少箱
consigneeParamMap.put("warehouse", consigneeStartWarehouseName); // 入仓名
consigneeParamMap.put("year", ruchang.year());
consigneeParamMap.put("month", ruchang.month() + 1);
consigneeParamMap.put("day", ruchang.dayOfMonth());
consigneeParamMap.put("order", orderDO.getOrderNo()); // orderNo
consigneeParamMap.put("branch", consigneeDestWearehouseName); // 提货点
consigneeParamMap.put("box", orderDO.getSumNum()); // 多少箱
consigneeParamMap.put("marks", marks);
consigneeParamMap.put("cmb", chargeVolume);
consigneeParamMap.put("kg", chargeWeight);
}
if (!StringUtils.equals(consignorCountryCode.concat(consignorPhone), consigneeCountryCode.concat(consigneePhone))) {
// 给收货人发送短信
this.smsSendNotice(consigneeCountryCode, consigneePhone, consigneeCustomerId, templateCode, consigneeParamMap);
}
}
}
......@@ -2482,7 +2486,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// 收货人
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
if (orderConsigneeDO.getCustomerId() != null) {
if (orderConsigneeDO != null && orderConsigneeDO.getCustomerId() != null) {
Long consigneeUserId = getUserId(orderConsigneeDO.getCustomerId());
if (consigneeUserId != null) {
internalMsgUserIdSet.add(consigneeUserId);
......
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