摘要: 前言 从线上sql server备份的数据文件是以.xb结尾的. 想要在本地恢复到mysql中,xb结尾的数据还只能在linux系统中恢复, 所以用xshell连接公司本地的linux电脑, 安装mysql,尝试了线上安装(网速早上好,其他时间段几kb/s...emmmm) 后面到https://d 阅读全文
posted @ 2020-07-14 09:33 i小松i 阅读(1722) 评论(0) 推荐(0)
摘要: public static <M> void merge( M destination,M target) throws Exception { BeanInfo beanInfo = Introspector.getBeanInfo(target.getClass()); // Iterate o 阅读全文
posted @ 2020-07-14 09:29 i小松i 阅读(278) 评论(0) 推荐(0)
摘要: 项目中采用工厂模式加策略模式,但是代码中还是存在大量的if esle 或者switch,为了消除冗余的代码,采用工厂+反射解决. @Autowired private ApplicationContext context; public RecoveryInterface getInterface( 阅读全文
posted @ 2020-07-14 09:28 i小松i 阅读(184) 评论(0) 推荐(0)
摘要: @GetMapping("/onlineCheckCar/loading") public ResponseEntity loadingPicture(String imgUrl) { try { return ResponseEntity.ok(resourceLoader.getResource 阅读全文
posted @ 2020-07-14 09:27 i小松i 阅读(811) 评论(0) 推荐(0)
摘要: 主要适用场景 意图: 当要更新一条记录的时候,希望这条记录没有被别人更新 乐观锁实现方式: 取出记录时,获取当前version 更新时,带上这个version 执行更新时, set version = newVersion where version = oldVersion 如果version不对 阅读全文
posted @ 2020-07-14 09:26 i小松i 阅读(495) 评论(0) 推荐(0)
摘要: public class CalculateUtil { /** * @param a 单数 32 * @param b 总数 145 * a / b 计算百分比32/145 * @return 22.07% */ public static String CalculateUtil(BigDeci 阅读全文
posted @ 2020-07-14 09:24 i小松i 阅读(3847) 评论(0) 推荐(1)
摘要: BigDecimal: BigDecimal bb =list.stream().map(Plan::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add); int、double、long: double max = list.stream().map 阅读全文
posted @ 2020-07-14 09:22 i小松i 阅读(10879) 评论(0) 推荐(0)
摘要: (?<=(src="))[^"]*?(?=") 这个正则可以取出来js的话可以这样用 var reg = /(?<=(src="))[^"]*?(?=")/ig; var allSrc = html内容变量.match(reg); for(int i = 0; i<allSrc.length;i++ 阅读全文
posted @ 2020-07-14 09:20 i小松i 阅读(1397) 评论(0) 推荐(0)
摘要: 类上面的@Transactional只有在出现异常的时候才会触发滚回事务,如果对订单表先插入一条数据,成功了,再去插入另一张的一条数据失败(但是没有出现异常)就会出现多了一条数据. 需要手动回滚事务: TransactionAspectSupport.currentTransactionStatus 阅读全文
posted @ 2020-07-14 09:18 i小松i 阅读(377) 评论(0) 推荐(0)
摘要: /** * 迭代删除权限 * * @param permissionIds 权限主键集合 */ private void iterationDeletePermission(List<String> permissionIds) { final List<Permission> permission 阅读全文
posted @ 2020-03-18 16:37 i小松i 阅读(222) 评论(0) 推荐(0)