From 051be1469ae7ddaa1c4c9c8edda1b1f6fc37d33b Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Mon, 9 Sep 2024 04:14:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E9=85=8D=E8=B4=A7=E5=BC=80=E5=8D=95?= =?UTF-8?q?=E6=8A=A5=E9=94=99=EF=BC=8C=E5=88=86=E4=BA=AB=E9=A1=B5=E4=B8=8B?= =?UTF-8?q?=E5=8D=95=EF=BC=8C=E5=AE=A2=E6=88=B7=E6=B2=A1=E6=9C=89=E6=AC=A0?= =?UTF-8?q?=E6=AC=BE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 10 ++--- hiver-admin/test-output/test-report.html | 16 ++++---- .../mapper/LogisticsEntruckingLogMapper.xml | 2 +- .../hiver/mall/controller/SaleController.java | 40 +++++++++++++++++++ .../entity/CustomerCategory.java | 3 ++ 5 files changed, 57 insertions(+), 14 deletions(-) diff --git a/hiver-admin/src/main/resources/application.yml b/hiver-admin/src/main/resources/application.yml index c3edbcd8..4c127a6f 100644 --- a/hiver-admin/src/main/resources/application.yml +++ b/hiver-admin/src/main/resources/application.yml @@ -25,8 +25,8 @@ spring: timeout-per-shutdown-phase: 10S # 数据源 datasource: - url: jdbc:mysql://154.8.162.157:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true -# url: jdbc:mysql://8.140.198.243:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true +# url: jdbc:mysql://154.8.162.157:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true + url: jdbc:mysql://8.140.198.243:3306/hiver_shop?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8&allowPublicKeyRetrieval=true&allowMultiQueries=true username: reddoor # Jasypt加密 可到common-utils中找到JasyptUtil加解密工具类生成加密结果 格式为ENC(加密结果) 以下解密结果为123456 password: ENC(Zla4U4+yRLPhicvuX2TmiEgxEpzP4dk8BHzFDEtiEhwLQIIaftZrrEUJZce6efoe) @@ -67,8 +67,8 @@ spring: ddl-auto: update # Redis 若设有密码自行添加配置password redis: - host: 154.8.162.157 -# host: 8.140.198.243 +# host: 154.8.162.157 + host: 8.140.198.243 password: reddoor168 # 数据库索引 默认0 database: 1 @@ -338,7 +338,7 @@ ignored: - /hiver/app/logisticsOrder/getLogisticsOrderDetail - /hiver/app/customer/findByUserPhoneAndShopId # 分享页获取店铺分类 - - app/productCategory/listByShopId + - /hiver/app/productCategory/listByShopId # 临时增加 - /hiver/app/logisticsOrder/addLogisticsOrder diff --git a/hiver-admin/test-output/test-report.html b/hiver-admin/test-output/test-report.html index 0e17e5c6..03c2ceec 100644 --- a/hiver-admin/test-output/test-report.html +++ b/hiver-admin/test-output/test-report.html @@ -35,7 +35,7 @@ Hiver
  • - 07, 2024 16:05:02 + 08, 2024 15:39:34
  • @@ -84,7 +84,7 @@

    passTest

    -

    16:05:02 / 0.017 secs

    +

    15:39:35 / 0.026 secs

    @@ -92,9 +92,9 @@
    #test-id=1
    passTest
    -09.07.2024 16:05:02 -09.07.2024 16:05:02 -0.017 secs +09.08.2024 15:39:35 +09.08.2024 15:39:35 +0.026 secs
    @@ -104,7 +104,7 @@ Pass - 16:05:02 + 15:39:35 Test passed @@ -128,13 +128,13 @@

    Started

    -

    07, 2024 16:05:02

    +

    08, 2024 15:39:34

    Ended

    -

    07, 2024 16:05:02

    +

    08, 2024 15:39:35

    diff --git a/hiver-core/src/main/resources/mapper/LogisticsEntruckingLogMapper.xml b/hiver-core/src/main/resources/mapper/LogisticsEntruckingLogMapper.xml index 326d0939..de93444d 100644 --- a/hiver-core/src/main/resources/mapper/LogisticsEntruckingLogMapper.xml +++ b/hiver-core/src/main/resources/mapper/LogisticsEntruckingLogMapper.xml @@ -178,7 +178,7 @@ and create_time BETWEEN #{nowDate} AND #{afterDay} - SELECT SUM(t.car_fee) AS total_loading_fee, SUM(t.car_freight) AS total_transportation_fee diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java index 686de90a..5c6ae24d 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/SaleController.java @@ -2,6 +2,7 @@ package cc.hiver.mall.controller; import cc.hiver.core.common.annotation.RateLimiter; import cc.hiver.core.common.constant.CommonConstant; +import cc.hiver.core.common.constant.DealingsRecordConstant; import cc.hiver.core.common.constant.SaleConstant; import cc.hiver.core.common.constant.WorkerConstant; import cc.hiver.core.common.utils.BeanUtils; @@ -16,6 +17,7 @@ import cc.hiver.core.service.LogiticsCompanyService; import cc.hiver.core.service.WorkerService; import cc.hiver.core.vo.WorkerQueryVO; import cc.hiver.mall.common.constant.OrderConstant; +import cc.hiver.mall.debt.constant.DebtConstant; import cc.hiver.mall.debt.entity.Debt; import cc.hiver.mall.debt.service.DebtService; import cc.hiver.mall.entity.*; @@ -139,12 +141,50 @@ public class SaleController { // 设置店铺id为缓存中的内容 // shopId从缓存中设置 final String shopId = securityUtil.getShopId(); + final Shop shop = shopService.get(shopId); saleQueryDTO.getSale().setShopId(shopId); saleQueryDTO.getSale().setShopName(shop.getShopName()); // 根据该客户的欠款信息 final String userId = saleQueryDTO.getSale().getUserId(); final Debt debt = debtService.selectByUserId(shopId, userId); + // 20240908 如果没有查询到下游客户欠款,那么就新增一条初始欠款 + if (ObjectUtils.isEmpty(debt)) { + final User user = securityUtil.getCurrUser(); + final Debt addDebt = new Debt(); + addDebt.setCreateBy(user.getId()); + addDebt.setCreateTime(new Date()); + addDebt.setUserId(userId); + addDebt.setShopId(shopId); + addDebt.setUserPhone(saleQueryDTO.getMobile()); + addDebt.setUserAdress(saleQueryDTO.getSale().getReceiveAddress()); + addDebt.setUserName(saleQueryDTO.getSale().getUserName()); + addDebt.setAmountOwed(BigDecimal.ZERO); + addDebt.setUserType(DebtConstant.USER_TYPE[0]); + debtService.save(addDebt); + // 新增交易记录 + // 2. 新增欠款记录 + final DealingsRecord dealingsRecord = new DealingsRecord(); + dealingsRecord.setCreateBy(user.getId()); + dealingsRecord.setCreateByName(user.getNickname()); + dealingsRecord.setCreateTime(new Date()); + dealingsRecord.setDealingsUserId(saleQueryDTO.getSale().getUserId()); + dealingsRecord.setDealingsUserName(saleQueryDTO.getSale().getUserName()); + dealingsRecord.setUserType(DealingsRecordConstant.TYPE[1]); + dealingsRecord.setDealingsWay("新增客户"); + dealingsRecord.setShopId(shopId); + // 销售金额 + dealingsRecord.setSaleAmount(BigDecimal.ZERO); + // 退货金额 + dealingsRecord.setReturnAmount(BigDecimal.ZERO); + // 上次欠款 + dealingsRecord.setLastDebtAmount(BigDecimal.ZERO); + // 最新欠款 + dealingsRecord.setBalanceDue(BigDecimal.ZERO); + dealingsRecord.setAmount(BigDecimal.ZERO); + dealingsRecord.setDealingsType(DealingsRecordConstant.DEALINGS_TYPE[3]); + dealingsRecordService.save(dealingsRecord); + } final BigDecimal amountOwed = debt.getAmountOwed(); // 20240616 开单可能值包含退货单 Sale sale = saleQueryDTO.getSale(); diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/entity/CustomerCategory.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/entity/CustomerCategory.java index 9df2e358..9074907b 100644 --- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/entity/CustomerCategory.java +++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/customercategory/entity/CustomerCategory.java @@ -20,6 +20,9 @@ import lombok.EqualsAndHashCode; public class CustomerCategory extends HiverBaseEntity { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "创建人姓名") + private String createByName; + @ApiModelProperty(value = "店铺id") private String shopId;