推广员

pull/2/head
perry 2023-05-23 10:30:53 +08:00
parent 1f3d68faf0
commit 1098528193
5 changed files with 73 additions and 0 deletions

View File

@ -52,6 +52,8 @@ import cn.iocoder.yudao.module.shop.utils.RedisUtil;
import cn.iocoder.yudao.module.shop.vo.order.LogisticsResultVo;
import cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram;
import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoOldVo;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import com.alipay.api.AlipayApiException;
import com.alipay.api.internal.util.AlipaySignature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@ -147,6 +149,8 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
@Autowired
private WxMpService wxMpService;
private DeptApi deptApi;
/**
* PC
*
@ -1360,6 +1364,12 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
private RechargeOrderDO initializeOrder(OrderContentRequest request, String code, MemberUserRespDTO user, PromoterDTO promoterDTO) {
Long tenantId = TenantContextHolder.getTenantId();
Long deptId = promoterDTO.getDeptId();
if(deptId==null){
DeptRespDTO deptRespDTO = deptApi.findParentDept(tenantId);
deptId = deptRespDTO.getId();
}
RechargeOrderDO orderDO = new RechargeOrderDO();
List<OrderContentRequest.OrderInfo> orderInfos = request.getOrderInfos();
orderDO.setOrderId(code);

View File

@ -48,6 +48,18 @@ public interface DeptApi {
*/
void validateDeptList(Collection<Long> ids);
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:38
* @param :
* @return
* </pre>
*/
DeptRespDTO findParentDept(Long tenantId);
/**
* Map
*

View File

@ -38,6 +38,22 @@ public class DeptApiImpl implements DeptApi {
List<DeptDO> depts = deptService.getDeptList(new DeptListReqVO());
return DeptConvert.INSTANCE.convertList03(depts);
}
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:38
* @return
* </pre>
*/
@Override
public DeptRespDTO findParentDept(Long tenantId) {
DeptDO deptDO = deptService.findParentDept(tenantId );
return DeptConvert.INSTANCE.convert03(deptDO);
}
@Override
public void validateDeptList(Collection<Long> ids) {
deptService.validateDeptList(ids);

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.dept;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO;
@ -54,6 +55,18 @@ public interface DeptService {
*/
List<DeptDO> getDeptList(DeptListReqVO reqVO);
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:40
* @param tenantId:
* @return
* </pre>
*/
DeptDO findParentDept(Long tenantId);
/**
*
*

View File

@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO;
@ -13,6 +14,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper;
import cn.iocoder.yudao.module.system.enums.dept.DeptIdEnum;
import cn.iocoder.yudao.module.system.mq.producer.dept.DeptProducer;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
@ -152,6 +154,26 @@ public class DeptServiceImpl implements DeptService {
return deptMapper.selectList(reqVO);
}
/**
* <pre>
* <b>findParentDept</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/5/23 09:40
* @param tenantId :
* @return
* </pre>
*/
@Override
public DeptDO findParentDept(Long tenantId) {
List<DeptDO> deptDOs = deptMapper.selectList(Wrappers.lambdaQuery(DeptDO.class).eq(DeptDO::getParentId,DeptIdEnum.ROOT.getId()).eq(DeptDO::getTenantId,tenantId));
if(deptDOs!=null && deptDOs.size() > 0){
return deptDOs.get(0);
}
return null;
}
@Override
public List<DeptDO> getDeptListByParentIdFromCache(Long parentId, boolean recursive) {
if (parentId == null) {