Răsfoiți Sursa

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

czh 2 ani în urmă
părinte
comite
5fcb33742d

+ 5 - 0
sckw-common/sckw-common-mongo/pom.xml

@@ -21,5 +21,10 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-mongodb</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 29 - 0
sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/enums/BusSumEnum.java

@@ -0,0 +1,29 @@
+package com.sckw.mongo.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
+@Getter
+public enum BusSumEnum {
+
+    VERIFICATION_CODE("VERIFICATION_CODE", "SMS_262585113", "验证码", "您的验证码为:${code},该验证码为平台重要凭证,请勿泄露于他人!");
+
+    private String type;
+
+    private String name;
+
+    private String title;
+
+    private String value;
+
+    public static String getNameByValue(String value) {
+        for (BusSumEnum entityEnum : BusSumEnum.values()) {
+            if (entityEnum.getValue().equals(value)) {
+                return entityEnum.getName();
+            }
+        }
+        return null;
+    }
+
+}

+ 376 - 0
sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/SckwLogisticsOrder.java

@@ -0,0 +1,376 @@
+package com.sckw.mongo.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author zk
+ * @desc MongoDB-物流订单信息
+ * @date 2023/7/8
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@Document(collection = "sckw_logistics_order")
+public class SckwLogisticsOrder{
+
+    /**
+     * 主键
+     */
+    @Id
+    private Long lOrderId;
+
+    /**
+     * 物流订单编号
+     */
+    private String lOrderNo;
+
+    /**
+     * 分包上级物流订单id
+     */
+    private Long lOrderPid;
+
+    /**
+     * 交易订单id(kwo_trade_order)
+     */
+    private Long tOrderId;
+
+    /**
+     * 交易订单编号(kwo_trade_order)
+     */
+    private String tOrderNo;
+
+    /**
+     * 结算周期(周结、月结、季结)
+     */
+    private Long settlementCycle;
+
+    /**
+     * 运价
+     */
+    private BigDecimal price;
+
+    /**
+     * 运价方式(元/吨、元/车)
+     */
+    private Long priceType;
+
+    /**
+     * 已委托量
+     */
+    private BigDecimal amount;
+
+    /**
+     * 单位(吨、方、箱、件)
+     */
+    private String unit;
+
+    /**
+     * 合理损耗
+     */
+    private BigDecimal loss;
+
+    /**
+     * 合理损耗单位(‰/kG)
+     */
+    private String lossUnit;
+
+    /**
+     * 商品价值(扣亏货值)
+     */
+    private BigDecimal goodsPrice;
+
+    /**
+     * 商品价值(扣亏货值)单位
+     */
+    private String goodsPriceUnit;
+
+    /**
+     * 卸货日期
+     */
+    private Date unloadTime;
+
+    /**
+     * 装货日期
+     */
+    private Date loadTime;
+
+    /**
+     * 分包量
+     */
+    private BigDecimal subcontractAmount;
+
+    /**
+     * 已委托量
+     */
+    private BigDecimal entrustAmount;
+
+    /**
+     * 卸货量
+     */
+    private BigDecimal unloadAmount;
+
+    /**
+     * 装货量
+     */
+    private BigDecimal loadAmount;
+
+    /**
+     * 忽略剩余量
+     */
+    private BigDecimal ignoreAmount;
+
+    /**
+     * 亏吨量
+     */
+    private BigDecimal deficitAmount;
+
+    /**
+     * 亏吨扣款
+     */
+    private BigDecimal deficitPrice;
+
+    /**
+     * 付款方式(预付款、线下支付、第三方支付)
+     */
+    private Long payment;
+
+    /**
+     * 发票税率(%)
+     */
+    private BigDecimal taxRate;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 用户状态(0正常、1已锁)
+     */
+    private Integer status;
+
+    /**
+     * 企业id
+     */
+    private Long entId;
+
+    /**
+     * 企业名称
+     */
+    private String firmName;
+
+    /**
+     * 商品主键
+     */
+    private Integer goodsId;
+
+    /**
+     * 商品编号
+     */
+    private String goodsCode;
+
+    /**
+     * 商品名称
+     */
+    private String goodsName;
+
+    /**
+     * 商品类型
+     */
+    private Long goodsType;
+
+    /**
+     * 商品行业
+     */
+    private Long goodsIndustry;
+
+    /**
+     * 商品尺寸大小
+     */
+    private String goodsSpec;
+
+    /**
+     * 合同主键
+     */
+    private Integer contractId;
+
+    /**
+     * 合同编号
+     */
+    private String contractNo;
+
+    /**
+     * 合同mc
+     */
+    private String contractName;
+
+    /**
+     * 合同签约方式
+     */
+    private String contractSigningWay;
+
+    /**
+     * 托运企业主键ID
+     */
+    private Long checkEntId;
+
+    /**
+     * 托运企业名称
+     */
+    private String checkFirmName;
+
+    /**
+     * 托运企业联系人
+     */
+    private String checkContacts;
+
+    /**
+     * 托运企业联系电话
+     */
+    private String checkPhone;
+
+    /**
+     * 承运企业主键ID
+     */
+    private Long carrierEntId;
+
+    /**
+     * 承运企业名称
+     */
+    private String carrierFirmName;
+
+    /**
+     * 承运企业联系人
+     */
+    private String carrierContacts;
+
+    /**
+     * 承运企业联系电话
+     */
+    private String carrierPhone;
+
+    /**
+     * 装货地址类型
+     */
+    private Long loadType;
+
+    /**
+     * 装货联系人姓名
+     */
+    private String loadContacts;
+
+    /**
+     * 装货联系电话
+     */
+    private String loadPhone;
+
+    /**
+     * 装货所在地区
+     */
+    private Integer loadCityCode;
+
+    /**
+     * 装货所属区域名称
+     */
+    private String loadCityName;
+
+    /**
+     * 装货详细地址
+     */
+    private String loadDetailAddress;
+
+    /**
+     * 装货纬度
+     */
+    private String loadLat;
+
+    /**
+     * 装货纬度
+     */
+    private String loadLng;
+
+    /**
+     * 卸货地址类型
+     */
+    private Long unloadType;
+
+    /**
+     * 卸货联系人姓名
+     */
+    private String unloadContacts;
+
+    /**
+     * 卸货联系电话
+     */
+    private String unloadPhone;
+
+    /**
+     * 卸货所在地区
+     */
+    private Integer unloadCityCode;
+
+    /**
+     * 卸货所属区域名称
+     */
+    private String unloadCityName;
+
+    /**
+     * 卸货详细地址
+     */
+    private String unloadDetailAddress;
+
+    /**
+     * 卸货纬度
+     */
+    private String unloadLat;
+
+    /**
+     * 卸货纬度
+     */
+    private String unloadLng;
+
+    /**
+     * 创建人主键id
+     */
+    private Long createBy;
+
+    /**
+     * 创建人姓名
+     */
+    private String createByName;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新人主键id
+     */
+    private Long updateBy;
+
+    /**
+     * 更新人姓名
+     */
+    private String updateByName;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 是否删除(0未删除,1删除)
+     */
+    private Integer delFlag;
+
+
+}

+ 310 - 0
sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/SckwTradeOrder.java

@@ -0,0 +1,310 @@
+package com.sckw.mongo.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author zk
+ * @desc MongoDB-交易订单信息
+ * @date 2023/7/8
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@Document(collection = "sckw_trade_order")
+public class SckwTradeOrder{
+
+    /**
+     * 订单主键
+     */
+    @Id
+    private Long tOrderId;
+
+    /**
+     * 订单编号
+     */
+    private String tOrderNo;
+
+    /**
+     * 订单成交数量
+     */
+    private BigDecimal amount;
+
+    /**
+     * 订单单位(吨、方、箱、件)
+     */
+    private String unit;
+
+    /**
+     * 订单金额
+     */
+    private BigDecimal price;
+
+    /**
+     * 订单成交单价
+     */
+    private BigDecimal unitPrice;
+
+    /**
+     * 订单交易方式(预付款、货到付款)
+     */
+    private Long trading;
+
+    /**
+     * 订单提货方式(采方自提、供应配送)
+     */
+    private Long pickupType;
+
+    /**
+     * 订单交付类型(签发交付、签收交付)
+     */
+    private Long deliveryType;
+
+    /**
+     * 订单开始日期
+     */
+    private Date startTime;
+
+    /**
+     * 订单结束日期
+     */
+    private Date endTime;
+
+    /**
+     * 订单已委托量
+     */
+    private BigDecimal entrustAmount;
+
+    /**
+     * 订单实际交付量
+     */
+    private BigDecimal actualAmount;
+
+    /**
+     * 订单创建来源类型(采购下单/销售代客下单)
+     */
+    private Integer source;
+
+    /**
+     * 状态
+     */
+    private Integer status;
+
+    /**
+     * 订单备注
+     */
+    private String remark;
+
+    /**
+     * 企业主键ID
+     */
+    private Long entId;
+
+    /**
+     * 企业名称
+     */
+    private String firmName;
+
+    /**
+     * 商品主键
+     */
+    private Integer goodsId;
+
+    /**
+     * 商品编号
+     */
+    private String goodsCode;
+
+    /**
+     * 商品名称
+     */
+    private String goodsName;
+
+    /**
+     * 商品类型
+     */
+    private Long goodsType;
+
+    /**
+     * 商品行业
+     */
+    private Long goodsIndustry;
+
+    /**
+     * 商品尺寸大小
+     */
+    private String goodsSpec;
+
+    /**
+     * 商品发票税率(%)
+     */
+    private BigDecimal goodsTaxRate;
+
+    /**
+     * 商品所属项目名称
+     */
+    private String projectName;
+
+    /**
+     * 合同主键
+     */
+    private Integer contractId;
+
+    /**
+     * 合同编号
+     */
+    private String contractNo;
+
+    /**
+     * 合同mc
+     */
+    private String contractName;
+
+    /**
+     * 合同签约方式
+     */
+    private String contractSigningWay;
+
+    /**
+     * 采购企业主键ID
+     */
+    private Long procureEntId;
+
+    /**
+     * 采购企业名称
+     */
+    private String procureFirmName;
+
+    /**
+     * 采购企业联系人
+     */
+    private String procureContacts;
+
+    /**
+     * 采购企业联系电话
+     */
+    private String procurePhone;
+
+    /**
+     * 供应企业主键ID
+     */
+    private Long supplyEntId;
+
+    /**
+     * 供应企业名称
+     */
+    private String supplyFirmName;
+
+    /**
+     * 供应企业联系人
+     */
+    private String supplyContacts;
+
+    /**
+     * 供应企业联系电话
+     */
+    private String supplyPhone;
+
+    /**
+     * 装货地址类型
+     */
+    private Long loadType;
+
+    /**
+     * 装货所在地区
+     */
+    private Integer loadCityCode;
+
+    /**
+     * 装货所属区域名称
+     */
+    private String loadCityName;
+
+    /**
+     * 装货详细地址
+     */
+    private String loadDetailAddress;
+
+    /**
+     * 装货纬度
+     */
+    private String loadLat;
+
+    /**
+     * 装货纬度
+     */
+    private String loadLng;
+
+    /**
+     * 卸货地址类型
+     */
+    private Long unloadType;
+
+    /**
+     * 卸货所在地区
+     */
+    private Integer unloadCityCode;
+
+    /**
+     * 卸货所属区域名称
+     */
+    private String unloadCityName;
+
+    /**
+     * 卸货详细地址
+     */
+    private String unloadDetailAddress;
+
+    /**
+     * 卸货纬度
+     */
+    private String unloadLat;
+
+    /**
+     * 卸货纬度
+     */
+    private String unloadLng;
+
+    /**
+     * 创建人主键id
+     */
+    private Long createBy;
+
+    /**
+     * 创建人姓名
+     */
+    private String createByName;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新人主键id
+     */
+    private Long updateBy;
+
+    /**
+     * 更新人姓名
+     */
+    private String updateByName;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 是否删除(0未删除,1删除)
+     */
+    private Integer delFlag;
+
+}

+ 361 - 0
sckw-common/sckw-common-mongo/src/main/java/com/sckw/mongo/model/SckwWaybillOrder.java

@@ -0,0 +1,361 @@
+package com.sckw.mongo.model;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author zk
+ * @desc MongoDB-车辆订单信息
+ * @date 2023/7/8
+ */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Accessors(chain = true)
+@Document(collection = "sckw_waybill_order")
+public class SckwWaybillOrder{
+
+    /**
+     * 主键
+     */
+    @Id
+    private Long wOrderId;
+
+    /**
+     * 编号
+     */
+    private String wOrderNo;
+
+    /**
+     * 主键
+     */
+    private Long lOrderId;
+
+    /**
+     * 物流订单编号
+     */
+    private String lOrderNo;
+
+    /**
+     * 交易订单id(kwo_trade_order)
+     */
+    private Long tOrderId;
+
+    /**
+     * 交易订单编号(kwo_trade_order)
+     */
+    private String tOrderNo;
+
+    /**
+     * 企业id
+     */
+    private Long entId;
+
+    /**
+     * 企业名称
+     */
+    private String firmName;
+
+    /**
+     * 车牌号
+     */
+    private String truckNo;
+
+    /**
+     * 车辆类型(牵引车、自卸、高栏、平板、厢式、集装箱车、罐车、封闭式、专项作业车、其他)
+     */
+    private Integer truckType;
+
+    /**
+     * 车能源类型(柴油、汽油、电动、氢能、天然气、液化石油气、甲醇、油电混动、油气混动、其他)
+     */
+    private Integer truckEnergyType;
+
+    /**
+     * 车使用性质(营运车、租赁车辆、货运车、危化品运输车、非营运车、其他)
+     */
+    private Integer truckUseType;
+
+    /**
+     * 车辆颜色
+     */
+    private Integer truckColor;
+
+    /**
+     * 车挂车号
+     */
+    private String truckTrailerNo;
+
+    /**
+     * 司机主键ID
+     */
+    private Long driverId;
+
+    /**
+     * 司机姓名
+     */
+    private String driverName;
+
+    /**
+     * 司机手机号码
+     */
+    private String driverPhone;
+
+    /**
+     * 司机身份证号
+     */
+    private String driverIdcard;
+
+    /**
+     * 装货日期
+     */
+    private Date loadTime;
+
+    /**
+     * 卸货日期
+     */
+    private Date unloadTime;
+
+    /**
+     * 已委托量
+     */
+    private BigDecimal entrustAmount;
+
+    /**
+     * 装货重量
+     */
+    private BigDecimal loadAmount;
+
+    /**
+     * 装货皮重
+     */
+    private BigDecimal loadTareAmount;
+
+    /**
+     * 装货毛重
+     */
+    private BigDecimal loadGrossAmount;
+
+    /**
+     * 装货上传凭证地址,多个以英文逗号隔开
+     */
+    private String loadUrls;
+
+    /**
+     * 卸货重量
+     */
+    private BigDecimal unloadAmount;
+
+    /**
+     * 卸货皮重
+     */
+    private BigDecimal unloadTareAmount;
+
+    /**
+     * 卸货毛重
+     */
+    private BigDecimal unloadGrossAmount;
+
+    /**
+     * 卸货上传凭证地址,多个以英文逗号隔开
+     */
+    private String unloadUrls;
+
+    /**
+     * 亏吨重量
+     */
+    private BigDecimal deficitAmount;
+
+    /**
+     * 商品主键
+     */
+    private Integer goodsId;
+
+    /**
+     * 商品编号
+     */
+    private String goodsCode;
+
+    /**
+     * 商品名称
+     */
+    private String goodsName;
+
+    /**
+     * 商品类型
+     */
+    private Long goodsType;
+
+    /**
+     * 商品行业
+     */
+    private Long goodsIndustry;
+
+    /**
+     * 商品尺寸大小
+     */
+    private String goodsSpec;
+
+    /**
+     * 托运企业主键ID
+     */
+    private Long checkEntId;
+
+    /**
+     * 托运企业名称
+     */
+    private String checkFirmName;
+
+    /**
+     * 托运企业联系人
+     */
+    private String checkContacts;
+
+    /**
+     * 托运企业联系电话
+     */
+    private String checkPhone;
+
+    /**
+     * 承运企业主键ID
+     */
+    private Long carrierEntId;
+
+    /**
+     * 承运企业名称
+     */
+    private String carrierFirmName;
+
+    /**
+     * 承运企业联系人
+     */
+    private String carrierContacts;
+
+    /**
+     * 承运企业联系电话
+     */
+    private String carrierPhone;
+
+    /**
+     * 装货地址类型
+     */
+    private Long loadType;
+
+    /**
+     * 装货联系人姓名
+     */
+    private String loadContacts;
+
+    /**
+     * 装货联系电话
+     */
+    private String loadPhone;
+
+    /**
+     * 装货所在地区
+     */
+    private Integer loadCityCode;
+
+    /**
+     * 装货所属区域名称
+     */
+    private String loadCityName;
+
+    /**
+     * 装货详细地址
+     */
+    private String loadDetailAddress;
+
+    /**
+     * 装货纬度
+     */
+    private String loadLat;
+
+    /**
+     * 装货纬度
+     */
+    private String loadLng;
+
+    /**
+     * 卸货地址类型
+     */
+    private Long unloadType;
+
+    /**
+     * 卸货联系人姓名
+     */
+    private String unloadContacts;
+
+    /**
+     * 卸货联系电话
+     */
+    private String unloadPhone;
+
+    /**
+     * 卸货所在地区
+     */
+    private Integer unloadCityCode;
+
+    /**
+     * 卸货所属区域名称
+     */
+    private String unloadCityName;
+
+    /**
+     * 卸货详细地址
+     */
+    private String unloadDetailAddress;
+
+    /**
+     * 卸货纬度
+     */
+    private String unloadLat;
+
+    /**
+     * 卸货纬度
+     */
+    private String unloadLng;
+
+    /**
+     * 创建人主键id
+     */
+    private Long createBy;
+
+    /**
+     * 创建人姓名
+     */
+    private String createByName;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新人主键id
+     */
+    private Long updateBy;
+
+    /**
+     * 更新人姓名
+     */
+    private String updateByName;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 是否删除(0未删除,1删除)
+     */
+    private Integer delFlag;
+
+
+}

+ 5 - 39
sckw-modules/sckw-example/pom.xml

@@ -18,6 +18,11 @@
 
     <dependencies>
         <!-- 核心模块 -->
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-common-startup</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-core</artifactId>
@@ -83,45 +88,6 @@
             <artifactId>sckw-message-api</artifactId>
         </dependency>
 
-        <!--web-->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-autoconfigure</artifactId>
-            <optional>true</optional>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-starter-bootstrap</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.springframework.cloud</groupId>
-            <artifactId>spring-cloud-loadbalancer</artifactId>
-        </dependency>
-
-        <!--注册中心客户端-->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
-        </dependency>
-
-        <!--配置中心客户端-->
-        <dependency>
-            <groupId>com.alibaba.cloud</groupId>
-            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
-        </dependency>
-
         <!--junit-->
         <dependency>
             <groupId>junit</groupId>

+ 3 - 12
sckw-modules/sckw-example/src/main/java/com/sckw/example/ExampleApplication.java

@@ -1,20 +1,11 @@
 package com.sckw.example;
 
-import com.sckw.core.annotation.SckwCloudApplication;
-import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
+import com.sckw.remote.annotation.SckwRemoteApplication;
+import com.sckw.startup.annotation.SckwCloudApplication;
 import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.openfeign.EnableFeignClients;
 
-@EnableDubbo
-@EnableFeignClients({"com.sckw.*.api.feign"})
-@EnableDiscoveryClient
-//@EnableAutoDataSourceProxy
-@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
+@SckwRemoteApplication
 @SckwCloudApplication
-//@SckwRemoteApplication
 public class ExampleApplication {
 
     public static void main(String[] args) {

+ 2 - 2
sckw-modules/sckw-example/src/main/java/com/sckw/example/model/Student.java

@@ -8,7 +8,7 @@ import java.util.Date;
 public class Student {
 
     @Id
-    private String studentId;
+    private Long studentId;
 
     private String studentName;
 
@@ -18,7 +18,7 @@ public class Student {
 
     private Date studentBirthday;
 
-    public Student(String studentId, String studentName, Integer studentAge, Double studentScore, Date studentBirthday) {
+    public Student(Long studentId, String studentName, Integer studentAge, Double studentScore, Date studentBirthday) {
         this.studentId = studentId;
         this.studentName = studentName;
         this.studentAge = studentAge;

+ 3 - 3
sckw-modules/sckw-example/src/test/java/com/sckw/example/StudentDaoTest.java

@@ -19,11 +19,11 @@ public class StudentDaoTest {
     void addOneStudent(){
 //        插入10行
         Long begtime = System.currentTimeMillis();
-        for (Integer count = 0; count < 10000; count++) {
+        for (Long count = 0L; count < 1000000; count++) {
             Student student = new Student();
-            student.setStudentId("study_"+count);
+            student.setStudentId(count);
             student.setStudentName("Echo"+count);
-            student.setStudentAge(count);
+            student.setStudentAge(0);
             student.setStudentScore(98.5-count);
             student.setStudentBirthday(new Date());
             studentDao.addOne(student);

+ 3 - 3
sckw-modules/sckw-example/src/test/java/com/sckw/example/StudentRepositoryTest.java

@@ -19,7 +19,7 @@ public class StudentRepositoryTest {
      */
     @Test
     public void insertOne() {
-        Student student = new Student("009", "tom", 18, 88.2d, new Date());
+        Student student = new Student(9L, "tom", 18, 88.2d, new Date());
         studentRepository.insert(student);
     }
 
@@ -30,8 +30,8 @@ public class StudentRepositoryTest {
     public void insertMany() {
         List<Student> list = new ArrayList<>();
         Long begtime = System.currentTimeMillis();
-        for (int i=0; i<10000; i++) {
-            Student student1 = new Student("7"+i, "jerry", 19, 38.2d, new Date());
+        for (long i=0; i<1000; i++) {
+            Student student1 = new Student(i, "jerry", 19, 38.2d, new Date());
             list.add(student1);
         }
         studentRepository.insert(list);

+ 18 - 0
sckw-modules/sckw-report/pom.xml

@@ -59,11 +59,29 @@
             <artifactId>sckw-common-sentinel</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-common-mongo</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-system-api</artifactId>
         </dependency>
 
+
+        <!--junit-->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>

+ 44 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/consumer/SckwBusSumConsumer.java

@@ -0,0 +1,44 @@
+package com.sckw.report.consumer;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.sckw.mongo.model.SckwTradeOrder;
+import com.sckw.report.dao.SckwTradeOrderRepository;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import java.util.Date;
+import java.util.Map;
+import java.util.function.Consumer;
+
+/**
+ * @author zk
+ * @desc 接收业务汇总消息
+ * @date 2023/7/8 0008
+ */
+@Configuration
+@RequiredArgsConstructor
+@Slf4j
+public class SckwBusSumConsumer {
+    @Autowired
+    SckwTradeOrderRepository tradeOrderRepository;
+
+    @Bean
+    public Consumer<Map> sckwBusSum() {
+        return sckwBusSum -> {
+            try {
+                System.out.println(new Date()+"---------"+JSON.toJSONString(sckwBusSum));
+                addMongodb(sckwBusSum);
+            } catch (Exception e) {
+                log.error("处理业务数据汇总消息:{}异常", JSON.toJSONString(sckwBusSum), e);
+            }
+        };
+    }
+
+    public void addMongodb(Map<String, Object> sckwBusSum) {
+        SckwTradeOrder order = JSONObject.parseObject(JSON.toJSONString(sckwBusSum), SckwTradeOrder.class);
+        tradeOrderRepository.insert(order);
+    }
+}

+ 77 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/controller/KwFleetController.java

@@ -0,0 +1,77 @@
+package com.sckw.report.controller;
+
+import com.alibaba.fastjson2.JSON;
+import com.sckw.core.exception.SystemException;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.mongo.model.SckwTradeOrder;
+import com.sckw.report.dao.SckwTradeOrderRepository;
+import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cloud.stream.function.StreamBridge;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @author zk
+ * @desc TODO
+ * @date 2023/7/8 0008
+ */
+@AllArgsConstructor
+@RestController
+@RequestMapping("/kwFleet")
+public class KwFleetController {
+
+    @Autowired
+    SckwTradeOrderRepository tradeOrderRepository;
+
+    @Resource
+    StreamBridge streamBridge;
+
+    /**
+     * @param
+     * @desc 根据主键查询
+     * @author zk
+     * @date 2023/7/6
+     **/
+    @GetMapping("/detail")
+    public HttpResult selectByKey() throws SystemException {
+        List<SckwTradeOrder> list = new ArrayList<SckwTradeOrder>();
+        Long begtime = System.currentTimeMillis();
+        for (int i=0; i<10000; i++) {
+            SckwTradeOrder order = new SckwTradeOrder();
+            order.setTOrderId(System.currentTimeMillis() + i);
+            order.setTOrderNo("O" + order.getTOrderId());
+            order.setContractName("xxxx");
+            list.add(order);
+        }
+        tradeOrderRepository.insert(list);
+        Long enttime = System.currentTimeMillis();
+        System.out.println("------------------"+(enttime - begtime));
+        return HttpResult.ok();
+    }
+
+    /**
+     * @param
+     * @desc 根据主键查询
+     * @author zk
+     * @date 2023/7/6
+     **/
+    @GetMapping("/detailV1")
+    public HttpResult selectByKey1() throws SystemException {
+        for (int i=0; i<1000; i++) {
+            Long id = System.currentTimeMillis()+i;
+            HashMap map = new HashMap();
+            map.put("tOrderId", id);
+            map.put("tOrderNo", "D" + id);
+            map.put("contractName", "xxxx");
+            streamBridge.send("sckw-busSum", JSON.toJSONString(map));
+            System.out.println("------------------"+i);
+        }
+        return HttpResult.ok();
+    }
+}

+ 12 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/dao/SckwTradeOrderRepository.java

@@ -0,0 +1,12 @@
+package com.sckw.report.dao;
+
+import com.sckw.mongo.model.SckwTradeOrder;
+import org.springframework.data.mongodb.repository.MongoRepository;
+
+/**
+ * @author zk
+ * @desc MongoDB-交易订单信息
+ * @date 2023/7/8 0008
+ */
+public interface SckwTradeOrderRepository extends MongoRepository<SckwTradeOrder, Long> {
+}

+ 51 - 0
sckw-modules/sckw-report/src/test/java/com/sckw/report/SckwTradeOrderTest.java

@@ -0,0 +1,51 @@
+package com.sckw.report;
+
+import com.sckw.mongo.model.SckwTradeOrder;
+import com.sckw.report.dao.SckwTradeOrderRepository;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author zk
+ * @desc TODO
+ * @date 2023/7/8 0008
+ */
+@SpringBootTest
+public class SckwTradeOrderTest {
+    @Autowired
+    SckwTradeOrderRepository tradeOrderRepository;
+
+    /**
+     * 插入单条数据
+     */
+    @Test
+    public void insertOne() {
+        SckwTradeOrder order = new SckwTradeOrder();
+        order.setTOrderId(System.currentTimeMillis());
+        order.setTOrderNo("O" + order.getTOrderId());
+        tradeOrderRepository.insert(order);
+    }
+
+    /**
+     * 插入多条数据
+     */
+    @Test
+    public void insertMany() {
+        List<SckwTradeOrder> list = new ArrayList<SckwTradeOrder>();
+        Long begtime = System.currentTimeMillis();
+        for (int i=0; i<10000; i++) {
+            SckwTradeOrder order = new SckwTradeOrder();
+            order.setTOrderId(System.currentTimeMillis() + i);
+            order.setTOrderNo("O" + order.getTOrderId());
+            list.add(order);
+        }
+        tradeOrderRepository.insert(list);
+        Long enttime = System.currentTimeMillis();
+        System.out.println("------------------"+(enttime - begtime));
+    }
+
+
+}