diff --git a/blade-service/logpm-data-sharing/pom.xml b/blade-service/logpm-data-sharing/pom.xml new file mode 100644 index 000000000..1baf0111b --- /dev/null +++ b/blade-service/logpm-data-sharing/pom.xml @@ -0,0 +1,56 @@ + + + + blade-service + org.springblade + 3.2.0.RELEASE + + 4.0.0 + + logpm-data-sharing + + + 8 + 8 + + + + + org.springblade + blade-core-boot + + + org.springblade + blade-starter-swagger + + + org.springblade + blade-core-auto + provided + + + org.springblade + logpm-basicdata-api + 3.2.0.RELEASE + + + + + + + io.fabric8 + docker-maven-plugin + + ${docker.fabric.skip} + + + + org.apache.maven.plugins + maven-antrun-plugin + + + + + diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/DataSharingApplication.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/DataSharingApplication.java new file mode 100644 index 000000000..ecd402f47 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/DataSharingApplication.java @@ -0,0 +1,16 @@ +package com.logpm.datasharing; + +import org.springblade.common.constant.ModuleNameConstant; +import org.springblade.core.cloud.client.BladeCloudApplication; +import org.springblade.core.launch.BladeApplication; + +/** + * @author zqb + */ +@BladeCloudApplication +public class DataSharingApplication { + + public static void main(String[] args) { + BladeApplication.run(ModuleNameConstant.APPLICATION_DATA_SHARING_NAME, DataSharingApplication.class, args); + } +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/config/DataSharingConfiguration.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/config/DataSharingConfiguration.java new file mode 100644 index 000000000..591b1a2e3 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/config/DataSharingConfiguration.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.datasharing.config; + + +import com.logpm.datasharing.pros.DataSharingProperties; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +/** + * 配置feign、mybatis包名、properties + * + * @author chaos + */ +@Configuration(proxyBeanMethods = false) +@ComponentScan({"org.springblade", "com.logpm"}) +@EnableFeignClients({"org.springblade", "com.logpm"}) +@MapperScan({"org.springblade.**.mapper.**", "com.logpm.**.mapper.**"}) +@EnableConfigurationProperties(DataSharingProperties.class) +public class DataSharingConfiguration { + + +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/controller/MerchantController.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/controller/MerchantController.java new file mode 100644 index 000000000..3ceffe362 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/controller/MerchantController.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.datasharing.controller; + +import com.logpm.datasharing.service.MerchantService; +import com.logpm.datasharing.vo.MerchantOrderVO; +import io.swagger.annotations.Api; +import lombok.AllArgsConstructor; +import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.tool.api.R; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +/** + * 商家获取信息 控制器 + * + * @Author zqb + * @Date 2024/4/15 + **/ +@RestController +@AllArgsConstructor +@RequestMapping("/merchant") +@Api(value = "商家获取货物信息", tags = "商家获取货物信息") +public class MerchantController extends BladeController { + + private final MerchantService merchantService; + + @GetMapping("goods") + public R goods(@RequestParam("contract_number") String contract_number, @RequestParam("auth_key") String auth_key) { + return R.data(merchantService.goods(contract_number,auth_key)); + } + + +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/dto/MerchantOrderDTO.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/dto/MerchantOrderDTO.java new file mode 100644 index 000000000..d0d946f3d --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/dto/MerchantOrderDTO.java @@ -0,0 +1,27 @@ +package com.logpm.datasharing.dto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 订单信息 + * @author zhaoqiaobo + * @create 2024-04-15 + */ +@Data +public class MerchantOrderDTO implements Serializable { + + @ApiModelProperty(value = "收件地址") + private String receiveAddress; + @ApiModelProperty(value = "是否零担订单") + private String zeroOrder; + @ApiModelProperty(value = "收件人电话") + private String receivePhone; + @ApiModelProperty(value = "订单合同号") + private String orderCode; + @ApiModelProperty(value = "订单总件数") + private String total; + +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/launcher/DataSharingLauncherServiceImpl.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/launcher/DataSharingLauncherServiceImpl.java new file mode 100644 index 000000000..4ca845ebd --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/launcher/DataSharingLauncherServiceImpl.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the dreamlu.net developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: Chill 庄骞 (smallchill@163.com) + */ +package com.logpm.datasharing.launcher; + +import org.springblade.core.auto.service.AutoService; +import org.springblade.core.launch.constant.NacosConstant; +import org.springblade.core.launch.service.LauncherService; +import org.springblade.core.launch.utils.PropsUtil; +import org.springframework.boot.builder.SpringApplicationBuilder; + +import java.util.Properties; + +/** + * 启动参数拓展 + * + * @author Chill + */ +@AutoService(LauncherService.class) +public class DataSharingLauncherServiceImpl implements LauncherService { + + @Override + public void launcher(SpringApplicationBuilder builder, String appName, String profile, boolean isLocalDev) { + Properties props = System.getProperties(); + // 开启多数据源 + PropsUtil.setProperty(props, "spring.datasource.dynamic.enabled", "true"); + // 指定注册配置信息 + PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].data-id", NacosConstant.dataId(appName, profile)); + PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].group", NacosConstant.NACOS_CONFIG_GROUP); + PropsUtil.setProperty(props, "spring.cloud.nacos.config.extension-configs[0].refresh", NacosConstant.NACOS_CONFIG_REFRESH); + // 指定注册IP + // PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.ip", "127.0.0.1"); + // 指定注册端口 + // PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.port", "8200"); + // 自定义命名空间 + // PropsUtil.setProperty(props, "spring.cloud.nacos.config.namespace", LauncherConstant.NACOS_NAMESPACE); + // PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.namespace", LauncherConstant.NACOS_NAMESPACE); + // 自定义分组 + // PropsUtil.setProperty(props, "spring.cloud.nacos.config.group", NacosConstant.NACOS_CONFIG_GROUP); + // PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.group", NacosConstant.NACOS_CONFIG_GROUP); + } + + @Override + public int getOrder() { + return 20; + } +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapeer.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapeer.java new file mode 100644 index 000000000..3723dd8bb --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapeer.java @@ -0,0 +1,25 @@ +package com.logpm.datasharing.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.logpm.datasharing.dto.MerchantOrderDTO; +import com.logpm.datasharing.vo.MerchantPackageVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author zhaoqiaobo + * @create 2024-03-06 15:54 + */ +@Mapper +public interface MerchantMapeer extends BaseMapper { + + + MerchantOrderDTO findMerchantOrder(@Param("contract_number") String contract_number, List warehouseId); + + List findWarehouseIdByAuthKey(@Param("authKey") String authKey); + + List findPackage(@Param("contract_number") String contract_number); + +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml new file mode 100644 index 000000000..dc51542d4 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/pros/DataSharingProperties.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/pros/DataSharingProperties.java new file mode 100644 index 000000000..c9ca6e0c9 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/pros/DataSharingProperties.java @@ -0,0 +1,21 @@ +package com.logpm.datasharing.pros; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * FactoryProperties + * + * @author pref + */ +@Data +@ConfigurationProperties(prefix = "logpm") +public class DataSharingProperties { + /** + * 名称 + */ + private String name; + + + +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java new file mode 100644 index 000000000..6ea0b028d --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java @@ -0,0 +1,18 @@ +package com.logpm.datasharing.service; + +import com.logpm.datasharing.vo.MerchantOrderVO; + +/** + * @author zhaoqiaobo + * @create 2024-04-15 + */ +public interface MerchantService { + + /** + * 根据合同编号查询商品信息。 + * + * @param contract_number 合同编号,用于查询特定合同下的商品信息。 + * @return 返回一个包含商品信息的响应对象,具体商品信息封装在MerchantOrderVO中。 + */ + MerchantOrderVO goods(String contractNumber, String authKey); +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java new file mode 100644 index 000000000..04dd6de5a --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java @@ -0,0 +1,48 @@ +package com.logpm.datasharing.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ObjectUtil; +import com.logpm.datasharing.dto.MerchantOrderDTO; +import com.logpm.datasharing.mapper.MerchantMapeer; +import com.logpm.datasharing.service.MerchantService; +import com.logpm.datasharing.vo.MerchantOrderPackageVO; +import com.logpm.datasharing.vo.MerchantOrderVO; +import com.logpm.datasharing.vo.MerchantPackageVO; +import lombok.AllArgsConstructor; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author zhaoqiaobo + * @create 2024-03-06 15:52 + */ +@Service +@AllArgsConstructor +public class MerchantServiceImpl implements MerchantService { + + private final MerchantMapeer merchantMapeer; + + @Override + public MerchantOrderVO goods(String contract_number, String authKey) { + MerchantOrderDTO dto = null; + // 根据 authKey 获取仓库信息 + List warehouseId = merchantMapeer.findWarehouseIdByAuthKey(authKey); + if (CollUtil.isNotEmpty(warehouseId)) { + // 根据合同编号获取合同信息 + dto = merchantMapeer.findMerchantOrder(contract_number, warehouseId); + if (ObjectUtil.isNotEmpty(dto)) { + // 零担订单 + // 定制品 + // 包件/库存品 + List packageVO = merchantMapeer.findPackage(contract_number); + MerchantOrderPackageVO orderPackageVO = new MerchantOrderPackageVO(); + BeanUtil.copyProperties(dto, orderPackageVO); + orderPackageVO.setPackageInfor(packageVO); + return orderPackageVO; + } + } + return null; + } +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantOrderPackageVO.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantOrderPackageVO.java new file mode 100644 index 000000000..d8f4d2533 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantOrderPackageVO.java @@ -0,0 +1,19 @@ +package com.logpm.datasharing.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * 订单信息 包件 + * @author zhaoqiaobo + * @create 2024-04-15 + */ +@Data +public class MerchantOrderPackageVO extends MerchantOrderVO { + + @ApiModelProperty(value = "包件信息") + private List packageInfor; + +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantOrderVO.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantOrderVO.java new file mode 100644 index 000000000..1b72c6a1b --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantOrderVO.java @@ -0,0 +1,25 @@ +package com.logpm.datasharing.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 订单信息 + * @author zhaoqiaobo + * @create 2024-04-15 + */ +@Data +public class MerchantOrderVO implements Serializable { + + @ApiModelProperty(value = "收件地址") + private String receiveAddress; + @ApiModelProperty(value = "收件人电话") + private String receivePhone; + @ApiModelProperty(value = "订单合同号") + private String orderCode; + @ApiModelProperty(value = "订单总件数") + private String total; + +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantOrderZeroVO.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantOrderZeroVO.java new file mode 100644 index 000000000..ba1545235 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantOrderZeroVO.java @@ -0,0 +1,23 @@ +package com.logpm.datasharing.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * 订单信息 包件 + * + * @author zhaoqiaobo + * @create 2024-04-15 + */ +@Data +public class MerchantOrderZeroVO extends MerchantOrderVO { + + @ApiModelProperty(value = "零担在库数") + private String stockTotal; + + @ApiModelProperty(value = "零担配送信息") + private List packageInfor; + +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantPackageVO.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantPackageVO.java new file mode 100644 index 000000000..4415834e2 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantPackageVO.java @@ -0,0 +1,32 @@ +package com.logpm.datasharing.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 订单包件信息 + * + * @author zhaoqiaobo + * @create 2024-04-15 + */ +@Data +public class MerchantPackageVO implements Serializable { + + @ApiModelProperty(value = "发货地址") + private String sendAddress; + @ApiModelProperty(value = "快递单号【运单号】") + private String waybillNumber; + @ApiModelProperty(value = "包件码") + private String orderPackageCode; + @ApiModelProperty(value = "包件状态 20 入库 70 签收") + private String orderPackageStatus; + @ApiModelProperty(value = "更新时间") + private String updateTime; + @ApiModelProperty(value = "配送人姓名") + private String distributionName; + @ApiModelProperty(value = "配送人联系电话") + private String distributionPhone; + +} diff --git a/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantZeroDispatchVO.java b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantZeroDispatchVO.java new file mode 100644 index 000000000..6e5e4fb62 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/vo/MerchantZeroDispatchVO.java @@ -0,0 +1,28 @@ +package com.logpm.datasharing.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; + +/** + * 订单包件信息 + * + * @author zhaoqiaobo + * @create 2024-04-15 + */ +@Data +public class MerchantZeroDispatchVO implements Serializable { + + @ApiModelProperty(value = "发货地址") + private String sendAddress; + @ApiModelProperty(value = "快递单号【运单号】") + private String waybillNumber; + @ApiModelProperty(value = "配送数量") + private String dispatchNumber; + @ApiModelProperty(value = "配送人姓名") + private String distributionName; + @ApiModelProperty(value = "配送人联系电话") + private String distributionPhone; + +} diff --git a/blade-service/logpm-data-sharing/src/main/resources/application-dev.yml b/blade-service/logpm-data-sharing/src/main/resources/application-dev.yml new file mode 100644 index 000000000..9bbdaad39 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/resources/application-dev.yml @@ -0,0 +1,47 @@ +#服务器端口 +server: + port: 17010 + +#zb: +# enable: false +#数据源配置 +#spring: +# datasource: +# url: ${blade.datasource.dev.url} +# username: ${blade.datasource.dev.username} +# password: ${blade.datasource.dev.password} + +spring: + #排除DruidDataSourceAutoConfigure + autoconfigure: + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure + datasource: + dynamic: + druid: + #通用校验配置 + validation-query: select 1 + #启用sql日志拦截器 + proxy-filters: + - sqlLogInterceptor + #设置默认的数据源或者数据源组,默认值即为master + primary: master + datasource: + master: + druid: + #独立校验配置 + validation-query: select 1 + #oracle校验 + #validation-query: select 1 from dual + url: ${blade.datasource.datasharing.master.url} + username: ${blade.datasource.datasharing.master.username} + password: ${blade.datasource.datasharing.master.password} + slave: + druid: + #独立校验配置 + validation-query: select 1 + #oracle校验 + #validation-query: select 1 from dual + url: ${blade.datasource.datasharing.slave.url} + username: ${blade.datasource.datasharing.slave.username} + password: ${blade.datasource.datasharing.slave.password} + diff --git a/blade-service/logpm-data-sharing/src/main/resources/application-prod.yml b/blade-service/logpm-data-sharing/src/main/resources/application-prod.yml new file mode 100644 index 000000000..77068f345 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/resources/application-prod.yml @@ -0,0 +1,45 @@ +#服务器端口 +server: + port: 17010 + +#数据源配置 +#spring: +# datasource: +# url: ${blade.datasource.dev.url} +# username: ${blade.datasource.dev.username} +# password: ${blade.datasource.dev.password} + +spring: + #排除DruidDataSourceAutoConfigure + autoconfigure: + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure + datasource: + dynamic: + druid: + #通用校验配置 + validation-query: select 1 + #启用sql日志拦截器 + proxy-filters: + - sqlLogInterceptor + #设置默认的数据源或者数据源组,默认值即为master + primary: master + datasource: + master: + druid: + #独立校验配置 + validation-query: select 1 + #oracle校验 + #validation-query: select 1 from dual + url: ${blade.datasource.datasharing.master.url} + username: ${blade.datasource.datasharing.master.username} + password: ${blade.datasource.datasharing.master.password} + slave: + druid: + #独立校验配置 + validation-query: select 1 + #oracle校验 + #validation-query: select 1 from dual + url: ${blade.datasource.datasharing.slave.url} + username: ${blade.datasource.datasharing.slave.username} + password: ${blade.datasource.datasharing.slave.password} + diff --git a/blade-service/logpm-data-sharing/src/main/resources/application-test.yml b/blade-service/logpm-data-sharing/src/main/resources/application-test.yml new file mode 100644 index 000000000..77068f345 --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/resources/application-test.yml @@ -0,0 +1,45 @@ +#服务器端口 +server: + port: 17010 + +#数据源配置 +#spring: +# datasource: +# url: ${blade.datasource.dev.url} +# username: ${blade.datasource.dev.username} +# password: ${blade.datasource.dev.password} + +spring: + #排除DruidDataSourceAutoConfigure + autoconfigure: + exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure + datasource: + dynamic: + druid: + #通用校验配置 + validation-query: select 1 + #启用sql日志拦截器 + proxy-filters: + - sqlLogInterceptor + #设置默认的数据源或者数据源组,默认值即为master + primary: master + datasource: + master: + druid: + #独立校验配置 + validation-query: select 1 + #oracle校验 + #validation-query: select 1 from dual + url: ${blade.datasource.datasharing.master.url} + username: ${blade.datasource.datasharing.master.username} + password: ${blade.datasource.datasharing.master.password} + slave: + druid: + #独立校验配置 + validation-query: select 1 + #oracle校验 + #validation-query: select 1 from dual + url: ${blade.datasource.datasharing.slave.url} + username: ${blade.datasource.datasharing.slave.username} + password: ${blade.datasource.datasharing.slave.password} + diff --git a/blade-service/logpm-data-sharing/src/main/resources/application.yml b/blade-service/logpm-data-sharing/src/main/resources/application.yml new file mode 100644 index 000000000..e06f3357f --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/resources/application.yml @@ -0,0 +1,32 @@ +#mybatis-plus配置 +mybatis-plus: + mapper-locations: classpath:com/logpm/**/mapper/*Mapper.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.logpm.**.entity + +#swagger扫描路径配置 +swagger: + base-packages: + - org.springblade + - com.logpm + +#oss配置 +oss: + enabled: true + name: minio + tenant-mode: false + endpoint: http://8.137.14.82:9000 + access-key: minio + secret-key: 123123123 + bucket-name: bladex + + +logging: + config: classpath:logback.xml + + +spring: + main: + allow-circular-references: true + + diff --git a/blade-service/logpm-data-sharing/src/main/resources/logback.xml b/blade-service/logpm-data-sharing/src/main/resources/logback.xml new file mode 100644 index 000000000..7170050de --- /dev/null +++ b/blade-service/logpm-data-sharing/src/main/resources/logback.xml @@ -0,0 +1,40 @@ + + + + logback + + + + + + + + + + + + ${CONSOLE_LOG_PATTERN} + utf8 + + + + + ${log.path} + + ${log.path}.%d{yyyy-MM-dd}.zip + + + %date %level [%thread] %logger{36} [%file : %line] %msg%n + + + + + + + + + + diff --git a/blade-service/pom.xml b/blade-service/pom.xml index 19fc03996..744e5d260 100644 --- a/blade-service/pom.xml +++ b/blade-service/pom.xml @@ -46,6 +46,7 @@ logpm-report logpm-factory-data + logpm-data-sharing