From 3702a8b4ef17088e93177b0377b7aa4f03b674b6 Mon Sep 17 00:00:00 2001 From: perry <292303709@qq.com> Date: Tue, 30 May 2023 16:29:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=95=86=E9=93=BA=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/recharge/vo/RechargeOrderPageReqVO.java | 3 ++- .../controller/admin/recharge/vo/RechargeOrderRespVO.java | 3 +++ .../main/resources/mapper/recharge/RechargeOrderMapper.xml | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java index 198f403f2..6bc814b09 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java @@ -22,7 +22,8 @@ public class RechargeOrderPageReqVO extends PageParam { @Schema(description = "租户id") private Long tenantId; - + @Schema(description = "商铺名称") + private String tenantName; @Schema(description = "用户id", example = "28969") private Long uid; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java index f6e623234..fb0abb9bd 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java @@ -19,6 +19,9 @@ public class RechargeOrderRespVO extends RechargeOrderBaseVO { private String stringCreateTime; @Schema(description = "档次") private String grade; + + @Schema(description = "商铺名称") + private String tenantName; @Schema(description = "组织名称") private String parentOrganizationName; @Schema(description = "推广员名称") diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml index 251b272c5..81c55329f 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml @@ -39,6 +39,7 @@ select a.order_id, a.pay_serial_number, + e.name as tenantName, a.out_trade_no, a.pay_time, b.nickname, @@ -54,6 +55,7 @@ from cy_recharge_order a left join member_user b on a.promoter_id = b.id left join system_dept d on d.id = a.dept_id + left join system_tenant e on e.id = a.tenant_id @@ -108,6 +110,9 @@ and a.tenant_id =#{data.tenantId} + + and d.name like CONCAT('%',#{data.tenantName},'%') + and a.pay_serial_number like CONCAT('%',#{data.paySerialNumber},'%') From e1920cc1eedd70426034dbf6bb4aa0ebbc0c2617 Mon Sep 17 00:00:00 2001 From: tangqian Date: Tue, 30 May 2023 17:01:17 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E5=BC=82=E5=B8=B8=E5=8A=A0=E4=B8=8A?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recharge/vo/RechargeOrderRespVO.java | 7 +- .../recharge/RechargeOrderServiceImpl.java | 9 +- .../controller/admin/dept/DeptController.java | 2 +- .../system/service/dept/DeptService.java | 2 +- .../system/service/dept/DeptServiceImpl.java | 141 +++++++----------- 5 files changed, 69 insertions(+), 92 deletions(-) diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java index f6e623234..19cfa99b9 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java @@ -1,7 +1,10 @@ package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; +import org.springframework.format.annotation.DateTimeFormat; + import java.time.LocalDateTime; @Schema(description = "管理后台 - 订单 Response VO") @@ -16,7 +19,9 @@ public class RechargeOrderRespVO extends RechargeOrderBaseVO { @Schema(description = "创建时间") private LocalDateTime createTime; @Schema(description = "创建时间") - private String stringCreateTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime stringCreateTime; @Schema(description = "档次") private String grade; @Schema(description = "组织名称") diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java index cece4dc71..1e634f0a7 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java @@ -161,8 +161,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { } } orderDO.setGrade(grade.toString()); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - orderDO.setStringCreateTime(orderDO.getCreateTime().format(formatter)); + orderDO.setStringCreateTime(orderDO.getCreateTime()); } return rechargeOrderRespVOS; @@ -191,8 +190,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { } } orderDO.setGrade(grade.toString()); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - orderDO.setStringCreateTime(orderDO.getCreateTime().format(formatter)); + orderDO.setStringCreateTime(orderDO.getCreateTime()); } return new PageResult<>(page.getRecords(), page.getTotal()); @@ -277,8 +275,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { } } orderDO.setGrade(grade.toString()); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - orderDO.setStringCreateTime(orderDO.getCreateTime().format(formatter)); + orderDO.setStringCreateTime(orderDO.getCreateTime()); } return rechargeOrderRespVOS; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java index 3cc8debf5..e6d3bea38 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java @@ -88,7 +88,7 @@ public class DeptController { @Operation(summary = "批量组织架构导入") @PostMapping(value = "/batch/import", name = "批量组织架构导入") - public CommonResult batchImport(@RequestParam("file") MultipartFile file) throws IOException { + public CommonResult batchImport(@RequestParam("file") MultipartFile file){ deptService.batchImport(file); return success(true); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java index 9008610a2..5fec22339 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java @@ -117,5 +117,5 @@ public interface DeptService { */ void validateDeptList(Collection ids); - void batchImport(MultipartFile file) throws IOException; + void batchImport(MultipartFile file); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java index 31edc3097..b3f71d51d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java @@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; 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.BatchImportVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; @@ -19,7 +18,6 @@ import cn.iocoder.yudao.module.system.util.TransactionalService; import com.alibaba.excel.EasyExcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.IdWorker; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.ImmutableMap; @@ -28,9 +26,8 @@ import com.google.common.collect.Multimap; import lombok.Getter; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.validation.annotation.Validated; import org.springframework.web.multipart.MultipartFile; @@ -325,87 +322,65 @@ public class DeptServiceImpl implements DeptService { private static List deptDOS4 = new ArrayList<>(); @Override - public void batchImport(MultipartFile file) throws IOException { - List list = ExcelUtils.read(file, BatchImportVO.class); + public void batchImport(MultipartFile file){ + try { - EasyExcel.read(file.getInputStream(), BatchImportVO.class, new AnalysisEventListener() { + List deptList = ExcelUtils.read(file, BatchImportVO.class); - private final List deptList = new ArrayList<>(10000); - - @Override - public void invoke(BatchImportVO o, AnalysisContext analysisContext) { - deptList.add(o); - if (deptList.size() % 15 == 0) { - batchInsert(); - deptList.clear(); - } - } - - @Override - public void doAfterAllAnalysed(AnalysisContext analysisContext) { - if (CollectionUtils.isNotEmpty(deptList)) { - batchInsert(); - } - } - - private void batchInsert() { - Map> collect = deptList.stream().collect(Collectors.groupingBy(BatchImportVO::getHierarchy)); - List batchImportVOS1 = collect.get("1"); - List batchImportVOS2 = collect.get("2"); - List batchImportVOS3 = collect.get("3"); - List batchImportVOS4 = collect.get("4"); - transactionalService.run(() -> { - // 装入层级1 - BatchImportVO batchImportVO1 = batchImportVOS1.get(0); - DeptDO deptDO1 = new DeptDO(); - deptDO1.setParentId(0L); - deptDO1.setName(batchImportVO1.getDepName()); - deptDO1.setParentOrganizationName(batchImportVO1.getDepName()); - deptDO1.setCharacteristic(batchImportVO1.getCharacteristic()); - deptMapper.insert(deptDO1); - deptDO1.setParentOrganizationIds(deptDO1.getId().toString()); - deptMapper.updateById(deptDO1); - // 装入层级2 - for (BatchImportVO batchImportVO : batchImportVOS2) { - DeptDO deptDO2 = new DeptDO(); - deptDO2.setName(batchImportVO.getDepName()); - deptDO2.setParentId(deptDO1.getId()); - deptDO2.setParentOrganizationName(deptDO1.getName() + "," + batchImportVO.getDepName()); - deptDO2.setCharacteristic(batchImportVO.getCharacteristic()); - deptMapper.insert(deptDO2); - deptDO2.setParentOrganizationIds(deptDO1.getId() + "," + deptDO2.getId()); - deptMapper.updateById(deptDO2); - deptDOS2.add(deptDO2); - } - // 装入层级3 - for (BatchImportVO batchImportVO : batchImportVOS3) { - DeptDO deptDO3 = new DeptDO(); - deptDO3.setName(batchImportVO.getDepName()); - List collect1 = deptDOS2.stream().filter(e -> e.getCharacteristic().equals(batchImportVO.getCharacteristic())).collect(Collectors.toList()); - DeptDO deptDO = collect1.get(0); - deptDO3.setParentId(deptDO.getId()); - deptDO3.setParentOrganizationName(deptDO.getName() + "," + batchImportVO.getDepName()); - deptMapper.insert(deptDO3); - deptDO3.setParentOrganizationIds(deptDO.getId() + "," + deptDO3.getId()); - deptMapper.updateById(deptDO3); - deptDOS3.add(deptDO3); - } - // 装入层级4 - for (BatchImportVO batchImportVO : batchImportVOS4) { - DeptDO deptDO4 = new DeptDO(); - deptDO4.setName(batchImportVO.getDepName()); - List collect1 = deptDOS3.stream().filter(e -> e.getCharacteristic().equals(batchImportVO.getCharacteristic())).collect(Collectors.toList()); - DeptDO deptDO = collect1.get(0); - deptDO4.setParentId(deptDO.getId()); - deptDO4.setParentOrganizationName(deptDO.getName() + "," + batchImportVO.getDepName()); - deptMapper.insert(deptDO4); - deptDO4.setParentOrganizationIds(deptDO.getId() + "," + deptDO4.getId()); - deptMapper.updateById(deptDO4); - deptDOS3.add(deptDO4); - } - }); - } - }).sheet().headRowNumber(1).doRead(); + Map> collect = deptList.stream().collect(Collectors.groupingBy(BatchImportVO::getHierarchy)); + List batchImportVOS1 = collect.get("1"); + List batchImportVOS2 = collect.get("2"); + List batchImportVOS3 = collect.get("3"); + List batchImportVOS4 = collect.get("4"); + // 装入层级1 + BatchImportVO batchImportVO1 = batchImportVOS1.get(0); + DeptDO deptDO1 = new DeptDO(); + deptDO1.setParentId(0L); + deptDO1.setName(batchImportVO1.getDepName()); + deptDO1.setParentOrganizationName(batchImportVO1.getDepName()); + deptDO1.setCharacteristic(batchImportVO1.getCharacteristic()); + deptMapper.insert(deptDO1); + deptDO1.setParentOrganizationIds(deptDO1.getId().toString()); + deptMapper.update(deptDO1,Wrappers.lambdaUpdate().eq(DeptDO::getId,deptDO1.getId())); + // 装入层级2 + for (BatchImportVO batchImportVO : batchImportVOS2) { + DeptDO deptDO2 = new DeptDO(); + deptDO2.setName(batchImportVO.getDepName()); + deptDO2.setParentId(deptDO1.getId()); + deptDO2.setParentOrganizationName(deptDO1.getParentOrganizationName() + "," + batchImportVO.getDepName()); + deptDO2.setCharacteristic(batchImportVO.getCharacteristic()); + deptMapper.insert(deptDO2); + deptDO2.setParentOrganizationIds(deptDO1.getParentOrganizationIds() + "," + deptDO2.getId()); + deptMapper.update(deptDO2,Wrappers.lambdaUpdate().eq(DeptDO::getId,deptDO2.getId())); + deptDOS2.add(deptDO2); + } + // 装入层级3 + for (BatchImportVO batchImportVO : batchImportVOS3) { + DeptDO deptDO3 = new DeptDO(); + deptDO3.setName(batchImportVO.getDepName()); + List collect1 = deptDOS2.stream().filter(e -> e.getCharacteristic().equals(batchImportVO.getRelation())).collect(Collectors.toList()); + DeptDO deptDO = collect1.get(0); + deptDO3.setParentId(deptDO.getId()); + deptDO3.setParentOrganizationName(deptDO.getParentOrganizationName() + "," + batchImportVO.getDepName()); + deptDO3.setCharacteristic(batchImportVO.getCharacteristic()); + deptMapper.insert(deptDO3); + deptDO3.setParentOrganizationIds(deptDO.getParentOrganizationIds() + "," + deptDO3.getId()); + deptMapper.update(deptDO3,Wrappers.lambdaUpdate().eq(DeptDO::getId,deptDO3.getId())); + deptDOS3.add(deptDO3); + } + // 装入层级4 + for (BatchImportVO batchImportVO : batchImportVOS4) { + DeptDO deptDO4 = new DeptDO(); + deptDO4.setName(batchImportVO.getDepName()); + List collect1 = deptDOS3.stream().filter(e -> e.getCharacteristic().equals(batchImportVO.getRelation())).collect(Collectors.toList()); + DeptDO deptDO = collect1.get(0); + deptDO4.setParentId(deptDO.getId()); + deptDO4.setParentOrganizationName(deptDO.getParentOrganizationName() + "," + batchImportVO.getDepName()); + deptMapper.insert(deptDO4); + deptDO4.setParentOrganizationIds(deptDO.getParentOrganizationIds() + "," + deptDO4.getId()); + deptMapper.update(deptDO4,Wrappers.lambdaUpdate().eq(DeptDO::getId,deptDO4.getId())); + deptDOS4.add(deptDO4); + } } catch (IOException e) { log.error("导入组织架构失败!", e); } finally { From c25c762385b9efc114e53230fab58e1ed9c1ec3a Mon Sep 17 00:00:00 2001 From: Jruome <2559028966@qq.com> Date: Tue, 30 May 2023 17:15:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?uniapp=20=E9=94=80=E5=94=AE=E4=B8=9A?= =?UTF-8?q?=E7=BB=A9=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-app/api/member.js | 14 ++++ yudao-ui-app/pages/sale_performance/index.vue | 78 +++++++++++------- yudao-ui-app/static/images/money2.png | Bin 8910 -> 10755 bytes .../static/images/tabbar/nav_icon_member.png | Bin 5472 -> 6095 bytes .../images/tabbar/nav_icon_member_active.png | Bin 11380 -> 9738 bytes yudao-ui-app/static/images/user_1.png | Bin 5656 -> 5632 bytes 6 files changed, 64 insertions(+), 28 deletions(-) diff --git a/yudao-ui-app/api/member.js b/yudao-ui-app/api/member.js index 5b62e3e21..3a93f9b33 100644 --- a/yudao-ui-app/api/member.js +++ b/yudao-ui-app/api/member.js @@ -62,3 +62,17 @@ export function memberTopUp(data) { export function memberApplyRefund(data) { return request.post('api/order/member/memberApplyRefund',data); } + +/** + * "获取当前登录账号为推广员的推广会员记录 + */ +export function promoterOrderInfo(data) { + return request.post('api/order/member/promoterOrderInfo',data); +} + +/** + * "获取当前登录发展会员数量统计 + */ +export function promoterOrderCount(type) { + return request.get(`api/order/member/promoterOrderCount?type=${type}`); +} diff --git a/yudao-ui-app/pages/sale_performance/index.vue b/yudao-ui-app/pages/sale_performance/index.vue index a5b104ab9..1d1d20557 100644 --- a/yudao-ui-app/pages/sale_performance/index.vue +++ b/yudao-ui-app/pages/sale_performance/index.vue @@ -2,9 +2,9 @@ - + @@ -16,7 +16,7 @@ 总计金额 - 2400 + {{orderDetail.totalAmount}} @@ -24,7 +24,7 @@ 已发展会员个数 - 10个 + {{orderDetail.memberCount}}个 @@ -33,7 +33,7 @@ 提成比例 - 5% + {{orderDetail.memberCommission}}% @@ -42,7 +42,7 @@ 预计提成金额 - 120 + {{parseFloat(orderDetail.totalAmount*(parseFloat(orderDetail.memberCommission) / 100))}} @@ -51,27 +51,23 @@ 流水明细 + + - 客户1 + {{item.nickname}} - ¥640.00 - - - - - 客户1 + ¥{{item.payPrice}} - ¥640.00 - - - - - 客户1 - - ¥640.00 - + + @@ -80,11 +76,12 @@