Springboot集成flowable modeler web流程设计器

Easter79
• 阅读 1450

之前画流程图都是用tomcat启动flowable modeler,但是这样启动就不能在分配任务用户/用户组的时候查询自己系统里的数据。所以现在需要把flowable modeler集成到项目里来。

之前自己也搜索了很多文章,都感觉不是很清晰,可能也是因为我刚接触不久。现在自己集成好了之后,记录一下自己学习的结果。

  1. 首先需要创建一个springboot应用,pom文件中引入相关jar包:

    1.8 6.4.1 1.18.0 1.2.9
     <dependencyManagement>
     <dependencies>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-dependencies</artifactId>
             <type>pom</type>
             <scope>import</scope>
         </dependency>
         <!--Spring Cloud-->
         <dependency>
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-dependencies</artifactId>
             <type>pom</type>
             <scope>import</scope>
         </dependency>
     </dependencies>
     </dependencyManagement>
    
     <dependencies>
     <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter</artifactId>
     </dependency>
    
     <!-- 配置文件处理器 -->
     <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-configuration-processor</artifactId>
     </dependency>
     <!-- lombok -->
     <dependency>
         <groupId>org.projectlombok</groupId>
         <artifactId>lombok</artifactId>
         <version>${lombok.version}</version>
         <scope>provided</scope>
     </dependency>
     <!-- fastjson -->
     <dependency>
         <groupId>com.alibaba</groupId>
         <artifactId>fastjson</artifactId>
         <version>${fastjson.version}</version>
     </dependency>
     <!-- Druid -->
     <dependency>
         <groupId>com.alibaba</groupId>
         <artifactId>druid</artifactId>
         <version>1.1.9</version>
     </dependency>
    
     <!-- 通用工具类 -->
    
     <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-web</artifactId>
     </dependency>
    
     <!-- mysql 驱动 -->
     <dependency>
         <groupId>mysql</groupId>
         <artifactId>mysql-connector-java</artifactId>
         <version>5.1.47</version>
     </dependency>
     <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-pool2</artifactId>
         <version>2.6.1</version>
     </dependency>
     <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-lang3</artifactId>
         <version>3.8.1</version>
     </dependency>
    
     <!-- Flowable spring-boot 版套餐 -->
     <dependency>
         <groupId>org.flowable</groupId>
         <artifactId>flowable-spring-boot-starter</artifactId>
         <version>${flowable.version}</version>
     </dependency>
    
     <!-- Flowable 内部日志采用 SLF4J -->
     <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
         <version>1.7.21</version>
     </dependency>
     <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-log4j12</artifactId>
         <version>1.7.21</version>
     </dependency>
    
     <!-- app 依赖 包含 rest,logic,conf -->
     <dependency>
         <groupId>org.flowable</groupId>
         <artifactId>flowable-ui-modeler-rest</artifactId>
         <version>6.4.1</version>
     </dependency>
     <dependency>
         <groupId>org.flowable</groupId>
         <artifactId>flowable-ui-modeler-logic</artifactId>
         <version>6.4.1</version>
     </dependency>
     <dependency>
         <groupId>org.flowable</groupId>
         <artifactId>flowable-ui-modeler-conf</artifactId>
         <version>6.4.1</version>
     </dependency>
    
     <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-test</artifactId>
         <scope>test</scope>
         <exclusions>
             <exclusion>
                 <groupId>org.junit.vintage</groupId>
                 <artifactId>junit-vintage-engine</artifactId>
             </exclusion>
         </exclusions>
     </dependency>
    
  2. 然后需要将上一篇文章中说的在tomcat中启动的flowable modeler文件夹下的下面图片中的文件拷贝至springboot项目中resources文件夹下:

    4.png

    以下就是我的项目结构:

    5.png

    stencilset这个文件夹下是汉化文件。

  3. 下面是我们需要重写的三个文件:AppDispatcherServletConfiguration,ApplicationConfiguration,FlowableStencilSetResource这三个可以任意路径下

com.springcloud.flowable.conf.AppDispatcherServletConfiguration如下:

import org.flowable.ui.modeler.rest.app.EditorGroupsResource;import org.flowable.ui.modeler.rest.app.EditorUsersResource;import org.flowable.ui.modeler.rest.app.StencilSetResource;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import org.springframework.context.annotation.FilterType;import org.springframework.scheduling.annotation.EnableAsync;import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;import org.springframework.web.servlet.i18n.SessionLocaleResolver;import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;//www.1b23.com@Configuration@ComponentScan(value = { "org.flowable.ui.modeler.rest.app",
    },excludeFilters = {
        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = EditorUsersResource.class),
        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = EditorGroupsResource.class),
        @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = StencilSetResource.class),
    })@EnableAsyncpublic class AppDispatcherServletConfiguration implements WebMvcRegistrations {

    private static final Logger LOGGER = LoggerFactory.getLogger(AppDispatcherServletConfiguration.class);@Beanpublic SessionLocaleResolver localeResolver() {
    return new SessionLocaleResolver();}@Beanpublic LocaleChangeInterceptor localeChangeInterceptor() {
    LOGGER.debug("Configuring localeChangeInterceptor");
    LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor();
    localeChangeInterceptor.setParamName("language");
    return localeChangeInterceptor;}@Overridepublic RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
    LOGGER.debug("Creating requestMappingHandlerMapping");
    RequestMappingHandlerMapping requestMappingHandlerMapping = new RequestMappingHandlerMapping();
    requestMappingHandlerMapping.setUseSuffixPatternMatch(false);
    requestMappingHandlerMapping.setRemoveSemicolonContent(false);
    Object[] interceptors = { localeChangeInterceptor() };
    requestMappingHandlerMapping.setInterceptors(interceptors);
    return requestMappingHandlerMapping;}

}
com.springcloud.flowable.conf.ApplicationConfiguration如下:

 import org.flowable.ui.common.service.idm.RemoteIdmService;
 import org.flowable.ui.modeler.properties.FlowableModelerAppProperties;
 import org.flowable.ui.modeler.servlet.ApiDispatcherServletConfiguration;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
 import org.springframework.boot.web.servlet.ServletRegistrationBean;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.FilterType;
 import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
 import org.springframework.web.servlet.DispatcherServlet;//www.1b23.com@Configuration@EnableConfigurationProperties(FlowableModelerAppProperties.class)@ComponentScan(basePackages = {//        "org.flowable.ui.modeler.conf",
        "org.flowable.ui.modeler.repository",
        "org.flowable.ui.modeler.service",//        "org.flowable.ui.modeler.security", //授权方面的都不需要//        "org.flowable.ui.common.conf", // flowable 开发环境内置的数据库连接//        "org.flowable.ui.common.filter", // IDM 方面的过滤器
        "org.flowable.ui.common.service",
      "org.flowable.ui.common.repository",
    ////        "org.flowable.ui.common.security",//授权方面的都不需要"org.flowable.ui.common.tenant" },excludeFilters = {// 移除 RemoteIdmService@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = RemoteIdmService.class),})public class ApplicationConfiguration {@Beanpublic ServletRegistrationBean modelerApiServlet(ApplicationContext applicationContext) {
    AnnotationConfigWebApplicationContext dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();
    dispatcherServletConfiguration.setParent(applicationContext);
    dispatcherServletConfiguration.register(ApiDispatcherServletConfiguration.class);
    DispatcherServlet servlet = new DispatcherServlet(dispatcherServletConfiguration);
    ServletRegistrationBean registrationBean = new ServletRegistrationBean(servlet, "/api/*");
    registrationBean.setName("Flowable Modeler App API Servlet");
    registrationBean.setLoadOnStartup(1);
    registrationBean.setAsyncSupported(true);
    return registrationBean;}

}
com.springcloud.flowable.conf.FlowableStencilSetResource如下:

import com.fasterxml.jackson.databind.JsonNode;import com.fasterxml.jackson.databind.ObjectMapper;import org.flowable.ui.common.service.exception.InternalServerErrorException;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestMethod;import org.springframework.web.bind.annotation.RestController;//www.1b23.com@RestController@RequestMapping("/app")public class FlowableStencilSetResource {private static final Logger LOGGER = LoggerFactory.getLogger(FlowableStencilSetResource.class);@Autowiredprotected ObjectMapper objectMapper;@RequestMapping(value = "/rest/stencil-sets/editor", method = RequestMethod.GET, produces = "application/json")public JsonNode getStencilSetForEditor() {try {
         JsonNode stencilNode 
objectMapper.readTree(this.getClass().getClassLoader().getResourceAsStream("stencilset/stencilse 
   t_bpmn.json"));
        return stencilNode;
    } catch (Exception e) {
        LOGGER.error("Error reading bpmn stencil set json", e);
        throw new InternalServerErrorException("Error reading bpmn stencil set json");
        }
    }

    @RequestMapping(value = "/rest/stencil-sets/cmmneditor", method = RequestMethod.GET, produces = "application/json")
   public JsonNode getCmmnStencilSetForEditor() {
    try {
        JsonNode stencilNode = 
 objectMapper.readTree(this.getClass().getClassLoader().getResourceAsStream("stencilset/stencilse 
t_cmmn.json"));
        return stencilNode;
    } catch (Exception e) {
        LOGGER.error("Error reading bpmn stencil set json", e);
        throw new InternalServerErrorException("Error reading bpmn stencil set json");
    }
    }
 }

com.springcloud.flowable.controller.FlowableController:重写flowable modeler登陆的接口

7.png

import org.flowable.ui.common.model.UserRepresentation;import org.flowable.ui.common.security.DefaultPrivileges;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestMethod;import org.springframework.web.bind.annotation.RestController;import java.util.ArrayList;import java.util.List;/**
 * Flowable 相关接口
 *  www.1b23.com
 */@RestController@RequestMapping("/login")public class FlowableController {

  /**
   * 获取默认的管理员信息
   * @return
   */
   @RequestMapping(value = "/rest/account", method = RequestMethod.GET, produces = 
 "application/json")
    public UserRepresentation getAccount() {
      UserRepresentation userRepresentation = new UserRepresentation();
    userRepresentation.setId("admin");
    userRepresentation.setEmail("admin@flowable.org");
    userRepresentation.setFullName("Administrator");//        userRepresentation.setLastName("Administrator");
    userRepresentation.setFirstName("Administrator");
    List<String> privileges = new ArrayList<>();
    privileges.add(DefaultPrivileges.ACCESS_MODELER);
    privileges.add(DefaultPrivileges.ACCESS_IDM);
    privileges.add(DefaultPrivileges.ACCESS_ADMIN);
    privileges.add(DefaultPrivileges.ACCESS_TASK);
    privileges.add(DefaultPrivileges.ACCESS_REST_API);
    userRepresentation.setPrivileges(privileges);
    return userRepresentation;
    }}

添加流程时会用到用户id,这里重构SecurityUtils.getCurrentUserObject 获取用户信息,这个文件路径必须和原路径一致:
org.flowable.ui.common.security.SecurityUtils

import org.flowable.idm.api.User;import org.flowable.ui.common.model.RemoteUser;import org.springframework.security.core.GrantedAuthority;import org.springframework.security.core.context.SecurityContext;import org.springframework.security.core.context.SecurityContextHolder;import java.util.ArrayList;import java.util.List;
 /**
 * Utility class for Spring Security.  
*  www.1b23.com */
 public class SecurityUtils {

   private static User assumeUser;

    private SecurityUtils() {
    }

    /**
    * Get the login of the current user.
    */
    public static String getCurrentUserId() {
      User user = getCurrentUserObject();
      if (user != null) {
        return user.getId();
      }
     return null;
  }

  /**
  * @return the {@link User} object associated with the current logged in user.
  */
 public static User getCurrentUserObject() {
     if (assumeUser != null) {
         return assumeUser;
     }

    RemoteUser user = new RemoteUser();
    user.setId("admin");
    user.setDisplayName("Administrator");
    user.setFirstName("Administrator");
    user.setLastName("Administrator");
    user.setEmail("admin@flowable.com");
    user.setPassword("123456");
    List<String> pris = new ArrayList<>();
    pris.add(DefaultPrivileges.ACCESS_MODELER);
    pris.add(DefaultPrivileges.ACCESS_IDM);
    pris.add(DefaultPrivileges.ACCESS_ADMIN);
    pris.add(DefaultPrivileges.ACCESS_TASK);
    pris.add(DefaultPrivileges.ACCESS_REST_API);
    user.setPrivileges(pris);
     return user;
  }

 public static FlowableAppUser getCurrentFlowableAppUser() {
    FlowableAppUser user = null;
    SecurityContext securityContext = SecurityContextHolder.getContext();
    if (securityContext != null && securityContext.getAuthentication() != null) {
        Object principal = securityContext.getAuthentication().getPrincipal();
        if (principal instanceof FlowableAppUser) {
            user = (FlowableAppUser) principal;
        }
     }
     return user;
 }

 public static boolean currentUserHasCapability(String capability) {
    FlowableAppUser user = getCurrentFlowableAppUser();
    for (GrantedAuthority grantedAuthority : user.getAuthorities()) {
        if (capability.equals(grantedAuthority.getAuthority())) {
            return true;
        }
     }
     return false;
 }

 public static void assumeUser(User user) {
     assumeUser = user;
 }

 public static void clearAssumeUser() {
     assumeUser = null;
 }

}

配置文件:application.yml:

server:port: 8087spring:datasource:
  url: jdbc:mysql://127.0.0.1:3306/pyj?useUnicode=true&characterEncoding=utf8  username: root  password: 123456
  driverClassName: com.mysql.jdbc.Driver
  resources:
 mybatis:
 mapper-locations: mapper/*/*.xml, classpath*:mapper/*.xml configuration:
  log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

启动类:SpringCloudApplication

import com.springcloud.flowable.conf.AppDispatcherServletConfiguration;import com.springcloud.flowable.conf.ApplicationConfiguration;import org.flowable.ui.modeler.conf.DatabaseConfiguration;import org.mybatis.spring.annotation.MapperScan;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Import;@Import(value={
    // 引入修改的配置
    ApplicationConfiguration.class,
    AppDispatcherServletConfiguration.class,
    // 引入 DatabaseConfiguration 表更新转换
    DatabaseConfiguration.class})// Eureka 客户端@ComponentScan(basePackages = {"com.springcloud.*"})@MapperScan("com.springcloud.*.dao")// 移除 Security 自动配置@SpringBootApplication(exclude={SecurityAutoConfiguration.class})public class SpringcloudApplication {

  public static void main(String[] args) {
      SpringApplication.run(SpringcloudApplication.class, args);
  }}

这个配置很重要 @SpringBootApplication(exclude={SecurityAutoConfiguration.class}):排除springsecurity认证

接下来启动项目:输入:localhost:8087

8.png

最后重写获取用户,用户组接口

import org.apache.commons.lang3.StringUtils;import org.flowable.engine.ManagementService;import org.flowable.idm.api.Group;import org.flowable.idm.api.IdmIdentityService;import org.flowable.idm.api.User;import org.flowable.ui.common.model.GroupRepresentation;import org.flowable.ui.common.model.ResultListDataRepresentation;import org.flowable.ui.common.model.UserRepresentation;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestMethod;import org.springframework.web.bind.annotation.RequestParam;import org.springframework.web.bind.annotation.RestController;import java.util.ArrayList;import java.util.List;//www.1b23.com@RestController@RequestMapping("app")public class UserAndGroupResourceController {

 @Autowired
 protected ManagementService managementService;
 @Autowiredprotected IdmIdentityService idmIdentityService;@RequestMapping(value = "/rest/editor-groups", method = RequestMethod.GET)public ResultListDataRepresentation getGroups(@RequestParam(required = false, value = "filter") String filter) {
    if (StringUtils.isNotBlank(filter)) {
        filter = filter.trim();
        String sql = "select * from ACT_ID_GROUP where NAME_ like #{name}";
        filter = "%" + filter + "%";
        List<Group> groups = idmIdentityService.createNativeGroupQuery().sql(sql).parameter("name", filter).listPage(0, 10);
        List<GroupRepresentation> result = new ArrayList<>();
        for (Group group : groups) {
            result.add(new GroupRepresentation(group));
        }
        return new ResultListDataRepresentation(result);
    }
    return null;
 }

 @RequestMapping(value = "/rest/editor-users", method = RequestMethod.GET)
 public ResultListDataRepresentation getUsers(@RequestParam(value = "filter", required = false) String filter) {
    if (StringUtils.isNotBlank(filter)) {
        filter = filter.trim();
        String sql = "select * from ACT_ID_USER where ID_ like #{id} or LAST_ like #{name}";
        filter = "%"+filter+"%";
        List<User> matchingUsers = 
 idmIdentityService.createNativeUserQuery().sql(sql).parameter("id",filter).parameter("name",filter).listPage(0, 10);List<UserRepresentation> userRepresentations = new ArrayList<>(matchingUsers.size());
        for (User user : matchingUsers) {
            userRepresentations.add(new UserRepresentation(user));
        }
        return new ResultListDataRepresentation(userRepresentations);
    }
    return null;
  }

}

将flowable启动时自建的表:ACT_ID_MEMBERSHIP,ACT _ID_GROUP, ACT_ID_USER 删除
自建视图查询自己系统中的用户/权限/角色表:

-- 用户表CREATE VIEW ACT_ID_USER AS SELECT SU.USER_ID AS ID_,1 AS REV_,SU.REAL_NM AS FIRST_,concat('',SU.USER_ID) AS LAST_ ,'000000' AS PWD_ , SUL.LOGIN_EMAIL AS EMAIL_, SU.WEB_FACE AS PICTURE_ID_FROM SYS_USER AS SU INNER JOIN sys_manager.SYS_USER_LOGIN AS SULON SU.USER_ID = SUL.USER_ID;-- 分组表CREATE VIEW ACT_ID_GROUP AS SELECT SR.ROLE_ID AS ID_ , 1 AS REV_, SR.ROLE_NM AS NAME_,CASE WHEN SR.IS_ADMIN=1 then 'admin' else 'ordinary' end as TYPE_ FROM SYS_ROLE AS SR;-- 关系表CREATE VIEW ACT_ID_MEMBERSHIP AS SELECT SUR.USER_ID AS USER_ID_,SUR.ROLE_ID AS GROUP_ID_ FROM SYS_USER_ROLE AS SUR;
点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Wesley13 Wesley13
2年前
java将前端的json数组字符串转换为列表
记录下在前端通过ajax提交了一个json数组的字符串,在后端如何转换为列表。前端数据转化与请求varcontracts{id:'1',name:'yanggb合同1'},{id:'2',name:'yanggb合同2'},{id:'3',name:'yang
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
皕杰报表(关于日期时间时分秒显示不出来)
在使用皕杰报表设计器时,数据据里面是日期型,但当你web预览时候,发现有日期时间类型的数据时分秒显示不出来,只有年月日能显示出来,时分秒显示为0:00:00。1.可以使用tochar解决,数据集用selecttochar(flowdate,"yyyyMMddHH:mm:ss")fromtablename2.也可以把数据库日期类型date改成timestamp
Stella981 Stella981
2年前
Android So动态加载 优雅实现与原理分析
背景:漫品Android客户端集成适配转换功能(基于目标识别(So库35M)和人脸识别库(5M)),导致apk体积50M左右,为优化客户端体验,决定实现So文件动态加载.!(https://oscimg.oschina.net/oscnet/00d1ff90e4b34869664fef59e3ec3fdd20b.png)点击上方“蓝字”关注我
Easter79 Easter79
2年前
Twitter的分布式自增ID算法snowflake (Java版)
概述分布式系统中,有一些需要使用全局唯一ID的场景,这种时候为了防止ID冲突可以使用36位的UUID,但是UUID有一些缺点,首先他相对比较长,另外UUID一般是无序的。有些时候我们希望能使用一种简单一些的ID,并且希望ID能够按照时间有序生成。而twitter的snowflake解决了这种需求,最初Twitter把存储系统从MySQL迁移
Easter79 Easter79
2年前
SringBoot启动报日志配置错误
最近在启动项目的时候,报错,报错的原因是springBoot日志配置文件不对。由于自己是刚接触springboot,是同事帮忙解决的,自己非常感谢!先总结如下:1.首先,找到logbackspring.xml配置文件1<springPropertyscope"context"name"springAppNa
Wesley13 Wesley13
2年前
35岁是技术人的天花板吗?
35岁是技术人的天花板吗?我非常不认同“35岁现象”,人类没有那么脆弱,人类的智力不会说是35岁之后就停止发展,更不是说35岁之后就没有机会了。马云35岁还在教书,任正非35岁还在工厂上班。为什么技术人员到35岁就应该退役了呢?所以35岁根本就不是一个问题,我今年已经37岁了,我发现我才刚刚找到自己的节奏,刚刚上路。
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这
Easter79
Easter79
Lv1
今生可爱与温柔,每一样都不能少。
文章
2.8k
粉丝
5
获赞
1.2k