java
共 27 篇文章
jmeter压测带参数
1.找到jmeter bin目录,双击jmeter.bat文件,打开jmeter 2.创建线程组 3.线程组下面创建request protocol: http Server Name or IP: api-gateway.fat-traefik.vcredi-t.com.local method : get/post path: /api/telemarket/import/calldata/flowImport content encoding : utf-8 body Data: { "productName": "豆金", "productCode": "DQ", "stage": …
2025-05-13 13:52 · java
机构用户查询-扁平化
sql: CREATE TABLE `t_call_user` ( `ID` bigint unsigned NOT NULL COMMENT '主键', `NAME` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '姓名', `USER_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户名', `AGENT_NO` varchar(16) CH…
导出csv并压缩
public byte[] getCSVDataByte(MarketingStatisticsQueryDTO dto, StatisticsFileMark statisticsFileMark) { String fileName = statisticsFileMark.getName() + FILE_END; StopWatch stopWatch = new StopWatch("电销自定义报表导出" + fileName); try { log.info("CSV电销自定义报表导出{},[{}]", fileName, dto); stopWatch.start("参数处理"…
2024-07-30 13:48 · java
随机数小游戏
import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class LotteryNumberGenerator { private static final int MAX_LEFT = 35; private static final int M…
2024-04-12 18:03 · java
copilot-乒乓球小游戏
import javax.swing.*; import java.awt.*; import java.awt.event.*; public class PingPongGame extends JPanel { int ballX = 0; int ballY = 0; int paddleX = 0; int caughtBalls = 0; int missedBalls = 0; public PingPongGame() { setPreferredSize(new Dimension(500, 360)); setBackground(Color.WHITE); Timer …
Lock wait timeout exceeded
错误信息: org.springframework.dao.CannotAcquireLockException: ### Error updating database. Cause: com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lockwaittimeoutexceeded; try restarting transaction 原因:表的某条记录更增操作可能在另外一个大的事务里被锁,锁的时间超过了数据库指定时间(如下图:innodb_lock_wait_timeout=10秒),导致此处获取不到这条数据…
Unsupported conversion from DATE to java.lang.Long
Unsupported conversion from DATE to java.lang.Long 正解:DATE类型换成LocalDateTime 误解:去掉@Builder标签
2023-08-02 18:12 · java · mysql · springboot
统计代码行数
import lombok.extern.slf4j.Slf4j; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; @Slf4j @…
2023-07-13 11:06 · java
配置mysql日志打印
# 配置sql打印日志 mybatis-plus: configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl logging: level: root: info com.***.telemarket.mapper: trace 引入jar包并配置resources下的logback-spring.xml文件如下 <?xml version="1.0" encoding="UTF-8"?> <configuration> <!--获取podIp--> <conversionRule conversionWord=…
2023-07-12 16:49 · java · springboot
service 接口测试用例
@SpringBootTest(classes = TelemarketCoreApplication.class) @RunWith(SpringRunner.class) @ActiveProfiles("test") public class CouponsInfoServiceTest { @MockBean RestTemplate restTemplate; @Autowired private CouponsInfoService couponsInfoService; @Before public void setUp() { MockitoAnnotations.initM…
2022-06-24 16:35 · java
读excel文件生成sql
import java.io.*; import java.util.ArrayList; import java.util.List; public class StringToolSqlFormatter { private static final String SQL_1 = "update t_call_data set DECISION_COMPLETE_TYPE='BATCH_DECISION_COMPILTE' where REGISTER_ID=%s and DATE_FORMAT(IMPORT_TIME,'%Y-%m-%e')=" + "DATE_FORMAT(IMPOR…
2022-02-11 11:45 · java
rabbitmq 使用
API模块接收请求,推送到消息队列 router模块消费消息,分发到各个模块 每个模块消费消息,在推回API模块,因为api模块需要知道最终执行结果 API模块配置: spring: cloud: stream: bindings: outbound-agent-state-list.destination: outbound.agent-state-list #生产 agent-state-list-reply-channel: #消费回调回来的消息 destination: outbound.agent-state-list-reply group: ${nodeNo:0} durabl…
2020-05-07 19:07 · java
springBoot Annotation 入参返回值日志打印
一、定义注解 package com.yare.annotation; import java.lang.annotation.*; /** * @author : zhangyan 2018/9/19 * 日志注解 */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) @Inherited @Documented public @interface Log { String logStr() default ""; } 2.定义切面,实现环绕通知 package com.yare.annotation; i…
2018-09-19 16:03 · java
合并类里所有属性值
public String combineAllFields(String split) { final Field[] fields = this.getClass().getDeclaredFields(); if (fields.length < 1) { return null; } StringBuffer result = new StringBuffer(); for (int i = 0; i < fields.length; i++) { char[] cs = fields[i].getName().toCharArray(); cs[0] -= 32; try { Me…
2018-08-22 17:43 · java
quartz 数据库可配置
一、表设计: DROP TABLE IF EXISTS `ma_quartz_info`; CREATE TABLE `ma_quartz_info` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(32) DEFAULT '' COMMENT '定时任务名称', `code` varchar(64) DEFAULT '' COMMENT '定时任务code标识', `cycle` varchar(32) DEFAULT '' COMMENT '定时任务执行周期', `class_name` var…
2018-05-04 11:35 · java
如何正确遍历删除List中的元素,你会吗?
遍历删除List中的元素有很多种方法,当运用不当的时候就会产生问题。下面主要看看以下几种遍历删除List中元素的形式: 1.通过增强的for循环删除符合条件的多个元素 2.通过增强的for循环删除符合条件的一个元素 3.通过普通的for删除删除符合条件的多个元素 4.通过Iterator进行遍历删除符合条件的多个元素 /** * 使用增强的for循环 * 在循环过程中从List中删除非基本数据类型以后,继续循环List时会报ConcurrentModificationException */ public void listRemove() { List<Student> students …
2017-09-07 10:07 · java
获取本机的IP地址(去除127.0.0.1)
/** * Created by zhangyan on 2017/8/31. */ public class IpTool { private static final Logger LOG = Logger.getLogger(IpTool.class); public static String getLocalInet4Address() throws BaseException{ try { Enumeration allNetInterfaces = NetworkInterface.getNetworkInterfaces(); InetAddress ipAddress = …
2017-08-31 11:55 · java
maven 打包的pom.xml配置
<build> <finalName>whale_alarm</finalName> <sourceDirectory>src/main/java</sourceDirectory> <resources> <!-- 控制资源文件的拷贝 --> <resource> <directory>src/main/resources</directory> <targetPath>${project.build.directory}</targetPath> <filtering>true</filtering> <!-- excludes和includes二选一使用即可 --> <!-- 不包含的…
2017-05-27 10:32 · java
线程池压测
public static void main(String[] args) throws Exception { ExecutorService es = Executors.newFixedThreadPool(300); Callable<Object> cb = new Callable() { @Override public Object call() throws Exception { Connection conn = Neo4jUtil.getConnection(); Statement statement = conn.createStatement(); TimeU…