diff --git a/huaheng-wms-core/pom.xml b/huaheng-wms-core/pom.xml index ea3823c..23dd6cb 100644 --- a/huaheng-wms-core/pom.xml +++ b/huaheng-wms-core/pom.xml @@ -63,6 +63,11 @@ <artifactId>DmJdbcDriver18</artifactId> <version>8.1.2.192</version> </dependency> + <dependency> + <groupId>com.mchange</groupId> + <artifactId>c3p0</artifactId> + <version>0.9.5.2</version> + </dependency> <!-- jeewx api --> <dependency> <groupId>org.jeecgframework</groupId> diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/controller/HomePageViewController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/controller/HomePageViewController.java index 5c7a806..351e641 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/controller/HomePageViewController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/controller/HomePageViewController.java @@ -39,6 +39,8 @@ import org.jeecg.utils.support.Convert; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; @@ -62,8 +64,8 @@ public class HomePageViewController { * @return */ @RequestMapping(value = "/deliveringAmount", method = {RequestMethod.PUT, RequestMethod.POST}) - public Result<String> deliveringAmount() { - return homePageViewService.deliveringAmount(); + public Result<String> deliveringAmount(HttpServletRequest request) { + return homePageViewService.deliveringAmount(request); } /** @@ -71,8 +73,8 @@ public class HomePageViewController { * @return */ @RequestMapping(value = "/inventoryUtilization", method = {RequestMethod.PUT, RequestMethod.POST}) - public Result<String> inventoryUtilization() { - return homePageViewService.inventoryUtilization(); + public Result<String> inventoryUtilization(HttpServletRequest request) { + return homePageViewService.inventoryUtilization(request); } /** @@ -80,8 +82,8 @@ public class HomePageViewController { * @return */ @RequestMapping(value = "/inventoryStatus", method = {RequestMethod.PUT, RequestMethod.POST}) - public Result<String> inventoryStatus() { - return homePageViewService.inventoryStatus(); + public Result<String> inventoryStatus(HttpServletRequest request) { + return homePageViewService.inventoryStatus(request); } /** @@ -89,8 +91,8 @@ public class HomePageViewController { * @return */ @RequestMapping(value = "/inventoryOverview", method = {RequestMethod.PUT, RequestMethod.POST}) - public Result<String> inventoryOverview() { - return homePageViewService.inventoryOverview(); + public Result<String> inventoryOverview(HttpServletRequest request) { + return homePageViewService.inventoryOverview(request); } /** @@ -98,8 +100,8 @@ public class HomePageViewController { * @return */ @RequestMapping(value = "/getCommonData", method = {RequestMethod.PUT, RequestMethod.POST}) - public Result getCommonData() { - return homePageViewService.getCommonData(); + public Result getCommonData(HttpServletRequest request) { + return homePageViewService.getCommonData(request); } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/HomePageViewService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/HomePageViewService.java index 90baf7e..8df8037 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/HomePageViewService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/HomePageViewService.java @@ -8,6 +8,8 @@ import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; import java.io.Serializable; import java.util.Collection; +import javax.servlet.http.HttpServletRequest; + /** * @Description: 任务表 * @Author: jeecg-boot @@ -16,14 +18,14 @@ import java.util.Collection; */ public interface HomePageViewService { - Result<String> deliveringAmount(); + Result<String> deliveringAmount(HttpServletRequest request); - Result<String> inventoryUtilization(); + Result<String> inventoryUtilization(HttpServletRequest request); - Result<String> inventoryStatus(); + Result<String> inventoryStatus(HttpServletRequest request); - Result<String> inventoryOverview(); + Result<String> inventoryOverview(HttpServletRequest request); - Result getCommonData(); + Result getCommonData(HttpServletRequest request); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/impl/HomePageViewServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/impl/HomePageViewServiceImpl.java index addb283..dd06d04 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/impl/HomePageViewServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/home/service/impl/HomePageViewServiceImpl.java @@ -36,12 +36,15 @@ import org.jeecg.modules.wms.task.taskHeader.entity.TaskDetail; import org.jeecg.modules.wms.task.taskHeader.entity.TaskHeader; import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskDetailServiceImpl; import org.jeecg.modules.wms.task.taskHeader.service.impl.TaskHeaderServiceImpl; +import org.jeecg.utils.HuahengJwtUtil; import org.jeecg.utils.StringUtils; import org.jeecg.utils.constant.QuantityConstant; import org.jeecg.utils.support.Convert; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.*; @@ -58,37 +61,46 @@ public class HomePageViewServiceImpl implements HomePageViewService { @Resource ShipmentHeaderServiceImpl shipmentHeaderServiceImpl; + @Resource ReceiptHeaderServiceImpl receiptHeaderServiceImpl; + @Resource SysDictItemServiceImpl sysDictItemServiceImpl; + @Resource LocationServiceImpl locationServiceImpl; + @Resource InventoryDetailServiceImpl inventoryDetailServiceImpl; + @Resource InventoryHeaderServiceImpl inventoryHeaderServiceImpl; + @Resource TaskDetailServiceImpl taskDetailServiceImpl; + @Resource TaskHeaderServiceImpl taskHeaderService; + @Resource HomePageViewService homePageViewService; + @Resource InventoryTransactionServiceImpl inventoryTransactionServiceImpl; @Override - public Result<String> deliveringAmount() { - //通过库存交易记录来查询 + public Result<String> deliveringAmount(HttpServletRequest request) { + // 通过库存交易记录来查询 LambdaQueryWrapper<InventoryTransaction> inventoryTransactionLambdaQueryWrapper = Wrappers.lambdaQuery(); - inventoryTransactionLambdaQueryWrapper.select(InventoryTransaction::getCreateTime, InventoryTransaction::getQty,InventoryTransaction::getType); + HuahengJwtUtil.setWarehouseCode(inventoryTransactionLambdaQueryWrapper, InventoryTransaction.class, request); + inventoryTransactionLambdaQueryWrapper.select(InventoryTransaction::getCreateTime, InventoryTransaction::getQty, InventoryTransaction::getType); List<InventoryTransaction> inventoryTransactions = inventoryTransactionServiceImpl.list(inventoryTransactionLambdaQueryWrapper); - // 查询出库单的7天出库量 - List<InventoryTransaction> shipmentHeaders=new ArrayList<>(); + List<InventoryTransaction> shipmentHeaders = new ArrayList<>(); shipmentHeaders.addAll(inventoryTransactions); - shipmentHeaders.removeIf(Inventory->Inventory.getType()!=20); + shipmentHeaders.removeIf(Inventory -> Inventory.getType() != 20); LinkedHashMap<String, String> list = new LinkedHashMap<>(); for (int i = 6; i >= 0; i--) { @@ -96,26 +108,21 @@ public class HomePageViewServiceImpl implements HomePageViewService { List<InventoryTransaction> collect = shipmentHeaders.stream() .filter(shipmentHeader -> new SimpleDateFormat("yyyy-MM-dd").format(shipmentHeader.getCreateTime()).toString().contains(today)) .collect(Collectors.toList()); - if (collect.size()!=0) - { - BigDecimal sum=new BigDecimal(0); - for (InventoryTransaction item : collect) - { - sum=sum.add(item.getQty()); + if (collect.size() != 0) { + BigDecimal sum = new BigDecimal(0); + for (InventoryTransaction item : collect) { + sum = sum.add(item.getQty()); } - list.put(today,String.valueOf(sum)); - }else - { - list.put(today,"0"); + list.put(today, String.valueOf(sum)); + } else { + list.put(today, "0"); } - } // 查询入库单的7天入库量 - List<InventoryTransaction> receiptHeaders = new ArrayList<>(); receiptHeaders.addAll(inventoryTransactions); - receiptHeaders.removeIf(Inventory->Inventory.getType()!=10); + receiptHeaders.removeIf(Inventory -> Inventory.getType() != 10); LinkedHashMap<String, String> list2 = new LinkedHashMap<>(); for (int i = 6; i >= 0; i--) { List<InventoryTransaction> receiptHeadersCop = receiptHeaders; @@ -123,22 +130,17 @@ public class HomePageViewServiceImpl implements HomePageViewService { List<InventoryTransaction> collect = receiptHeadersCop.stream() .filter(ReceiptHeader -> new SimpleDateFormat("yyyy-MM-dd").format(ReceiptHeader.getCreateTime()).toString().contains(today)) .collect(Collectors.toList()); - if (collect.size()!=0) - { - BigDecimal sum=new BigDecimal(0); - for (InventoryTransaction item : collect) - { - sum=sum.add(item.getQty()); + if (collect.size() != 0) { + BigDecimal sum = new BigDecimal(0); + for (InventoryTransaction item : collect) { + sum = sum.add(item.getQty()); } - list2.put(today,String.valueOf(sum)); - }else - { - list2.put(today,"0"); + list2.put(today, String.valueOf(sum)); + } else { + list2.put(today, "0"); } } - - Option option = new Option(); option.tooltip().trigger(Trigger.axis).axisPointer().type(PointerType.cross); option.grid().setLeft("3%"); @@ -162,7 +164,6 @@ public class HomePageViewServiceImpl implements HomePageViewService { axis.data().add(o1); line.data().add(o2); } - Line line2 = new Line(); line2.setName("收货量"); for (String key : list2.keySet()) { @@ -170,7 +171,6 @@ public class HomePageViewServiceImpl implements HomePageViewService { Object o2 = list2.get(key); line2.data().add(o2); } - option.setxAxis(Arrays.asList(axis)); ValueAxis yAxis = new ValueAxis(); option.setyAxis(Arrays.asList(yAxis)); @@ -180,19 +180,20 @@ public class HomePageViewServiceImpl implements HomePageViewService { } @Override - public Result<String> inventoryUtilization() { + public Result<String> inventoryUtilization(HttpServletRequest request) { // 先存储总数 Integer allStock = locationServiceImpl.count(); // 有货数量 = 总库位删除为空的数量长度 LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); + HuahengJwtUtil.setWarehouseCode(locationLambdaQueryWrapper, Location.class, request); locationLambdaQueryWrapper.isNotNull(Location::getContainerCode).ne(Location::getContainerCode, ""); int locationStock = locationServiceImpl.count(locationLambdaQueryWrapper); // 无货数量 = 总数 - 有货数量 Integer inStock = allStock - locationStock; Option option = new Option(); -// option.title("库存状态分布").title().x("center"); + // option.title("库存状态分布").title().x("center"); option.tooltip(Trigger.item).tooltip().formatter("{a} <br/>{b} : {c} ({d}%)"); option.legend().setOrient(Orient.vertical); option.legend().setRight(10); @@ -230,7 +231,7 @@ public class HomePageViewServiceImpl implements HomePageViewService { } @Override - public Result<String> inventoryStatus() { + public Result<String> inventoryStatus(HttpServletRequest request) { Option option = new Option(); option.tooltip(Trigger.item).tooltip().formatter("{a} <br/>{b} : {c} ({d}%)"); option.legend().setOrient(Orient.vertical); @@ -259,7 +260,8 @@ public class HomePageViewServiceImpl implements HomePageViewService { pie.itemStyle().emphasis().setShadowColor("rgba(0, 0, 0, 0.4)"); QueryWrapper<InventoryDetail> queryWrapper = new QueryWrapper<>(); - queryWrapper.select("inventory_status ,SUM(qty) qty").eq("warehouse_code", "CS0001").groupBy("inventory_status"); + HuahengJwtUtil.setWarehouseCode(queryWrapper, InventoryDetail.class, request); + queryWrapper.select("inventory_status, SUM(qty) qty").groupBy("inventory_status"); List<InventoryDetail> inventoryDetails = inventoryDetailServiceImpl.list(queryWrapper); LambdaQueryWrapper<SysDictItem> sysDictItemLambdaQueryWrapper = Wrappers.lambdaQuery(); @@ -282,9 +284,10 @@ public class HomePageViewServiceImpl implements HomePageViewService { } @Override - public Result<String> inventoryOverview() { + public Result<String> inventoryOverview(HttpServletRequest request) { QueryWrapper<InventoryDetail> queryWrapper = new QueryWrapper<>(); - queryWrapper.select("material_name, sum(qty) AS qty").eq("warehouse_code", "CS0001").groupBy("material_name"); + HuahengJwtUtil.setWarehouseCode(queryWrapper, InventoryDetail.class, request); + queryWrapper.select("material_name, sum(qty) AS qty").groupBy("material_name"); List<InventoryDetail> inventoryDetails = inventoryDetailServiceImpl.list(queryWrapper); Option option = new Option(); option.tooltip(Trigger.item).tooltip().formatter("{a} <br/>{b} : {c} ({d}%)"); @@ -334,16 +337,15 @@ public class HomePageViewServiceImpl implements HomePageViewService { } @Override - public Result getCommonData() { + public Result getCommonData(HttpServletRequest request) { // 昨天日期 String today = new SimpleDateFormat("yyyy-MM-dd").format(System.currentTimeMillis() - 1000 * 60 * 60 * 24).toString(); Map<String, Object> map = new HashMap<>(); - - // 今天入库量 LambdaQueryWrapper<InventoryTransaction> inventoryTransactionLambdaQueryWrapper = Wrappers.lambdaQuery(); - inventoryTransactionLambdaQueryWrapper.select(InventoryTransaction::getType,InventoryTransaction::getQty).gt(InventoryTransaction::getCreateTime, today); + HuahengJwtUtil.setWarehouseCode(inventoryTransactionLambdaQueryWrapper, InventoryTransaction.class, request); + inventoryTransactionLambdaQueryWrapper.select(InventoryTransaction::getType, InventoryTransaction::getQty).gt(InventoryTransaction::getCreateTime, today); List<InventoryTransaction> inventoryTransactions = inventoryTransactionServiceImpl.list(inventoryTransactionLambdaQueryWrapper); BigDecimal receiptQty = BigDecimal.ZERO; BigDecimal shipmentQty = BigDecimal.ZERO; @@ -360,11 +362,9 @@ public class HomePageViewServiceImpl implements HomePageViewService { // 今日交易量 map.put("bllCount", receiptQty.add(shipmentQty)); - - - // 库存总数 LambdaQueryWrapper<InventoryHeader> inventoryHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); + HuahengJwtUtil.setWarehouseCode(inventoryHeaderLambdaQueryWrapper, InventoryHeader.class, request); inventoryHeaderLambdaQueryWrapper.select(InventoryHeader::getTotalQty); List<InventoryHeader> inventoryHeaders = inventoryHeaderServiceImpl.list(inventoryHeaderLambdaQueryWrapper); BigDecimal inventoryQty = BigDecimal.ZERO; @@ -373,14 +373,16 @@ public class HomePageViewServiceImpl implements HomePageViewService { } map.put("inventoryTotal", inventoryQty); - // 库内品数 + // 库内良品数 LambdaQueryWrapper<InventoryDetail> inventoryDetailLambdaQueryWrapper = Wrappers.lambdaQuery(); - inventoryDetailLambdaQueryWrapper.select(InventoryDetail::getId).groupBy(InventoryDetail::getInventoryStatus); + HuahengJwtUtil.setWarehouseCode(inventoryDetailLambdaQueryWrapper, InventoryDetail.class, request); + inventoryDetailLambdaQueryWrapper.select(InventoryDetail::getInventoryStatus).groupBy(InventoryDetail::getInventoryStatus); List<InventoryDetail> inventoryDetails = inventoryDetailServiceImpl.list(inventoryDetailLambdaQueryWrapper); map.put("materialCount", inventoryDetails.size()); // 待执行任务数 LambdaQueryWrapper<TaskHeader> taskHeaderLambdaQueryWrapper = Wrappers.lambdaQuery(); + HuahengJwtUtil.setWarehouseCode(taskHeaderLambdaQueryWrapper, TaskHeader.class, request); taskHeaderLambdaQueryWrapper.ge(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_RELEASE).lt(TaskHeader::getStatus, QuantityConstant.TASK_STATUS_COMPLETED); List<TaskHeader> taskHeaders = taskHeaderService.list(taskHeaderLambdaQueryWrapper); @@ -388,5 +390,4 @@ public class HomePageViewServiceImpl implements HomePageViewService { return Result.ok(map); } - } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/mapper/xml/InventoryDetailMapper.xml b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/mapper/xml/InventoryDetailMapper.xml index 1347208..ac6b46a 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/mapper/xml/InventoryDetailMapper.xml +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/mapper/xml/InventoryDetailMapper.xml @@ -4,14 +4,13 @@ <delete id="deleteByMainId" parameterType="java.lang.String"> DELETE - FROM inventory_detail - WHERE inventory_header_id = #{mainId} + FROM inventory_detail + WHERE inventory_header_id = #{mainId} </delete> - <select id="selectByMainId" parameterType="java.lang.String" - resultType="org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail"> + <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.wms.inventory.inventoryHeader.entity.InventoryDetail"> SELECT * - FROM inventory_detail - WHERE inventory_header_id = #{mainId} + FROM inventory_detail + WHERE inventory_header_id = #{mainId} </select> </mapper> diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/TableCleanTesk.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/TableCleanTesk.java index c805f5b..41aa5a0 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/TableCleanTesk.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/monitor/job/TableCleanTesk.java @@ -62,8 +62,9 @@ public class TableCleanTesk implements Job { Field timeField = ReflectUtil.getField(Class.forName(className), javaTimefieldName); if (timeField != null) { QueryWrapper<?> queryWrapper = new QueryWrapper<>(); - LocalDateTime timeValue = LocalDateUtils.minus(LocalDateTime.now(), tableCleanDto.getRetentionDays(), ChronoUnit.DAYS); - queryWrapper.lt(tableCleanDto.getTimeFieldName(), timeValue); + LocalDateTime localDateTimeValue = LocalDateUtils.minus(LocalDateTime.now(), tableCleanDto.getRetentionDays(), ChronoUnit.DAYS); +// queryWrapper.apply("{0} < {1}", tableCleanDto.getTimeFieldName(), LocalDateUtils.getStartTimeOfDayStr(localDateTimeValue)); + queryWrapper.lt(tableCleanDto.getTimeFieldName(), LocalDateUtils.getStartTimeOfDayStr(localDateTimeValue)); BaseMapper baseMapper = (BaseMapper)this.sqlSession.getMapper(mapperClass); Integer deleteCount = baseMapper.delete(queryWrapper); log.info("定时任务 TableCleanTesk 删除 {} {} 天前数据 {} 行", className, tableCleanDto.getRetentionDays(), deleteCount); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/utils/HuahengJwtUtil.java b/huaheng-wms-core/src/main/java/org/jeecg/utils/HuahengJwtUtil.java index 04ab8d0..3ed8fb4 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/utils/HuahengJwtUtil.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/utils/HuahengJwtUtil.java @@ -23,6 +23,7 @@ import com.auth0.jwt.algorithms.Algorithm; import com.auth0.jwt.exceptions.JWTDecodeException; import com.auth0.jwt.interfaces.DecodedJWT; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DateUtil; @@ -133,6 +134,18 @@ public class HuahengJwtUtil { lambdaQueryWrapper.apply("warehouse_code = {0}", warehouseCode); } } + + public static <T> void setWarehouseCode(QueryWrapper<T> queryWrapper, Class<T> clazz, HttpServletRequest request) { + List<String> roles = HuahengJwtUtil.getRolesByToken(request); + String warehouseCode = HuahengJwtUtil.getWarehouseCodeByToken(request); + if (roles.contains(USER_ROLE_INSPECTOR) && warehouseCode.equals(ALL_WAREHOUSE_CODE)) { + return; + } + Field warehouseCodeField = ReflectUtil.getField(clazz, "warehouseCode"); + if (warehouseCodeField != null) { + queryWrapper.eq("warehouse_code", warehouseCode); + } + } /** * 生成签名 diff --git a/huaheng-wms-core/src/main/resources/application-dev.yml b/huaheng-wms-core/src/main/resources/application-dev.yml index eebac2c..a48adde 100644 --- a/huaheng-wms-core/src/main/resources/application-dev.yml +++ b/huaheng-wms-core/src/main/resources/application-dev.yml @@ -51,6 +51,7 @@ spring: scheduler: instanceName: test instanceId: AUTO + # wrapJobExecutionInUserTransaction: false jobStore: class: org.quartz.impl.jdbcjobstore.JobStoreTX driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate @@ -58,6 +59,8 @@ spring: isClustered: true misfireThreshold: 60000 clusterCheckinInterval: 10000 + # 使用sqlServer数据源时需放开此配置 + # selectWithLockSQL: SELECT* FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ? threadPool: class: org.quartz.simpl.SimpleThreadPool threadCount: 10 @@ -120,7 +123,7 @@ spring: timeBetweenEvictionRunsMillis: 60000 # 配置一个连接在池中最小生存的时间,单位是毫秒 minEvictableIdleTimeMillis: 300000 - validationQuery: SELECT 1 FROM DUAL + validationQuery: SELECT 1 testWhileIdle: true testOnBorrow: false testOnReturn: false @@ -137,6 +140,11 @@ spring: username: root password: HHsoft123. driver-class-name: net.sf.log4jdbc.DriverSpy + # sqlserver 数据源配置 + # url: jdbc:sqlserver://172.16.29.88:1433;DatabaseName=wms4;encrypt=false;SelectMethod=cursor; + # username: sa + # password: 1qaz!QAZ + # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver # 多数据源配置 # multi-datasource1: # url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai diff --git a/huaheng-wms-core/src/main/resources/application-prod.yml b/huaheng-wms-core/src/main/resources/application-prod.yml index 8fc07a5..4ba418a 100644 --- a/huaheng-wms-core/src/main/resources/application-prod.yml +++ b/huaheng-wms-core/src/main/resources/application-prod.yml @@ -51,6 +51,7 @@ spring: scheduler: instanceName: prod instanceId: AUTO + # wrapJobExecutionInUserTransaction: false jobStore: class: org.quartz.impl.jdbcjobstore.JobStoreTX driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate @@ -58,6 +59,8 @@ spring: isClustered: true misfireThreshold: 60000 clusterCheckinInterval: 10000 + # 使用sqlServer数据源时需放开此配置 + # selectWithLockSQL: SELECT* FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ? threadPool: class: org.quartz.simpl.SimpleThreadPool threadCount: 10 @@ -120,7 +123,7 @@ spring: timeBetweenEvictionRunsMillis: 60000 # 配置一个连接在池中最小生存的时间,单位是毫秒 minEvictableIdleTimeMillis: 300000 - validationQuery: SELECT 1 FROM DUAL + validationQuery: SELECT 1 testWhileIdle: true testOnBorrow: false testOnReturn: false @@ -137,6 +140,11 @@ spring: username: root password: hhsoftware driver-class-name: com.mysql.cj.jdbc.Driver + # sqlserver 数据源配置 + # url: jdbc:sqlserver://172.16.29.88:1433;DatabaseName=wms4;encrypt=false;SelectMethod=cursor; + # username: sa + # password: 1qaz!QAZ + # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver # 多数据源配置 # multi-datasource1: # url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai diff --git a/huaheng-wms-core/src/main/resources/application-test.yml b/huaheng-wms-core/src/main/resources/application-test.yml index 9dfcbf3..54ecb52 100644 --- a/huaheng-wms-core/src/main/resources/application-test.yml +++ b/huaheng-wms-core/src/main/resources/application-test.yml @@ -51,6 +51,7 @@ spring: scheduler: instanceName: test instanceId: AUTO + # wrapJobExecutionInUserTransaction: false jobStore: class: org.quartz.impl.jdbcjobstore.JobStoreTX driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate @@ -58,6 +59,8 @@ spring: isClustered: true misfireThreshold: 60000 clusterCheckinInterval: 10000 + # 使用sqlServer数据源时需放开此配置 + # selectWithLockSQL: SELECT* FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ? threadPool: class: org.quartz.simpl.SimpleThreadPool threadCount: 10 @@ -120,7 +123,7 @@ spring: timeBetweenEvictionRunsMillis: 60000 # 配置一个连接在池中最小生存的时间,单位是毫秒 minEvictableIdleTimeMillis: 300000 - validationQuery: SELECT 1 FROM DUAL + validationQuery: SELECT 1 testWhileIdle: true testOnBorrow: false testOnReturn: false @@ -133,17 +136,23 @@ spring: connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 datasource: master: + # mysql数据源配置 url: jdbc:log4jdbc:mysql://172.16.29.45:3306/wms4?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true username: root password: hhsoftware driver-class-name: net.sf.log4jdbc.DriverSpy + # sqlserver 数据源配置 + # url: jdbc:sqlserver://172.16.29.88:1433;DatabaseName=wms4;encrypt=false;SelectMethod=cursor; + # username: sa + # password: 1qaz!QAZ + # driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver # 多数据源配置 # multi-datasource1: # url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai # username: root # password: root # driver-class-name: com.mysql.cj.jdbc.Driver - # # 达梦数据库链接驱动 + # 达梦数据库链接驱动 # url: jdbc:dm://192.168.225.128:5236?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # username: WMS4 # password: 123456