From 2d5e64b207c020fc49389a8c87ec1d7ab6b7e844 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 12 Mar 2021 14:29:51 +0800 Subject: [PATCH 01/63] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=AE=9A=E5=88=B6?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8C=83=E5=9B=B4=EF=BC=9A=E4=B8=9A=E5=8A=A1?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E3=80=81=E5=A4=96=E9=93=BE=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/UpdateCustomerFunctionFormDTO.java | 10 ++++++++++ .../controller/CustomerFunctionDetailController.java | 1 - .../java/com/epmet/dao/CustomerFunctionDetailDao.java | 1 + .../epmet/service/CustomerFunctionDetailService.java | 1 + .../resources/mapper/CustomerFunctionDetailDao.xml | 7 +++++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java index 83800e2af5..3f65de5bb8 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java @@ -50,4 +50,14 @@ public class UpdateCustomerFunctionFormDTO implements Serializable { private String iconSmallImg; private String userId; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 自定义业务域名(可设置多个 用分号分隔) + */ + private String domainName; } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java index 0778f3d989..3a69b6da62 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java @@ -143,7 +143,6 @@ public class CustomerFunctionDetailController { /** * 客户定制功能修改 入参 - * 目前允许修改功能名称、大小图标 * * @param tokenDto * @param formDTO diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java index bfbefc518d..8334159e8c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java @@ -73,6 +73,7 @@ public interface CustomerFunctionDetailDao extends BaseDao ICON_SMALL_IMG = #{iconSmallImg}, + + + DOMAIN_NAME = #{domainName}, + + + TARGET_LINK = #{targetLink}, + UPDATED_BY = #{userId}, UPDATED_TIME = now() WHERE From bf3cd3b7428ee9260aef5f419a7b147a03808290 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 16 Mar 2021 17:43:05 +0800 Subject: [PATCH 02/63] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=8F=9C=E5=8D=95-?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/GovCustomerMenuDTO.java | 81 +++++++++++ .../com/epmet/dto/form/MenuConfigFormDTO.java | 27 ++++ .../controller/GovCustomerMenuController.java | 129 +++++++++++++++++ .../com/epmet/dao/GovCustomerMenuDao.java | 55 ++++++++ .../main/java/com/epmet/dao/GovMenuDao.java | 9 ++ .../epmet/entity/GovCustomerMenuEntity.java | 51 +++++++ .../com/epmet/excel/GovCustomerMenuExcel.java | 62 ++++++++ .../com/epmet/redis/GovCustomerMenuRedis.java | 47 +++++++ .../epmet/service/GovCustomerMenuService.java | 126 +++++++++++++++++ .../impl/GovCustomerMenuServiceImpl.java | 132 ++++++++++++++++++ .../service/impl/GovMenuServiceImpl.java | 30 +++- .../resources/mapper/GovCustomerMenuDao.xml | 29 ++++ .../src/main/resources/mapper/GovMenuDao.xml | 14 ++ 13 files changed, 785 insertions(+), 7 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java create mode 100644 epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovCustomerMenuDao.xml diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java new file mode 100644 index 0000000000..93d5e9c66e --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovCustomerMenuDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Data +public class GovCustomerMenuDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * gov_menu表主键 + */ + private String tableId; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java new file mode 100644 index 0000000000..1bd4fc67bc --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuConfigFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 菜单配置 - 一菜单 多 客户 + */ +@Data +public class MenuConfigFormDTO implements Serializable { + private static final long serialVersionUID = -2898130727929596798L; + + /** + * gov_menu表主键 + */ + @NotBlank(message = "菜单ID不能为空") + private String tableId; + + /** + * 客户id 列表 + */ + @NotBlank(message = "客户id 列表不能为空") + private List customerIds; +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java new file mode 100644 index 0000000000..5e60482a5f --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java @@ -0,0 +1,129 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.GovCustomerMenuDTO; +import com.epmet.dto.form.MenuConfigFormDTO; +import com.epmet.excel.GovCustomerMenuExcel; +import com.epmet.service.GovCustomerMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@RestController +@RequestMapping("govcustomermenu") +public class GovCustomerMenuController { + + @Autowired + private GovCustomerMenuService govCustomerMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govCustomerMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovCustomerMenuDTO data = govCustomerMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovCustomerMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govCustomerMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovCustomerMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govCustomerMenuService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govCustomerMenuService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = govCustomerMenuService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, GovCustomerMenuExcel.class); + } + + /** + * 给每个客户 配置可见菜单 + * 先删除,后新增 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:15 2021-03-16 + **/ + @PostMapping("addcustomermenu") + public Result addCustomerMenu(@RequestBody MenuConfigFormDTO formDTO) { + //效验数据 + if (StringUtils.isBlank(formDTO.getTableId())) { + throw new RenException("菜单ID不能为空"); + } + govCustomerMenuService.saveCustomerMenu(formDTO); + return new Result(); + } + + /** + * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds) + * + * @param tableId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 16:26 2021-03-16 + **/ + @GetMapping("getcustomerids/{tableid}") + public Result> getcustomerids(@PathVariable("tableid") String tableId){ + List data = govCustomerMenuService.getcustomerIds(tableId); + return new Result>().ok(data); + } +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java new file mode 100644 index 0000000000..6daa27f116 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovCustomerMenuDao.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovCustomerMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Mapper +public interface GovCustomerMenuDao extends BaseDao { + + /** + * 根据gov_menu表主键,先清除之前配置的客户信息 + * + * @param tableId + * @return void + * @Author zhangyong + * @Date 14:24 2021-03-16 + **/ + void deleteBatchTableIds(@Param("tableId") String tableId); + + /** + * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds) + * + * @param tableId + * @return java.util.List + * @Author zhangyong + * @Date 16:29 2021-03-16 + **/ + List selectListcustomerIds(@Param("tableId") String tableId); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java index 1e36bff758..ba05556dc1 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java @@ -49,4 +49,13 @@ public interface GovMenuDao extends BaseDao { * @param pid 父菜单ID */ List getListPid(String pid); + + /** + * 查询客户菜单列表 + * + * @param customerId 客户id + * @param type 菜单类型 + * @param language 语言 + */ + List getCustomerMenuList(@Param("customerId") String customerId, @Param("type") Integer type, @Param("language") String language); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java new file mode 100644 index 0000000000..d0358e7124 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovCustomerMenuEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_customer_menu") +public class GovCustomerMenuEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * gov_menu表主键 + */ + private String tableId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java new file mode 100644 index 0000000000..1ac8f2d886 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/excel/GovCustomerMenuExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Data +public class GovCustomerMenuExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "gov_menu表主键") + private String tableId; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java new file mode 100644 index 0000000000..2333a6bd48 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Component +public class GovCustomerMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java new file mode 100644 index 0000000000..dea2a31ca0 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovCustomerMenuService.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GovCustomerMenuDTO; +import com.epmet.dto.form.MenuConfigFormDTO; +import com.epmet.entity.GovCustomerMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +public interface GovCustomerMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-03-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-03-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovCustomerMenuDTO + * @author generator + * @date 2021-03-16 + */ + GovCustomerMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-03-16 + */ + void save(GovCustomerMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-03-16 + */ + void update(GovCustomerMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-03-16 + */ + void delete(String[] ids); + + /** + * 给每个客户 配置可见菜单 + * + * @param formDTO + * @return void + * @Author zhangyong + * @Date 14:16 2021-03-16 + **/ + void saveCustomerMenu(MenuConfigFormDTO formDTO); + + /** + * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds) + * + * @param tableId + * @return java.util.List + * @Author zhangyong + * @Date 16:29 2021-03-16 + **/ + List getcustomerIds(String tableId); + + /** + * 根据gov_menu表主键,先清除之前配置的客户信息 + * + * @param tableId + * @return void + * @Author zhangyong + * @Date 14:24 2021-03-16 + **/ + void deleteBatchTableIds(String tableId); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java new file mode 100644 index 0000000000..32cf57e0c7 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.GovCustomerMenuDao; +import com.epmet.dto.GovCustomerMenuDTO; +import com.epmet.dto.form.MenuConfigFormDTO; +import com.epmet.entity.GovCustomerMenuEntity; +import com.epmet.redis.GovCustomerMenuRedis; +import com.epmet.service.GovCustomerMenuService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户菜单配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-16 + */ +@Service +public class GovCustomerMenuServiceImpl extends BaseServiceImpl implements GovCustomerMenuService { + + @Autowired + private GovCustomerMenuRedis govCustomerMenuRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovCustomerMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovCustomerMenuDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public GovCustomerMenuDTO get(String id) { + GovCustomerMenuEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovCustomerMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovCustomerMenuDTO dto) { + GovCustomerMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovCustomerMenuEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovCustomerMenuDTO dto) { + GovCustomerMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovCustomerMenuEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void saveCustomerMenu(MenuConfigFormDTO formDTO) { + if (NumConstant.ZERO < formDTO.getCustomerIds().size()) { + baseDao.deleteBatchTableIds(formDTO.getTableId()); + + List entities = new ArrayList<>(); + for (String customerId : formDTO.getCustomerIds()) { + GovCustomerMenuEntity entity = new GovCustomerMenuEntity(); + entity.setCustomerId(customerId); + entity.setTableId(formDTO.getTableId()); + entities.add(entity); + } + insertBatch(entities); + } + } + + @Override + public List getcustomerIds(String tableId) { + return baseDao.selectListcustomerIds(tableId); + } + + @Override + public void deleteBatchTableIds(String tableId) { + baseDao.deleteBatchTableIds(tableId); + } +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index 5a6efd43f2..cfa42e4975 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -35,10 +35,7 @@ import com.epmet.entity.GovMenuEntity; import com.epmet.enums.MenuTypeEnum; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.redis.GovMenuRedis; -import com.epmet.service.GovLanguageService; -import com.epmet.service.GovMenuService; -import com.epmet.service.GovResourceService; -import com.epmet.service.GovRoleMenuService; +import com.epmet.service.*; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,6 +64,8 @@ public class GovMenuServiceImpl extends BaseServiceImpl page(Map params) { @@ -154,6 +153,9 @@ public class GovMenuServiceImpl extends BaseServiceImpl getUserMenuNavList(TokenDto tokenDto) { List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); if(menuList == null){ - menuList = getUserMenuList(tokenDto, MenuTypeEnum.MENU.value()); + menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); govMenuRedis.setUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient(), menuList); } @@ -195,6 +197,21 @@ public class GovMenuServiceImpl extends BaseServiceImpl + * @Author zhangyong + * @Date 15:51 2021-03-16 + **/ + private List getCustomerMenuList(String customerId, Integer type) { + List menuList = baseDao.getCustomerMenuList(customerId, type, HttpContextUtils.getLanguage()); + List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); + return TreeUtils.buildTree(dtoList); + } + @Override public Set getUserPermissions(TokenDto tokenDto) { //用户权限列表 @@ -243,5 +260,4 @@ public class GovMenuServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + UPDATE gov_customer_menu SET DEL_FLAG = '1' + WHERE DEL_FLAG = '0' + AND TABLE_ID = #{tableId, jdbcType=VARCHAR} + + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml index 90d0b8ee92..9ac55ce17b 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml @@ -39,4 +39,18 @@ select * from gov_menu where del_flag = 0 and pid = #{value} + From 3a3a1cab733ae07715ed8a77303fa9adc621ff15 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 17 Mar 2021 09:42:36 +0800 Subject: [PATCH 03/63] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E7=BC=93=E5=AD=98key?= =?UTF-8?q?=EF=BC=8C=E7=94=B1userId=20=E6=94=B9=E4=B8=BA=20customerId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/GovMenuServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index cfa42e4975..1f16ad89e9 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -187,11 +187,11 @@ public class GovMenuServiceImpl extends BaseServiceImpl getUserMenuNavList(TokenDto tokenDto) { - List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient()); if(menuList == null){ menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); - govMenuRedis.setUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient(), menuList); + govMenuRedis.setUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient(), menuList); } return menuList; From 41e26e774a2573954984f75fa31c856754e810b5 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 17 Mar 2021 10:13:39 +0800 Subject: [PATCH 04/63] =?UTF-8?q?=E6=94=B9=E6=88=90post=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/GovCustomerMenuController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java index 5e60482a5f..a3cb9f8946 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java @@ -121,7 +121,7 @@ public class GovCustomerMenuController { * @Author zhangyong * @Date 16:26 2021-03-16 **/ - @GetMapping("getcustomerids/{tableid}") + @PostMapping("getcustomerids/{tableid}") public Result> getcustomerids(@PathVariable("tableid") String tableId){ List data = govCustomerMenuService.getcustomerIds(tableId); return new Result>().ok(data); From 683326487fe576af3df9b37a8c3f2ec29995e2f1 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Fri, 19 Mar 2021 10:13:01 +0800 Subject: [PATCH 05/63] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E6=8E=A5=E5=8F=A3=20-=20=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/MenuFormDTO.java | 22 +++++++++++++++++++ .../controller/GovCustomerMenuController.java | 9 ++++---- 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java new file mode 100644 index 0000000000..83149065c5 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/MenuFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 菜单基础入参 + */ +@Data +public class MenuFormDTO implements Serializable { + private static final long serialVersionUID = -2898130727929596798L; + + /** + * gov_menu表主键 + */ + @NotBlank(message = "菜单ID不能为空") + private String tableId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java index a3cb9f8946..77d498fb37 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovCustomerMenuController.java @@ -28,6 +28,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.GovCustomerMenuDTO; import com.epmet.dto.form.MenuConfigFormDTO; +import com.epmet.dto.form.MenuFormDTO; import com.epmet.excel.GovCustomerMenuExcel; import com.epmet.service.GovCustomerMenuService; import org.apache.commons.lang3.StringUtils; @@ -116,14 +117,14 @@ public class GovCustomerMenuController { /** * 根据gov_menu表主键,查询拥有这项菜单的所有客户(customerIds) * - * @param tableId + * @param formDTO * @return com.epmet.commons.tools.utils.Result> * @Author zhangyong * @Date 16:26 2021-03-16 **/ - @PostMapping("getcustomerids/{tableid}") - public Result> getcustomerids(@PathVariable("tableid") String tableId){ - List data = govCustomerMenuService.getcustomerIds(tableId); + @PostMapping("getcustomerids") + public Result> getcustomerids(@RequestBody MenuFormDTO formDTO){ + List data = govCustomerMenuService.getcustomerIds(formDTO.getTableId()); return new Result>().ok(data); } } From 8b5d7cf0f9ede1af33dea501879e525d26af7e67 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 19 Mar 2021 16:01:09 +0800 Subject: [PATCH 06/63] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/IssueVoteStatisticalServiceImpl.java | 5 ++++- .../member/service/impl/ResiGroupMemberServiceImpl.java | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index 003b0acd9e..258f91bd74 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -258,6 +258,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl issues = @@ -265,18 +266,20 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet()); List gridIds = issues.stream().map(IssueDTO::getGridId).distinct().collect(Collectors.toList()); CommonGridIdListFormDTO gridIdList = new CommonGridIdListFormDTO(); gridIdList.setGridIds(gridIds); + // 根据网格Id查询网格下所有加入组的组员 Result votableCountResult = resiGroupFeignClient.votableCounts(gridIdList); Map votableCountMap1 = null; if(votableCountResult.success() && null != votableCountResult.getData() && null != votableCountResult.getData().getVotableCountMap()){ votableCountMap1 = votableCountResult.getData().getVotableCountMap(); } final Map votableCountMap = votableCountMap1; - + //查询指定议题的统计数据 List statisticalList = baseDao.selectListByIds(ids); if (null != statisticalList && statisticalList.size() > NumConstant.ZERO) { diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java index d420a7205b..33c2af52a6 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java @@ -814,9 +814,11 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl votableCountMap = new HashMap<>(); + // 给每个网格初始化 加入小组人数:0 gridList.getGridIds().forEach(gridId -> { votableCountMap.put(gridId, NumConstant.ZERO ); }); + // 查询 每个网格的人数 STATE = approved的 List list = baseDao.getMembersCountInGrids(gridList.getGridIds()); if(null == list || list.size() < NumConstant.ZERO){ result.setVotableCountMap(votableCountMap); From b4d30dc027df653f9daae8e83268ac4483815068 Mon Sep 17 00:00:00 2001 From: wangchao Date: Sat, 20 Mar 2021 00:19:05 +0800 Subject: [PATCH 07/63] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/IssueAuditController.java | 8 ++++++++ .../src/main/java/com/epmet/service/IssueService.java | 9 ++++++++- .../java/com/epmet/service/impl/IssueServiceImpl.java | 8 ++++++++ .../group/dto/member/ResiGroupMemberInfoRedisDTO.java | 5 +++-- .../modules/member/redis/ResiGroupMemberRedis.java | 5 ++--- .../com/epmet/controller/UserResiInfoController.java | 10 ++++++++++ 6 files changed, 39 insertions(+), 6 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java index d6519fb6e9..f3320a96b8 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueAuditController.java @@ -115,6 +115,14 @@ public class IssueAuditController { return new Result>().ok(issueApplicationHistoryService.applicationHistoryWork(applicationHistoryWorkFormDTO)); } + /** + * @Description 工作端议题审核 + * @param token + * @param param + * @return java.lang.String + * @author wangc + * @date 2021.03.19 23:40 + */ @PostMapping("audit") public Result audit(@LoginUser TokenDto token, @RequestBody IssueAuditionFormDTO param){ return new Result().ok(issueService.audit(token,param)); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index 0c58cfc807..4b14996149 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java @@ -152,7 +152,14 @@ public interface IssueService extends BaseService { * @date 2020.11.19 10:02 */ FirstTopicShiftedToIssueApplicationResultDTO topicShiftedToIssueV2(IssueShiftedFromTopicFormDTO issueShiftedFromTopicFormDTO); - + /** + * @Description 工作端议题审核 + * @param token + * @param param + * @return java.lang.String + * @author wangc + * @date 2021.03.19 23:40 + */ String audit(TokenDto token, IssueAuditionFormDTO param); /** diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 40fb145f77..b7d6c57015 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -443,6 +443,14 @@ public class IssueServiceImpl extends BaseServiceImpl imp return result; } + /** + * @Description 工作端议题审核 + * @param token + * @param param + * @return java.lang.String + * @author wangc + * @date 2021.03.19 23:40 + */ @Override @Transactional(rollbackFor = Exception.class) public String audit(TokenDto token, IssueAuditionFormDTO param){ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java index 1bbabfc036..cb468c33fe 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberInfoRedisDTO.java @@ -51,7 +51,7 @@ public class ResiGroupMemberInfoRedisDTO implements Serializable { * */ private String memberMobile; /** - * 组Id,不存在redis的value中,存在redis的key中 + * 组Id * */ private String groupId; @@ -64,7 +64,8 @@ public class ResiGroupMemberInfoRedisDTO implements Serializable { "userShowName": "山东路-尹女士", "groupLeaderFlag": "leader", "enterGroupType": "created", - "memberStatus": "approved" + "memberStatus": "approved", + "groupId":"***" } * * diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java index d635bd1dea..c2c735c70b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/redis/ResiGroupMemberRedis.java @@ -85,7 +85,7 @@ public class ResiGroupMemberRedis { } /** - * @Description 得到一个指定组内成员信息,如果redis中没有,则返回null + * @Description 得到一个指定组内成员信息,如果redis中没有,则去数据库查询并放入缓存 * @Param groupId * @Param userId * @return ResiGroupMemberInfoRedisDTO.class @@ -97,7 +97,7 @@ public class ResiGroupMemberRedis { ResiGroupMemberInfoRedisDTO memberCache = (ResiGroupMemberInfoRedisDTO) redisUtils.get(ResiGroupRedisKeys.getResiGroupMemberInfoKey(groupId,userId)); //如果缓存中没有该成员数据 - if(null == memberCache || StringUtils.isNotBlank(memberCache.getUserId())){ + if(null == memberCache || StringUtils.isBlank(memberCache.getUserId())){ Map param = new HashMap<>(); param.put(TopicConstant.CUSTOMER_USER_ID,userId); param.put(TopicConstant.RESI_GROUP_ID,groupId); @@ -140,7 +140,6 @@ public class ResiGroupMemberRedis { .concat(userId)); } } - memberCache.setGroupId(groupId); return memberCache; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index e4f54f6aa7..9275fb8707 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java @@ -202,6 +202,16 @@ public class UserResiInfoController { return new Result(); } + /** + * @Description 在分享链接之后完成注册居民之后调用的接口 + * 作用 + * + * 更改邀请浏览记录里"是否通过邀请链接注册居民" + * @param param + * @return void + * @author wangc + * @date 2020.12.18 16:34 + */ @PostMapping("submitinlink") public Result submitInLink(@RequestBody AfterRegisterResidentInSharableLinkFormDTO param, @LoginUser TokenDto token){ param.setInviteeId(token.getUserId()); From 070c228db323942fd473d7f68e76f74cb0052bd3 Mon Sep 17 00:00:00 2001 From: wangchao Date: Sun, 21 Mar 2021 23:37:37 +0800 Subject: [PATCH 08/63] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/impl/ProjectServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index 309377bb4b..e3c0f23a2d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -1107,6 +1107,17 @@ public class ProjectServiceImpl extends BaseServiceImpl Date: Mon, 22 Mar 2021 00:40:31 +0800 Subject: [PATCH 09/63] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/topic/impl/TopicServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 83e3b9da38..3046f2d6c6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -74,7 +74,7 @@ public class TopicServiceImpl implements TopicService { agencies.forEach(agency -> { initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); }); - + //计算网格-组映射关系 List topics = topicDao.selectGroupOrderByGrid(targetDate,customerId); topics.forEach(groupTopic -> { if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){ From efe7e7405f7afc84d3aef2860ac24683c683fea6 Mon Sep 17 00:00:00 2001 From: wangchao Date: Mon, 22 Mar 2021 00:43:00 +0800 Subject: [PATCH 10/63] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/topic/impl/TopicServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 3046f2d6c6..c832202e70 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -74,7 +74,7 @@ public class TopicServiceImpl implements TopicService { agencies.forEach(agency -> { initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); }); - //计算网格-组映射关系 + //计算网格-组-话题映射关系 List topics = topicDao.selectGroupOrderByGrid(targetDate,customerId); topics.forEach(groupTopic -> { if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){ From a6e8a50744655b67d6d5a67e6f02019ab8fa140b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 22 Mar 2021 10:34:29 +0800 Subject: [PATCH 11/63] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml index 84d66f138b..71da21f685 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueVoteStatisticalDailyDao.xml @@ -23,6 +23,9 @@ + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml index f171a790e3..eb4c0e2d93 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml @@ -140,6 +140,5 @@ #{issueId} - order by CREATED_TIME desc limit 100 \ No newline at end of file From 12a5d2243505d7ac87b49a0f6989d4b121f4df24 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 24 Mar 2021 15:02:54 +0800 Subject: [PATCH 17/63] =?UTF-8?q?=E7=AD=9B=E9=80=89=E7=AC=A6=E5=90=88?= =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9=E7=9A=84=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?sql=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectMainDailyDao.xml | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 89ba03036c..675cce9c31 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -395,23 +395,25 @@ LEFT JOIN ( - SELECT - - project.ID AS projectId, - IF(project.project_status = 'closed',period.handled_date,NOW()) AS finishDate - - FROM fact_origin_project_main_daily project LEFT JOIN fact_origin_project_org_period_daily period - ON project.ID = period.project_id AND period.del_flag = '0' AND period.customer_id = #{customerId} - AND period.operation = 'close' - WHERE project.customer_id = #{customerId} AND project.del_flag = '0' - ) projectFinishDate ON projectFinishDate.projectId = period.project_id - - WHERE - period.del_flag = '0' + SELECT + project.ID AS projectId, + IFNULL(period.handled_date,NOW()) AS finishDate + FROM + fact_origin_project_main_daily project + LEFT JOIN fact_origin_project_org_period_daily period ON project.ID = period.project_id + AND period.del_flag = '0' AND period.customer_id = #{customerId} - AND TIMESTAMPDIFF( DAY, period.informed_date, projectFinishDate.finishDate) > #{thresholdValue} - ) + AND period.operation = 'close' + WHERE + project.customer_id = #{customerId} + AND project.del_flag = '0' + ) projectFinishDate ON projectFinishDate.projectId = period.project_id + WHERE + period.del_flag = '0' + AND period.customer_id = #{customerId} + AND TIMESTAMPDIFF( DAY, period.informed_date, IFNULL(period.handled_date,projectFinishDate.finishDate)) > #{thresholdValue} + ) From 2a6bf3cf8eb59a6b2c0f3da3303b5e895a3abd14 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 24 Mar 2021 15:07:33 +0800 Subject: [PATCH 18/63] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E5=8D=95=E7=8B=AC=E6=9B=B4=E6=96=B0dataEndTi?= =?UTF-8?q?me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/ScreenDifficultyDataServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java index 66873e1b6d..f263b332fc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java @@ -66,7 +66,7 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl Date: Wed, 24 Mar 2021 16:02:29 +0800 Subject: [PATCH 19/63] =?UTF-8?q?pc=E8=BF=90=E8=90=A5=E7=AB=AFtoken?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7Id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/service/impl/GovWebServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index bf0689b2b7..8575a8e244 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -106,6 +106,7 @@ public class GovWebServiceImpl implements GovWebService { logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]"); int expire = jwtTokenProperties.getExpire(); TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId(formDTO.getCustomerId()); tokenDto.setApp(formDTO.getApp()); tokenDto.setClient(formDTO.getClient()); tokenDto.setUserId(userId); From 05a567258e60f659c012ee4c1b8bd22686c4f38a Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Mar 2021 16:18:51 +0800 Subject: [PATCH 20/63] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E5=A0=B5=E7=82=B9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectMainDailyDao.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 675cce9c31..b9608e9ee3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -335,6 +335,7 @@ gridInfo.allParentIds FROM fact_origin_project_main_daily project + LEFT JOIN ( SELECT grid.ID AS dimGridId, @@ -368,7 +369,9 @@ grid.DEL_FLAG = '0' AND grid.CUSTOMER_ID = #{customerId} ) gridInfo ON project.GRID_ID = gridInfo.dimGridId + LEFT JOIN ( SELECT PROJECT_ID, COUNT( DISTINCT ORG_ID ) AS reOrg FROM fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} GROUP BY PROJECT_ID ) relation ON project.ID = relation.PROJECT_ID + LEFT JOIN ( SELECT PROJECT_ID, @@ -387,14 +390,15 @@ AND project.CUSTOMER_ID = #{customerId} AND project.ID IN ( - + SELECT DISTINCT period.project_id FROM fact_origin_project_org_period_daily period LEFT JOIN ( - + + SELECT project.ID AS projectId, IFNULL(period.handled_date,NOW()) AS finishDate @@ -571,4 +575,4 @@ - \ No newline at end of file + From 2d761725a91d4f73dcfb65de2e89fcc18dd405dd Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 24 Mar 2021 17:38:36 +0800 Subject: [PATCH 21/63] =?UTF-8?q?PC=E7=AB=AF=20=E6=AF=8F=E4=B8=AA=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=9A=84=E8=8F=9C=E5=8D=95=E4=BF=A1=E6=81=AF=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E6=94=BE=E5=85=A5=E7=BC=93=E5=AD=98=EF=BC=8C=E6=AF=8F?= =?UTF-8?q?=E6=AC=A1=E7=99=BB=E9=99=86=E9=87=8D=E6=96=B0=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/GovMenuServiceImpl.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java index 1f16ad89e9..4e4c142b55 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -187,14 +187,15 @@ public class GovMenuServiceImpl extends BaseServiceImpl getUserMenuNavList(TokenDto tokenDto) { - List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient()); - if(menuList == null){ - menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); - - govMenuRedis.setUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient(), menuList); - } - - return menuList; +// List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient()); +// if(menuList == null){ +// menuList = getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); +// +// govMenuRedis.setUserMenuNavList(tokenDto.getCustomerId(), tokenDto.getApp(), tokenDto.getClient(), menuList); +// } + // PC端 每个客户的菜单信息,不放入缓存,每次登陆重新查询。 + // 或者 你可以选择,在给每个客户 配置可见菜单的时候, 在saveCustomerMenu方法中,增加更新缓存的逻辑 + return getCustomerMenuList(tokenDto.getCustomerId(), MenuTypeEnum.MENU.value()); } /** From f00eccabbe51e4d849baa014cc45f5a9a8355f87 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 25 Mar 2021 14:58:13 +0800 Subject: [PATCH 22/63] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/DemoController.java | 4 ++-- .../ScreenGrassrootsGovernDataAbsorptionServiceImpl.java | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 4bb409b6eb..7d2cf24432 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -806,14 +806,14 @@ public class DemoController { return new Result(); } - /*@Autowired + @Autowired private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; @PostMapping("diff") public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){ ndddYhjfService.difficultyDataHub(param); return new Result(); - }*/ + } @Autowired private ScreenProjectSettleService screenProjectSettleService; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index 05ab26289b..ebb8c7fad5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -155,10 +155,12 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr //最近一次操作 Map latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId()); //图片 - List projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); + List projectSourceMap = difficulties.stream().map(diff->{ + ProjectSourceMapFormDTO map = new ProjectSourceMapFormDTO();map.setProjectId(diff.getEventId());map.setSourceId(diff.getEventImgUrl());return map; + }).collect(Collectors.toList()); + //factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds); - Map> imgMap = - topicService.getTopicImgs(projectSourceMap); + Map> imgMap = topicService.getTopicImgs(projectSourceMap); Map contentMap = topicService.getTopicContent(projectSourceMap); From 25db686745555da883964d0565551dc0f654265b Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 25 Mar 2021 17:14:30 +0800 Subject: [PATCH 23/63] =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=8E=89=E9=9A=BE?= =?UTF-8?q?=E7=82=B9=E8=B5=8C=E7=82=B9=E6=B5=8B=E8=AF=95=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/DemoController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 7d2cf24432..4bb409b6eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -806,14 +806,14 @@ public class DemoController { return new Result(); } - @Autowired + /*@Autowired private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; @PostMapping("diff") public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){ ndddYhjfService.difficultyDataHub(param); return new Result(); - } + }*/ @Autowired private ScreenProjectSettleService screenProjectSettleService; From 36beefe80505fbbb60b84f02af5e908e6996dd12 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Mar 2021 09:13:43 +0800 Subject: [PATCH 24/63] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/toscreen/impl/ScreenProjectSettleServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 590f8c3df6..dfb64dfc01 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -69,7 +69,9 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic */ @Override public void extractScreenData(ScreenCentralZoneDataFormDTO param) { + //screen_project_data表是否存在此客户数据 int rows = targetDbService.checkIfExisted(param.getCustomerId()); + //查找客户项目超期参数 List exceedParams = projectService.getProjectExceedParams(param.getCustomerId()); Integer exceedLimit = NumConstant.FIVE; Integer about2ExceedLimit = NumConstant.FIVE; @@ -92,6 +94,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId(),exceedLimit,about2ExceedLimit); if(!CollectionUtils.isEmpty(metaData)) { + // 查询项目信息 List info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); if(!CollectionUtils.isEmpty(info)){ metaData = metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(), From 07367655ff75c888c2ac73be17e2704177ca63c6 Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 26 Mar 2021 15:27:50 +0800 Subject: [PATCH 25/63] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E8=80=97=E6=97=B6=E6=8A=BD=E5=8F=96=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/todata/impl/ProjectExtractServiceImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index 35b5bbd577..cbbaee19c9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -437,11 +437,8 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { formattingData.add(dest); }); if(!CollectionUtils.isEmpty(formattingData)) { - List projectIds = formattingData.stream().map(FactOriginProjectOrgPeriodDailyEntity::getProjectId).distinct().collect(Collectors.toList()); - if (!CollectionUtils.isEmpty(projectIds)) { factOriginProjectOrgPeriodDailyDao.deleteByProjectIds(null,param.getCustomerId()); factOriginProjectOrgPeriodDailyDao.insertBatch(formattingData); - } } } From cc3e9d5586de8af112fda7e014d10e746baf9528 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 26 Mar 2021 17:18:49 +0800 Subject: [PATCH 26/63] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index d8db277ec4..39501e53b4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -78,6 +78,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr //2.查询出客户下网格的相关信息 List gridList = customerGridService.queryGridInfoList(param.getCustomerId()); + // list 转 map,以gridId为key,a = gridList,作为value,(o,n)->o 是遇到相同的gridId舍弃,(o,n)->n 是覆盖原来的gridId Map gridMap = gridList.stream().collect(Collectors.toMap(GridInfoDTO :: getGridId,a -> a,(o, n) -> o)); //3.查询出客户下用户的累计积分(累计值,没有时间概念,否则需要查询积分明细计算出评价周期末的得分) @@ -96,7 +97,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr } } final String finalDateId = dateId; - + // 查询党员积分 Map scoreMap = cpcIndexCalculateService.getCpcScore(param.getCustomerId(),dateId); //剔除垃圾数据 From 5d60cec1cf2b578fa896f1bdc1c997c65d98f34c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 26 Mar 2021 17:34:11 +0800 Subject: [PATCH 27/63] zancun --- .../user/result/UserStatisticalData.java | 33 +++++++++++++ .../epmet/controller/StatsUserController.java | 6 +++ .../service/impl/StatsUserServiceImpl.java | 7 ++- .../service/user/impl/UserServiceImpl.java | 49 ++++++++++--------- 4 files changed, 71 insertions(+), 24 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java index e50824d0cb..40315afc0c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java @@ -17,25 +17,58 @@ import java.util.List; public class UserStatisticalData implements Serializable { private static final long serialVersionUID = 7423427555123585566L; + /** + * 机关下(按日)参与用户数分析 + */ private List partiAgencyDailyList; + /** + * 网格下(按日)参与用户数分析 + */ private List partiGridDailyList; + /** + * 机关下(按月)参与用户数分析 + */ private List partiAgencyMonthlyList; + /** + * 网格下(月)参与用户数分析 + */ private List partiGridMonthlyList; + /** + * 机关(按日)注册用户数分析 + */ private List regAgencyDailyList; + /** + * 网格(按日)注册用户数分析 + */ private List regGridDailyList; + /** + * 机关(按月)注册用户数分析 + */ private List regAgencyMonthlyList; + /** + * 网格(月)注册用户数分析 + */ private List regGridMonthlyList; + /** + * 当前正在计算的客户id + */ private String customerId; + /** + * yyyyMMdd + */ private String dateId; + /** + * yyyyMM + */ private String monthId; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java index bc3ed0d09b..9c521b770a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java @@ -21,6 +21,12 @@ public class StatsUserController { @Autowired private StatsUserService statsUserService; + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @description 工作端数据一期,用户分析:参与用户、注册用户分析 + * @Date 2021/3/26 13:27 + **/ @RequestMapping("execute") public Result execute(@RequestBody StatsFormDTO formDTO) { statsUserService.partition(formDTO); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 35568a1e2f..20c1e711df 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -63,12 +63,14 @@ public class StatsUserServiceImpl implements StatsUserService { List customerIdList = null; Date date = null; if (StringUtils.isNotBlank(formDTO.getDate())) { + //如果指定了参数,转化为yyyy-MM-dd格式 date = DateUtils.stringToDate(formDTO.getDate(), DateUtils.DATE_PATTERN); } if (StringUtils.isNotBlank(formDTO.getCustomerId())) { generate(formDTO.getCustomerId(), date); } else { do { + //每100个客户一组 customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { @@ -99,13 +101,14 @@ public class StatsUserServiceImpl implements StatsUserService { calendar.set(Calendar.MINUTE, NumConstant.ZERO); calendar.set(Calendar.SECOND, NumConstant.ZERO); - //2.初始化时间维度 + //2.初始化时间维度{"dateId":"20210325","monthId":"202103","quarterId":"2021Q1","weekId":"2021W13","yearId":"2021"} DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); //3.初始化机关维度 List agencies = dimAgencyService.getAllAgency(customerId); //List topAgencies = dimAgencyService.getTopAgency(customerId); - + // log.info(JSON.toJSONString(timeDimension)); + // log.info(JSON.toJSONString(agencies)); //4.计算机关统计数据、生成唯一性统计数据 try { UserStatisticalData agencyData = userService.traverseAgencyUser(agencies, date, timeDimension); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index db739b79ab..75163e0b21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -62,8 +62,8 @@ public class UserServiceImpl implements UserService { dataPacket.setDateId(timeDimension.getDateId()); dataPacket.setMonthId(timeDimension.getMonthId()); //自上向下检索 - Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); + //subGridOfAgency key:agencyId ,value:当前组织下的所有网格(即直属网格+下级组织下的所有网格) Map> subGridOfAgency = new HashMap<>(); agencies.forEach(agency -> { initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); @@ -71,12 +71,13 @@ public class UserServiceImpl implements UserService { //对每一个机关进行数据统计 if(subGridOfAgency.size() > NumConstant.ZERO){ - subGridOfAgency.forEach((k,v) -> { + //如果当前客户存在组织 + subGridOfAgency.forEach((agencyId,subGridIds) -> { queryUserData(ModuleConstant.DIM_SUB_AGENCY, - k, - (null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? NumConstant.ZERO_STR : agencyMap.get(k).get(NumConstant.ZERO).getPid(), - (null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? null : agencyMap.get(k).get(NumConstant.ZERO).getCustomerId(), - v, + agencyId, + // (null == agencyMap.get(agencyId) || agencyMap.get(agencyId).isEmpty()) ? NumConstant.ZERO_STR : agencyMap.get(agencyId).get(NumConstant.ZERO).getPid(), + (null == agencyMap.get(agencyId) || agencyMap.get(agencyId).isEmpty()) ? null : agencyMap.get(agencyId).get(NumConstant.ZERO).getCustomerId(), + subGridIds, targetDate, dataPacket, timeDimension); @@ -111,7 +112,7 @@ public class UserServiceImpl implements UserService { if(null != v && v.size() > NumConstant.ZERO){ queryUserData(ModuleConstant.DIM_BELONGING_GRID, k, - v.get(NumConstant.ZERO).getPid(), + // v.get(NumConstant.ZERO).getPid(), v.get(NumConstant.ZERO).getCustomerId(), new HashSet<>(v.get(NumConstant.ZERO).getGridIds()), targetDate, @@ -181,22 +182,22 @@ public class UserServiceImpl implements UserService { /** * @Description 初始化机关-所有下级网格Map - * @param pid - 固定一个机关Id + * @param agencyId - 当前组织id * @param agency - AgencySubTreeDto * @param subGridOfAgency - Map> * @return * @author wangc * @date 2020.06.18 15:54 **/ - void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map> subGridOfAgency){ + void initAgencyGridMap(String agencyId, AgencySubTreeDto agency, Map> subGridOfAgency){ //向map中放入数据 - if(subGridOfAgency.containsKey(pid)){ + if(subGridOfAgency.containsKey(agencyId)){ //包含key - Set grids = subGridOfAgency.get(pid); + Set grids = subGridOfAgency.get(agencyId); if(null == grids){ grids = new HashSet<>(); - subGridOfAgency.put(pid,grids); + subGridOfAgency.put(agencyId,grids); } if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ grids.addAll(agency.getGridIds()); @@ -204,18 +205,20 @@ public class UserServiceImpl implements UserService { }else{ //不包含key Set grids = new HashSet<>(agency.getGridIds()); - subGridOfAgency.put(pid,grids); + subGridOfAgency.put(agencyId,grids); } - + //外层是从顶级组织向下循环,所以循环到社区时跳出 //定义递归出口 - if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){ - return ; + if (StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY, agency.getLevel()) + || null == agency.getSubAgencies() + || agency.getSubAgencies().size() == NumConstant.ZERO) { + return; } //定义递归入口 agency.getSubAgencies().forEach(obj -> { - initAgencyGridMap(pid,obj,subGridOfAgency); + initAgencyGridMap(agencyId,obj,subGridOfAgency); }); } @@ -223,7 +226,7 @@ public class UserServiceImpl implements UserService { * @Description 执行查询用户数据统计的逻辑 * @param relation - agency(下级机关加网格) | grid(直属网格) * @param agencyId - * @param pid + * @param //pid 当前agency的父级组织id * @param customerId * @param gridIds - 机关下所有网格集合/机关下直属网格集合 * @param targetDate @@ -233,10 +236,12 @@ public class UserServiceImpl implements UserService { * @author wangc * @date 2020.06.19 10:01 **/ - void queryUserData(String relation, String agencyId, String pid, String customerId, Set gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){ - - if(StringUtils.isBlank(pid)) - pid = NumConstant.ZERO_STR; + void queryUserData(String relation, String agencyId, + // String pid, + String customerId, Set gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){ + //pid没用到还传过来干啥-- 注释掉 + // if(StringUtils.isBlank(pid)) + // pid = NumConstant.ZERO_STR; dataPacket.setCustomerId(customerId); From 4266b73c96f9f9c7c8236fb6fdd055a9cd50df43 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 26 Mar 2021 17:35:14 +0800 Subject: [PATCH 28/63] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/StatsUserServiceImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 20c1e711df..8329b7c3f1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -106,9 +106,6 @@ public class StatsUserServiceImpl implements StatsUserService { //3.初始化机关维度 List agencies = dimAgencyService.getAllAgency(customerId); - //List topAgencies = dimAgencyService.getTopAgency(customerId); - // log.info(JSON.toJSONString(timeDimension)); - // log.info(JSON.toJSONString(agencies)); //4.计算机关统计数据、生成唯一性统计数据 try { UserStatisticalData agencyData = userService.traverseAgencyUser(agencies, date, timeDimension); From 8d00219d0349f33f9470b7f7cfdd793c69e1c939 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 29 Mar 2021 10:21:19 +0800 Subject: [PATCH 29/63] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats/impl/ScreenCentralZoneDataExtractServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java index 99c45d2f95..feceadf83d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/ScreenCentralZoneDataExtractServiceImpl.java @@ -67,6 +67,7 @@ public class ScreenCentralZoneDataExtractServiceImpl implements ScreenCentralZon List result = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,dimId); if(CollectionUtils.isEmpty(result)){ + // 根据dateId查询为空,先根据当前时间-1天是否和dateId相等,相等的话,查询往前推2天的数据 if(DateUtils.getBeforeNDay(NumConstant.ONE).equals(dimId)){ result = factRegUserGridDailyDao.selectUserAndPartymemberByOrgLevel(ORG_LEVEL_AGENCY,customerId,DateUtils.getBeforeNDay(NumConstant.TWO)); } From e508b94d3a927c2d47dfe4c00e682caa19d455f7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 29 Mar 2021 13:18:00 +0800 Subject: [PATCH 30/63] =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=88=86=E6=9E=90sql?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 7 +++ .../service/impl/StatsUserServiceImpl.java | 10 +++- .../service/user/impl/UserServiceImpl.java | 11 ++-- .../main/resources/mapper/user/UserDao.xml | 54 ++++++++++--------- 4 files changed, 50 insertions(+), 32 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 8c6432aadd..3217260019 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -424,6 +424,13 @@ public class DateUtils { return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD); } + public static String getBeforeNDay(int beforDay,String format){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.DATE, - beforDay); + Date date = c.getTime(); + return DateUtils.format(date,format); + } + /** * @return java.lang.String * @param beforMonth diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 8329b7c3f1..0d35eede37 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ProjectConstant; @@ -58,10 +59,16 @@ public class StatsUserServiceImpl implements StatsUserService { **/ @Override public void partition(StatsFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getDate())){ + //如果定时任务没有指定参数,默认数据更新至t-1,包含t-1这一天内的数据 + formDTO.setDate(DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN)); + } + int pageNo = NumConstant.ONE; int pageSize = NumConstant.ONE_HUNDRED; List customerIdList = null; Date date = null; + if (StringUtils.isNotBlank(formDTO.getDate())) { //如果指定了参数,转化为yyyy-MM-dd格式 date = DateUtils.stringToDate(formDTO.getDate(), DateUtils.DATE_PATTERN); @@ -92,6 +99,7 @@ public class StatsUserServiceImpl implements StatsUserService { * @date 2020.06.28 14:40 **/ void generate(String customerId,Date date){ + log.info("customerId:"+customerId+";date:"+DateUtils.format(date,DateUtils.DATE_TIME_PATTERN)); //1.初始化时间参数 Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); @@ -103,7 +111,7 @@ public class StatsUserServiceImpl implements StatsUserService { //2.初始化时间维度{"dateId":"20210325","monthId":"202103","quarterId":"2021Q1","weekId":"2021W13","yearId":"2021"} DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); - + log.info("timeDimension:"+ JSON.toJSONString(timeDimension)); //3.初始化机关维度 List agencies = dimAgencyService.getAllAgency(customerId); //4.计算机关统计数据、生成唯一性统计数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 75163e0b21..b5594541a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -108,10 +108,10 @@ public class UserServiceImpl implements UserService { //自上向下检索 Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); if(null != agencyMap && agencyMap.size() > NumConstant.ZERO){ - agencyMap.forEach((k,v) -> { + agencyMap.forEach((agencyId,v) -> { if(null != v && v.size() > NumConstant.ZERO){ queryUserData(ModuleConstant.DIM_BELONGING_GRID, - k, + agencyId, // v.get(NumConstant.ZERO).getPid(), v.get(NumConstant.ZERO).getCustomerId(), new HashSet<>(v.get(NumConstant.ZERO).getGridIds()), @@ -258,6 +258,9 @@ public class UserServiceImpl implements UserService { //指定日期 OR T-1 calendar.setTime(targetDateCheck); + //calendar.get(Calendar.DATE) 当前日期数eg:2021-03-29 :29 + //calendar.getActualMinimum(Calendar.DAY_OF_MONTH) :1 + //如果目标日期不是是当月的第一天 if(calendar.get(Calendar.DATE) != calendar.getActualMinimum(Calendar.DAY_OF_MONTH)){ //求出这个月的第一天 @@ -269,7 +272,6 @@ public class UserServiceImpl implements UserService { isMonthBeginning = false; } - if(StringUtils.equals(ModuleConstant.DIM_SUB_AGENCY,relation)){ @@ -401,8 +403,6 @@ public class UserServiceImpl implements UserService { partiAgencyM.setWarmHeartedProportion(partiAgencyD.getWarmHeartedProportion()); partiAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); - - //如果是月初第一天,不再做日期区间查询 if(isMonthBeginning) { if (null == dataPacket.getRegAgencyMonthlyList()) { @@ -421,6 +421,7 @@ public class UserServiceImpl implements UserService { } }else{ //如果不是月初第一天 + //targetDateCheck:定时任务参数中的date;calendar.getTime():date所属月第一天; //本月注册用户增长数 Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 969a848ae3..f30740e0ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -40,11 +40,13 @@ + - AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(#{targetDate},"%Y-%m-%d") + - AND CREATED_TIME CURDATE( ) AND CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT( DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") ) AS incr @@ -76,11 +78,13 @@ + - AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(#{targetDate},"%Y-%m-%d") + - AND CREATED_TIME CURDATE( ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") @@ -121,10 +125,10 @@ - AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND CREATED_TIME CURDATE( ) AND CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") @@ -164,10 +168,10 @@ - AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND CREATED_TIME CURDATE( ) + and DATE_FORMAT(CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") @@ -190,10 +194,10 @@ - AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND urole.CREATED_TIME CURDATE( ) AND urole.CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") = DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") @@ -221,10 +225,10 @@ - AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) + and DATE_FORMAT( urole.CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND urole.CREATED_TIME CURDATE( ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") AND erole.ROLE_NAME = '党员' @@ -261,10 +265,10 @@ - AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d")=DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND urole.CREATED_TIME CURDATE( ) AND urole.CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d")=DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") AND erole.ROLE_NAME = '热心居民' @@ -290,10 +294,10 @@ - AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(#{targetDate},"%Y-%m-%d") - AND urole.CREATED_TIME CURDATE( ) + and DATE_FORMAT(urole.CREATED_TIME,"%Y-%m-%d") DATE_FORMAT(DATE_SUB( CURDATE( ), INTERVAL 1 DAY ),"%Y-%m-%d") AND erole.ROLE_NAME = '热心居民'; @@ -332,8 +336,8 @@ - - AND CREATED_TIME =]]> #{startDate} AND CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) + AND CREATED_TIME =]]> DATE_FORMAT(#{startDate},"%Y-%m-%d") + AND CREATED_TIME DATE_FORMAT(#{endDate},"%Y-%m-%d") @@ -368,10 +372,8 @@ - - - AND CREATED_TIME =]]> #{startDate} AND CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) - + AND CREATED_TIME =]]> DATE_FORMAT(#{startDate},"%Y-%m-%d") + AND CREATED_TIME DATE_FORMAT(#{endDate},"%Y-%m-%d") @@ -394,9 +396,8 @@ - - - AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) + AND urole.CREATED_TIME =]]> DATE_FORMAT(#{startDate},"%Y-%m-%d") + AND urole.CREATED_TIME DATE_FORMAT(#{endDate},"%Y-%m-%d") AND erole.ROLE_NAME = '党员' @@ -423,7 +424,8 @@ - AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) + AND urole.CREATED_TIME =]]> DATE_FORMAT(#{startDate},"%Y-%m-%d") + AND urole.CREATED_TIME DATE_FORMAT(#{endDate},"%Y-%m-%d") AND erole.ROLE_NAME = '热心居民' From 77aeed3fbc6fc6904cdd9571aa7a61a47b44fd76 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Mar 2021 13:29:26 +0800 Subject: [PATCH 31/63] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/todata/impl/FactOriginExtractServiceImpl.java | 2 +- .../todata/impl/FactOriginProjectLogDailyServiceImpl.java | 5 ++--- .../extract/todata/impl/ProjectExtractServiceImpl.java | 1 + 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index f44eef01de..089be0c513 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -198,7 +198,7 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { try { projectExtractService.extractProjectPeriodData(paramNew); } catch (Exception e) { - log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); + log.error("抽取【项目耗时数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); } } else { try { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 641b7efa03..b710d08af5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -30,7 +30,6 @@ import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; -import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import org.apache.commons.lang3.StringUtils; @@ -236,6 +235,7 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, dimId); Map efficiencyMap = new HashMap<>(); + List projects = new LinkedList<>(); if (!CollectionUtils.isEmpty(projectsHandledByAgency)) { Map> agencyProjectsMap = new HashMap<>(); @@ -249,10 +249,9 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl projects = new LinkedList<>(); - agencyProjectsMap.forEach((key,value) -> {projects.addAll(value);}); //2.结案项目的总耗时 List costTimes = baseDao.selectProjectCostTime(projects); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index cbbaee19c9..8f1985b6be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -104,6 +104,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { closeProjects.forEach(close -> finishOrgList.stream().filter(finish -> close.getId().equals(finish.getProjectId())).forEach(dto -> { String[] orgIds = dto.getPIdPath().split(StrConstant.COLON); String org = ""; + //取最短的ordIds中最后一个 则为最高级的那个orgIds if (orgIds.length > NumConstant.ONE) { org = orgIds[orgIds.length - 1]; } else { From 73d392866466000a07f7165a68b5bc4804eec9d9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Mar 2021 17:18:29 +0800 Subject: [PATCH 32/63] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0Pdf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/OssController.java | 42 +++++++++++++------ .../java/com/epmet/utils/ModuleConstant.java | 4 ++ .../epmet/dto/form/DraftContentFromDTO.java | 11 +++-- 3 files changed, 42 insertions(+), 15 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 1559d4160b..34a94378ec 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -205,25 +205,43 @@ public class OssController { return ossService.uploadImg(file, null); } + /** + * desc: 党建声音模块 上传图片(2M)或附件(5M) + * + * @param file + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/3/29 4:56 下午 + */ @PostMapping("article/upload") public Result uploadArticleImg(@RequestParam("file") MultipartFile file) { - // 校验文件类型 - if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) && !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType()) - && !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) ) { - log.error("uploadArticleImg file type:{} is not support 2 upload",file.getContentType() == null? null:file.getContentType()); + // 校验文件类型 图片或pdf + if (!MediaType.IMAGE_PNG_VALUE.equals(file.getContentType()) + && !MediaType.IMAGE_JPEG_VALUE.equals(file.getContentType()) + && !ModuleConstant.FILE_CONTENT_TYPE_JPG.equals(file.getContentType()) + && !ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { + log.error("uploadArticleImg file type:{} is not support 2 upload", file.getContentType()); throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); } - - // 校验文件体积,不超过2m - long maxSize = 2 * 1024 * 1024; - long size = file.getSize(); - if (size > maxSize) { - throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() - , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + if (ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { + // 校验文件体积,不超过2m + long maxSize = 5 * 1024 * 1024; + long size = file.getSize(); + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } + } else { + // 校验文件体积,不超过2m + long maxSize = 2 * 1024 * 1024; + long size = file.getSize(); + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() + , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } } - return ossService.uploadImg(file, null); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java index a89b14fbd1..07a11d9ed7 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -26,6 +26,10 @@ public interface ModuleConstant extends Constant { * jpg文件类型 */ String FILE_CONTENT_TYPE_JPG = "image/jpg"; + /** + * pdf文件类型 + */ + String FILE_CONTENT_TYPE_PDF = "application/pdf"; /** * 项目附件-允许上传的文件类型 diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java index 7df78525c0..d85f17cf7c 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java @@ -67,14 +67,19 @@ public class DraftContentFromDTO implements Serializable { */ private String draftContentId; /** - * 内容 + * 内容 当为非文字时,存放oss链接地址 */ @Length(max = 1000, message = "每段文字最长为1000个字") private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;附件:attachment */ private String contentType; + + /** + * 附件名称 + */ + private String attachmentName; } -} \ No newline at end of file +} From 1fb901c1a791ba2ab6ba4f83a327261988cbc557 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 29 Mar 2021 17:47:35 +0800 Subject: [PATCH 33/63] =?UTF-8?q?ext=E6=96=B0=E5=A2=9Eapi:=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=BD=93=E5=89=8D=E5=AE=A2=E6=88=B7=E4=B8=8B=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E7=AB=AF=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/CustomerRoleResultDTO.java | 21 +++++++++++++ .../epmet/controller/OpenUpController.java | 13 ++++++++ .../java/com/epmet/service/OpenUpService.java | 9 ++++++ .../epmet/service/impl/OpenUpServiceImpl.java | 17 ++++++++++ .../epmet/dto/result/RoleInfoResultDTO.java | 2 ++ .../epmet/feign/EpmetUserOpenFeignClient.java | 10 ++++++ .../EpmetUserOpenFeignClientFallback.java | 13 ++++++++ .../controller/GovStaffRoleController.java | 12 +++++++ .../epmet/service/GovStaffRoleService.java | 10 ++++++ .../service/impl/GovStaffRoleServiceImpl.java | 31 ++++++++++++++++--- 10 files changed, 133 insertions(+), 5 deletions(-) create mode 100644 epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java new file mode 100644 index 0000000000..a8fe59a2f8 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/CustomerRoleResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/3/29 15:26 + */ +@Data +public class CustomerRoleResultDTO implements Serializable { + private static final long serialVersionUID = 4933114432141586045L; + + private String roleName; + private String roleKey; + private String roleId; + private Boolean fullTimeOnly; +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java index 4fd89b0dbc..c0535b648b 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -147,5 +147,18 @@ public class OpenUpController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(openUpService.queryStaffPermissionV2(formDTO)); } + + /** + * @return + * @param formDTO 客户id + * @author yinzuomei + * @description 010、获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:25 + **/ + @PostMapping("govrolelist") + public Result> queryCustomerGovRoleList(@RequestBody CustomerInfoQueryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(openUpService.queryCustomerGovRoleList(formDTO.getCustomerId())); + } } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java index 6fbe32afe6..8047ec9f8c 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java @@ -62,4 +62,13 @@ public interface OpenUpService { * @Date 2021/2/3 20:59 **/ StaffPermissionResultDTO queryStaffPermissionV2(StaffPermissionFormDTO formDTO); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 010、获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:27 + **/ + List queryCustomerGovRoleList(String customerId); } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java index 43f50a34c9..0f6cb365b3 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -210,4 +210,21 @@ public class OpenUpServiceImpl implements OpenUpService { return resultDTO; } + /** + * @param customerId + * @return java.util.List + * @author yinzuomei + * @description 010、获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:27 + **/ + @Override + public List queryCustomerGovRoleList(String customerId) { + Result> userRes = epmetUserOpenFeignClient.queryCustomerGovRoleList(customerId); + if (!userRes.success() || CollectionUtils.isEmpty(userRes.getData())) { + log.error(String.format("获取当前客户下,工作端角色列表失败,customerId:%s", customerId)); + return new ArrayList<>(); + } + return ConvertUtils.sourceToTarget(userRes.getData(), CustomerRoleResultDTO.class); + } + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java index c2378a87a5..81498e5586 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/RoleInfoResultDTO.java @@ -29,4 +29,6 @@ public class RoleInfoResultDTO implements Serializable{ * */ @JsonInclude(JsonInclude.Include.NON_NULL) private Boolean fullTimeOnly = false; + + private String roleKey; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index d48703ffb4..3332aec3a1 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -486,4 +486,14 @@ public interface EpmetUserOpenFeignClient { */ @PostMapping(value = "/epmetuser/user/saveuserinfo") Result saveUserInfo(@RequestBody UserInfoFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param customerId + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:35 + **/ + @GetMapping(value = "/epmetuser/govstaffrole/querycustomergovrolelist/{customerId}") + Result> queryCustomerGovRoleList(@PathVariable("customerId")String customerId); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 195f1a0c38..c1944b43a3 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -337,8 +337,21 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "saveUserInfo", formDTO); } + /** + * @param customerId + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:35 + **/ + @Override + public Result> queryCustomerGovRoleList(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryCustomerGovRoleList", customerId); + } + @Override public Result initGovStaffRolesForCustomer(String customerId) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "initGovStaffRolesForCustomer", customerId); } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java index 40cab6cb5a..37df7c9140 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java @@ -9,6 +9,7 @@ import com.epmet.dto.form.GovStaffRoleFormDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; import com.epmet.dto.result.ResiGovRoleListResultDTO; +import com.epmet.dto.result.RoleInfoResultDTO; import com.epmet.service.GovStaffRoleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; @@ -112,4 +113,15 @@ public class GovStaffRoleController { return new Result>().ok(roles); } + /** + * @return com.epmet.commons.tools.utils.Result> + * @param customerId + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:37 + **/ + @GetMapping("querycustomergovrolelist/{customerId}") + Result> queryCustomerGovRoleList(@PathVariable("customerId") String customerId){ + return new Result>().ok(govStaffRoleService.queryCustomerGovRoleList(customerId)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java index 346fad61b2..6ee17905c2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -23,6 +23,7 @@ import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; import com.epmet.dto.result.ResiGovRoleListResultDTO; +import com.epmet.dto.result.RoleInfoResultDTO; import com.epmet.entity.GovStaffRoleEntity; import java.util.List; @@ -140,4 +141,13 @@ public interface GovStaffRoleService extends BaseService { void saveSortOrder(List roleIdList); List listRolesByRoleKey(String roleKey); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:37 + **/ + List queryCustomerGovRoleList(String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index 16c6a375e2..15a8b10483 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -20,20 +20,17 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.GovStaffRoleDao; import com.epmet.dao.GovStaffRoleTemplateDao; import com.epmet.dao.RoleDao; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.InitDefaultOperationsFormDTO; -import com.epmet.dto.result.GovStaffRoleResultDTO; -import com.epmet.dto.result.GovStaffRoleTemplateDTO; -import com.epmet.dto.result.ResiGovRoleListResultDTO; -import com.epmet.dto.result.ResiGovRoleResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.feign.GovAccessFeignClient; import com.epmet.redis.GovStaffRoleRedis; @@ -242,4 +239,28 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl listRolesByRoleKey(String roleKey) { return govStaffRoleDao.listRolesByRoleKey(roleKey); } + + /** + * @param customerId + * @return java.util.List + * @author yinzuomei + * @description 获取当前客户下-工作端角色列表 + * @Date 2021/3/29 15:37 + **/ + @Override + public List queryCustomerGovRoleList(String customerId) { + List resultList=new ArrayList<>(); + GovStaffRoleDTO govStaffRoleDTO=new GovStaffRoleDTO(); + govStaffRoleDTO.setCustomerId(customerId); + List roleList = this.getGovStaffRoleList(govStaffRoleDTO); + roleList.forEach(role->{ + RoleInfoResultDTO resultDTO=new RoleInfoResultDTO(); + resultDTO.setFullTimeOnly(role.getFullTimeOnly()); + resultDTO.setRoleId(role.getId()); + resultDTO.setRoleName(role.getRoleName()); + resultDTO.setRoleKey(role.getRoleKey()); + resultList.add(resultDTO); + }); + return resultList; + } } \ No newline at end of file From 5ba2a90b36bdb6c3401ca7bc57a4ce9df3474048 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Mar 2021 17:52:10 +0800 Subject: [PATCH 34/63] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=B7=BB=E5=8A=A0Pdf=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/ArticleContentDTO.java | 16 +++++++++++++--- .../main/java/com/epmet/dto/DraftContentDTO.java | 7 ++++--- .../com/epmet/dto/form/DraftContentFromDTO.java | 6 +++--- .../epmet/dto/result/GovArticleContentDTO.java | 7 ++++++- .../com/epmet/dto/result/GovDraftContentDTO.java | 7 ++++++- .../com/epmet/entity/ArticleContentEntity.java | 10 ++++++---- .../com/epmet/entity/DraftContentEntity.java | 10 ++++++---- .../resources/db/migration/V0.0.3__addpdf.sql | 6 ++++++ .../src/main/resources/mapper/ArticleDao.xml | 7 +++++-- 9 files changed, 55 insertions(+), 21 deletions(-) create mode 100644 epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.3__addpdf.sql diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java index 88aa05b3a8..a8269648f3 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -54,10 +55,19 @@ public class ArticleContentDTO implements Serializable { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; + /** + * desc: 请描述类的业务用途 + * + * @param null + * @return + * @author LiuJanJun + * @date 2021/3/29 5:42 下午 + */ + /** * 审核状态 通过:pass;失败:fail;审核中:auditing */ @@ -103,4 +113,4 @@ public class ArticleContentDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java index b0699b4c59..ee29b969c7 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -54,7 +55,7 @@ public class DraftContentDTO implements Serializable { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; @@ -103,4 +104,4 @@ public class DraftContentDTO implements Serializable { */ private Date updatedTime; -} \ No newline at end of file +} diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java index d85f17cf7c..09c6818ac2 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftContentFromDTO.java @@ -73,13 +73,13 @@ public class DraftContentFromDTO implements Serializable { private String content; /** - * 内容类型 图片:img;文字:text;附件:attachment + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; /** - * 附件名称 + * 文件名称 */ - private String attachmentName; + private String fileName; } } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java index dbb98d9d3d..18844917ea 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovArticleContentDTO.java @@ -14,10 +14,15 @@ import java.io.Serializable; public class GovArticleContentDTO implements Serializable { private static final long serialVersionUID = 1519014754254863006L; /** - * 内容类型,图片:img;文字:text + * 内容类型,图片:img;文字:text; 文件:file */ private String contentType; + /** + * 文件名称 + */ + private String fileName; + /** * 内容 */ diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java index 4b4ae98c07..c575c4a561 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java @@ -15,10 +15,15 @@ public class GovDraftContentDTO implements Serializable { private static final long serialVersionUID = 5653062658148122552L; /** - * 内容类型,图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; + /** + * 文件名称 + */ + private String fileName; + /** * 内容 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java index f4a961b974..29661c7350 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 文章内容表 * @@ -54,10 +51,15 @@ public class ArticleContentEntity extends BaseEpmetEntity { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; + /** + * 文件名称 + */ + private String fileName; + /** * 审核状态 通过:pass;失败:fail;审核中:auditing */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java index a5ab64db0e..15a7ba4e76 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * 草稿内容表 * @@ -54,7 +51,7 @@ public class DraftContentEntity extends BaseEpmetEntity { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; @@ -73,4 +70,9 @@ public class DraftContentEntity extends BaseEpmetEntity { */ private Integer orderNum; + /** + * 文件名称 + */ + private String fileName; + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.3__addpdf.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.3__addpdf.sql new file mode 100644 index 0000000000..51189752dd --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.3__addpdf.sql @@ -0,0 +1,6 @@ +ALTER TABLE `epmet_gov_voice`.`draft_content` + MODIFY COLUMN `CONTENT_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容类型 图片:img;文字:text;文件:file;' AFTER `CONTENT`, + ADD COLUMN `FILE_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件名称' AFTER `CONTENT_TYPE`; +ALTER TABLE `epmet_gov_voice`.`article_content` + MODIFY COLUMN `CONTENT_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容类型 图片:img;文字:text;文件:file;' AFTER `CONTENT`, + ADD COLUMN `FILE_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文件名称' AFTER `CONTENT_TYPE`; diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index f4d41ffa88..97be456470 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -25,7 +25,8 @@ - \ No newline at end of file + From e110eda3057ebd7c06995874b42da83af5da5555 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 29 Mar 2021 18:02:39 +0800 Subject: [PATCH 35/63] =?UTF-8?q?=E5=85=9A=E5=BB=BA=E5=A3=B0=E9=9F=B3-?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=B7=BB=E5=8A=A0Pdf=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/DraftContentDetailDTO.java | 7 ++++++- .../src/main/resources/mapper/DraftDao.xml | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java index d468ffb81a..21fce8fd5d 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftContentDetailDTO.java @@ -24,10 +24,15 @@ public class DraftContentDetailDTO implements Serializable { private String content; /** - * 内容类型 图片:img;文字:text + * 内容类型 图片:img;文字:text;文件:file */ private String contentType; + /** + * 文件名称 + */ + private String fileName; + /** * 内容序号 */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index 823e936884..483c05319e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -28,6 +28,7 @@ dc.ID, dc.CONTENT, dc.CONTENT_TYPE, + dc.FILE_NAME, dc.ORDER_NUM, (case when dc.AUDIT_STATUS is null then "" @@ -190,4 +191,4 @@ where id=#{draftId,jdbcType=VARCHAR} - \ No newline at end of file + From d2f9bdd5cc8f0bae76c9d37b41d51627849cc55a Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 09:11:03 +0800 Subject: [PATCH 36/63] ossController --- .../src/main/java/com/epmet/controller/OssController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 34a94378ec..863ce98a09 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -14,6 +14,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AliyunGroup; @@ -62,6 +63,8 @@ public class OssController { private OssService ossService; @Autowired private ParamsRemoteService paramsRemoteService; + @Autowired + private RedisUtils redisUtils; private final static String KEY = ModuleConstant.CLOUD_STORAGE_CONFIG_KEY; @@ -226,13 +229,14 @@ public class OssController { , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); } if (ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { - // 校验文件体积,不超过2m + // 校验文件体积,不超过5m long maxSize = 5 * 1024 * 1024; long size = file.getSize(); if (size > maxSize) { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } + //todo 获取url 缓存半小时 删除时获取并调用删除方法 } else { // 校验文件体积,不超过2m long maxSize = 2 * 1024 * 1024; From f14d04ba77e4b0e56791393995ac0baafd04228f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 30 Mar 2021 09:50:03 +0800 Subject: [PATCH 37/63] =?UTF-8?q?=E5=A4=A7=E6=A6=82=E6=98=AF=E7=9D=A1?= =?UTF-8?q?=E7=9D=80=E4=BA=86=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dataaggre/service/resigroup/ResiGroupService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java index 1e15dce4fa..0b3b4d1891 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java @@ -1,7 +1,6 @@ package com.epmet.dataaggre.service.resigroup; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; -import org.apache.ibatis.annotations.Param; import java.util.List; @@ -10,5 +9,5 @@ import java.util.List; * @DateTime 2020/12/25 上午9:21 */ public interface ResiGroupService { - List selectTopicInfoByIds(@Param("topicIds") List topicIds); + List selectTopicInfoByIds(List topicIds); } From 40fb288fc0ed60aea81d1ec8afc0985c7afa0965 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 30 Mar 2021 09:58:49 +0800 Subject: [PATCH 38/63] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=AF=B9?= =?UTF-8?q?=E5=A4=96=E5=BC=80=E6=94=BEapi=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E8=AE=A4=E8=AF=81=E5=8D=B3=E5=8F=AF=E8=AE=BF=E9=97=AE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 201573688e..d78d225cda 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -457,6 +457,9 @@ epmet: - /gov/project/** - /resi/home/** - /data/report/** + - /epmet/ext/** + - /data/stats/** + - /data/aggregator/** # 内部认证url白名单(在白名单中的,就不会再校验登录了) internalAuthUrlsWhiteList: From 83c152008fd51ce6bbfcbd032059cb695aead2a1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 10:12:42 +0800 Subject: [PATCH 39/63] =?UTF-8?q?oss=E8=BF=94=E5=9B=9Edomain=E5=9F=9F?= =?UTF-8?q?=E5=90=8D=E7=94=A8=E4=BA=8E=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/redis/RedisKeys.java | 12 ++++++++++++ .../epmet/dto/result/UploadImgResultDTO.java | 6 ++++++ .../cloud/AbstractCloudStorageService.java | 12 +++++++++++- .../cloud/AliyunCloudStorageService.java | 19 ++++++++++++++++++- .../com/epmet/controller/OssController.java | 11 +++++++++++ .../epmet/service/impl/OssServiceImpl.java | 8 +++++++- 6 files changed, 65 insertions(+), 3 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index faee6de155..716e22a223 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -386,4 +386,16 @@ public class RedisKeys { public static String getResiUserBadgeKey(String customerId, String userId) { return rootPrefix.concat("badge:user:").concat(customerId).concat(":").concat(StringUtils.isBlank(userId) ? "*" : userId); } + + /** + * desc: 根据文件路径获取oss 文件缓存key + * + * @param path + * @return java.lang.String + * @author LiuJanJun + * @date 2021/3/30 9:56 上午 + */ + public static String getOssFileKey(String path) { + return rootPrefix.concat("oss:temp:").concat(path); + } } diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java index b93b58bb39..cbd2797bfb 100644 --- a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/UploadImgResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -12,4 +13,9 @@ import java.io.Serializable; @Data public class UploadImgResultDTO implements Serializable { private String url; + /** + * 域名 + */ + @JsonIgnore + private String domain; } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java index 0eabc11add..383312c312 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java @@ -25,7 +25,17 @@ import java.util.UUID; public abstract class AbstractCloudStorageService { /** 云存储配置信息 */ CloudStorageConfig config; - + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJun + * @date 2021/3/30 10:05 上午 + */ + public String getOssDomain(String privacy){ + return null; + }; /** * 文件路径 * @param prefix 前缀 diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 472609fbcd..6f29e056df 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -36,7 +36,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { * @author wxz * @date 2021.01.04 13:49 */ - private CloudStorageConfig.AliyunCloudStorageConfigProps getPropsByprivacyType(String privacyType) { + public CloudStorageConfig.AliyunCloudStorageConfigProps getPropsByprivacyType(String privacyType) { if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) { return config.getAliyun().getInternal(); } else { @@ -44,6 +44,23 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { } } + /** + * desc: 获取oss域名 + * + * @param privacy + * @return java.lang.String + * @author LiuJanJun + * @date 2021/3/30 10:05 上午 + */ + @Override + public String getOssDomain(String privacy) { + if (PrivacyType.INTERNAL.equalsIgnoreCase(privacy)) { + return config.getAliyun().getInternal().getAliyunDomain(); + } else { + return config.getAliyun().getExternal().getAliyunDomain(); + } + } + @Override public String upload(byte[] data, String path, String privacyType) { return upload(new ByteArrayInputStream(data), path, privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 863ce98a09..2673461209 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -11,9 +11,11 @@ package com.epmet.controller; import com.epmet.cloud.CloudStorageConfig; import com.epmet.cloud.OssFactory; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -33,6 +35,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.http.entity.ContentType; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; @@ -246,6 +249,14 @@ public class OssController { , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } } + Result result = ossService.uploadImg(file, null); + if (result != null && result.success() ){ + UploadImgResultDTO data = result.getData(); + if ( data!= null && StringUtils.isNotBlank(data.getUrl())){ + String path = data.getUrl().replace(data.getUrl(), StrConstant.EPMETY_STR); + redisUtils.set(RedisKeys.getOssFileKey(path),path,RedisUtils.MINUTE_THIRTY_EXPIRE); + } + } return ossService.uploadImg(file, null); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 3effd64fb8..5a5a74ba37 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -10,6 +10,7 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.cloud.AbstractCloudStorageService; import com.epmet.cloud.OssFactory; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; @@ -56,8 +57,11 @@ public class OssServiceImpl extends BaseServiceImpl implement //上传文件 String extension = FilenameUtils.getExtension(file.getOriginalFilename()); String url = null; + String ossDomain = null; try { - url = OssFactory.build().uploadSuffix(file.getBytes(), extension, privacy); + AbstractCloudStorageService storageService = OssFactory.build(); + url = storageService.uploadSuffix(file.getBytes(), extension, privacy); + ossDomain = storageService.getOssDomain(privacy); } catch (IOException e) { e.printStackTrace(); logger.error("图片上传异常"); @@ -67,10 +71,12 @@ public class OssServiceImpl extends BaseServiceImpl implement //保存文件信息 OssEntity ossEntity = new OssEntity(); ossEntity.setUrl(url); + baseDao.insert(ossEntity); //文件信息 UploadImgResultDTO dto = new UploadImgResultDTO(); dto.setUrl(url); + dto.setDomain(ossDomain); return new Result().ok(dto); } From 6b6f0ce09280ed27dd0f022d8f99a5f3758bc700 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 10:26:59 +0800 Subject: [PATCH 40/63] =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E8=BF=94=E5=9B=9Efilename?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/ArticleContentResultDTO.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java index 9b12f89213..38222f8295 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/ArticleContentResultDTO.java @@ -15,7 +15,7 @@ public class ArticleContentResultDTO implements Serializable { private static final long serialVersionUID = 2853197212163051558L; /** - * 内容类型(图片:img;文字:text) + * 内容类型(图片:img;文字:text;文件:file) * */ private String contentType; @@ -23,4 +23,9 @@ public class ArticleContentResultDTO implements Serializable { * 内容 * */ private String content; + + /** + * 文件名称 + * */ + private String fileName; } From 4183d436dfb64a5b9f5cce048d94f32bfcbc26bf Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 11:18:43 +0800 Subject: [PATCH 41/63] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=86=85=E5=AE=B9=20?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E4=B8=BA=E6=96=87=E4=BB=B6=20=E5=88=99?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=96=87=E4=BB=B6=E5=90=8D=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/exception/EpmetErrorCode.java | 8 +++++--- .../src/main/java/com/epmet/constant/DraftConstant.java | 6 +++++- .../java/com/epmet/service/impl/ArticleServiceImpl.java | 5 ++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index ac6d50bd9f..fb12799b4b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -125,9 +125,11 @@ public enum EpmetErrorCode { // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), - ARTICLE_PUBLISH_ERROR(8801, "发布文章失败,请刷新重试"), - REPEATED_SUBMIT_ERROR(8998, "请勿重复提交"), - CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常"), + DRAFT_CONTENT_FILENAME_NULL(8802, "附件名称不能为空"), + ARTICLE_PUBLISH_ERROR(8803, "发布文章失败,请刷新重试"), + REPEATED_SUBMIT_ERROR(8804, "请勿重复提交"), + CUSTOMER_VALIDATE_ERROR(8805, "内部数据校验异常"), + CATEGORY_IS_NULL(8806, "请设置分类"), //公众号 865..开头的码 PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"), diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java index 6ee205ec7d..4556654b51 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/DraftConstant.java @@ -10,7 +10,7 @@ package com.epmet.constant; /** * 常量 - * + * * @author sun * @since 1.0.0 */ @@ -66,6 +66,10 @@ public interface DraftConstant { * 内容类型-文字 */ String TEXT = "text"; + /** + * 内容类型-文件 + */ + String FILE = "file"; /** * 草稿预览内容大小长度 diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 5c8ed40e39..e95a7dadf8 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -460,6 +460,9 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Tue, 30 Mar 2021 13:39:38 +0800 Subject: [PATCH 42/63] =?UTF-8?q?=20=E8=AF=84=E4=BB=B7=E5=91=A8=E6=9C=9F?= =?UTF-8?q?=E5=86=85=E8=A2=AB=E5=90=B9=E5=93=A8=E4=B8=94=E8=A2=AB=E5=8A=9E?= =?UTF-8?q?=E7=BB=93=E7=9A=84=E9=A1=B9=E7=9B=AE=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectLogDailyDao.xml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 2db8a97d58..0fe89ad0e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -198,15 +198,22 @@ COUNT(DISTINCT log.PROJECT_ID) AS count FROM fact_origin_project_log_daily log - LEFT JOIN fact_origin_project_main_daily project ON log.PROJECT_ID = project.ID AND project.DEL_FLAG = '0' AND project.CUSTOMER_ID = #{customerId} WHERE log.DEL_FLAG = '0' - AND project.PROJECT_STATUS LIKE 'close%' AND log.CUSTOMER_ID = #{customerId} AND log.IS_ACTIVE = '0' - AND log.MONTH_ID = #{dimId} + AND EXISTS ( + select id from fact_origin_project_log_daily where del_flag = '0' + and customer_id = #{customerId} and month_id = #{dimId} + and action_code like 'close%' + + + AGENCY_ID = #{agencyId} + + ) + log.AGENCY_ID = #{agencyId} From 4845bf3f0311d9e4f07cd61722e74953541f8254 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 14:06:13 +0800 Subject: [PATCH 43/63] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=86=85=E5=AE=B9=20?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E4=B8=BA=E6=96=87=E4=BB=B6=20=E5=88=99?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=96=87=E4=BB=B6=E5=90=8D=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/ArticleServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index e95a7dadf8..d00baf70d3 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -460,7 +460,7 @@ public class ArticleServiceImpl extends BaseServiceImpl Date: Tue, 30 Mar 2021 14:35:42 +0800 Subject: [PATCH 44/63] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 2 ++ .../gov-voice-server/src/main/resources/mapper/DraftDao.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 201573688e..7d762a9d49 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -457,6 +457,8 @@ epmet: - /gov/project/** - /resi/home/** - /data/report/** + - /gov/voice/** + - /resi/voice/** # 内部认证url白名单(在白名单中的,就不会再校验登录了) internalAuthUrlsWhiteList: diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index 483c05319e..a6675ddb4e 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -166,6 +166,7 @@ SELECT dc.CONTENT_TYPE, dc.CONTENT, + dc.FILE_NAME, dc.AUDIT_STATUS, dc.AUDIT_REASON FROM From c0ec3f3a36018c80d95878fc699dda433a8586d8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 14:52:53 +0800 Subject: [PATCH 45/63] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-voice-server/src/main/resources/mapper/ArticleDao.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml index 97be456470..924f52a59f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml @@ -276,6 +276,7 @@ + From c67d86d16d431cfab72135fde23263b52ab7d8d6 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 30 Mar 2021 15:29:54 +0800 Subject: [PATCH 46/63] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=85=9A=E5=BB=BA?= =?UTF-8?q?=E5=A3=B0=E9=9F=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/RemoveFileFormDTO.java | 16 ++++++++ .../epmet/dto/result/RemoveFileResultDTO.java | 16 ++++++++ .../cloud/AbstractCloudStorageService.java | 9 ++++ .../cloud/AliyunCloudStorageService.java | 15 +++++++ .../cloud/FastDFSCloudStorageService.java | 13 ++++++ .../epmet/cloud/LocalCloudStorageService.java | 13 ++++++ .../cloud/QcloudCloudStorageService.java | 13 ++++++ .../epmet/cloud/QiniuCloudStorageService.java | 13 ++++++ .../com/epmet/controller/OssController.java | 9 ++++ .../src/main/java/com/epmet/dao/OssDao.java | 4 +- .../java/com/epmet/service/OssService.java | 10 +++++ .../epmet/service/impl/OssServiceImpl.java | 41 +++++++++++++++++++ .../src/main/resources/mapper/SysOssDao.xml | 6 +++ 13 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java create mode 100644 epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java new file mode 100644 index 0000000000..7f01fc9936 --- /dev/null +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/form/RemoveFileFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/3/30 9:51 + */ +@Data +public class RemoveFileFormDTO implements Serializable { + private static final long serialVersionUID = 3889369412733647229L; + private String url; +} diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java new file mode 100644 index 0000000000..e8a39a8a96 --- /dev/null +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/3/30 9:52 + */ +@Data +public class RemoveFileResultDTO implements Serializable { + private static final long serialVersionUID = 6509372741520843201L; + private Boolean delSuccess; +} diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java index 383312c312..8cd699e5e9 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java @@ -107,4 +107,13 @@ public abstract class AbstractCloudStorageService { */ public abstract void down(String privacyType) throws IOException; + /** + * 文件删除 + * @author zhaoqifeng + * @date 2021/3/30 11:05 + * @param objectName + * @return boolean + */ + public abstract boolean delete(String objectName); + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 6f29e056df..c8d30d1c7d 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -81,6 +81,21 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { return props.getAliyunDomain() + "/" + path; } + @Override + public boolean delete(String objectName) { + CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(null); + OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + props.getAliyunAccessKeySecret()); + try { + client.deleteObject(props.getAliyunBucketName(), props.getAliyunPrefix() + objectName); + client.shutdown(); + } catch (Exception e){ + return false; + } + + return true; + } + @Override public String uploadSuffix(byte[] data, String suffix, String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java index b5493c02b2..41ceb4024e 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java @@ -65,4 +65,17 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService { public void down(String privacyType) throws IOException { } + + /** + * 文件删除 + * + * @param objectName + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 11:05 + */ + @Override + public boolean delete(String objectName) { + return false; + } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java index 8143edaa0b..76968ff118 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java @@ -58,4 +58,17 @@ public class LocalCloudStorageService extends AbstractCloudStorageService { public void down(String privacyType) throws IOException { } + + /** + * 文件删除 + * + * @param objectName + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 11:05 + */ + @Override + public boolean delete(String objectName) { + return false; + } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java index 80c5e494f4..5b91aa84c0 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java @@ -88,4 +88,17 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService { public void down(String privacyType) throws IOException { } + + /** + * 文件删除 + * + * @param objectName + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 11:05 + */ + @Override + public boolean delete(String objectName) { + return false; + } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java index 16515203dd..3b2035c89e 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java @@ -82,4 +82,17 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService { public void down(String privacyType) throws IOException { } + + /** + * 文件删除 + * + * @param objectName + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 11:05 + */ + @Override + public boolean delete(String objectName) { + return false; + } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 2673461209..53c8befb84 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -23,6 +23,8 @@ import com.epmet.commons.tools.validator.group.AliyunGroup; import com.epmet.commons.tools.validator.group.QcloudGroup; import com.epmet.commons.tools.validator.group.QiniuGroup; import com.epmet.dto.UploadDTO; +import com.epmet.dto.form.RemoveFileFormDTO; +import com.epmet.dto.result.RemoveFileResultDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.OssEntity; import com.epmet.enums.OssTypeEnum; @@ -354,4 +356,11 @@ public class OssController { return ossService.uploadVoice(file); } + @PostMapping("article/remove/file") + public Result articleRemoveFile(@RequestBody RemoveFileFormDTO formDTO) { + RemoveFileResultDTO resultDTO = new RemoveFileResultDTO(); + resultDTO.setDelSuccess(ossService.articleRemoveFile(formDTO)); + return new Result().ok(resultDTO); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java index 79f8b14823..0be20abd16 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/dao/OssDao.java @@ -11,6 +11,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.OssEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 文件上传 @@ -19,5 +20,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface OssDao extends BaseDao { - + OssEntity selectByUrl(@Param("url") String url); + void deleteDataById(@Param("id") String id); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java index 3253f78527..4f4171df0e 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java @@ -11,6 +11,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.RemoveFileFormDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.OssEntity; import org.springframework.web.multipart.MultipartFile; @@ -35,4 +36,13 @@ public interface OssService extends BaseService { Result uploadVariedFile(MultipartFile file); Result uploadVoice(MultipartFile file); + + /** + * 删除附件 + * @author zhaoqifeng + * @date 2021/3/30 9:55 + * @param formDTO + * @return boolean + */ + boolean articleRemoveFile(RemoveFileFormDTO formDTO); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 5a5a74ba37..f1f236e7e6 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -14,11 +14,16 @@ import com.epmet.cloud.AbstractCloudStorageService; import com.epmet.cloud.OssFactory; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constants.PrivacyType; import com.epmet.dao.OssDao; +import com.epmet.dto.form.RemoveFileFormDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.OssEntity; import com.epmet.exception.ModuleErrorCode; @@ -26,15 +31,22 @@ import com.epmet.service.OssService; import org.apache.commons.io.FilenameUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.util.Date; import java.util.Map; +import java.util.Objects; @Service public class OssServiceImpl extends BaseServiceImpl implements OssService { private static final Logger logger = LoggerFactory.getLogger(OssServiceImpl.class); + + @Autowired + private RedisUtils redisUtils; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -161,6 +173,7 @@ public class OssServiceImpl extends BaseServiceImpl implement } //保存文件信息 OssEntity ossEntity = new OssEntity(); + ossEntity.setUrl(url); baseDao.insert(ossEntity); //文件信息 @@ -169,4 +182,32 @@ public class OssServiceImpl extends BaseServiceImpl implement return new Result().ok(dto); } + /** + * 删除附件 + * + * @return boolean + * @author zhaoqifeng + * @date 2021/3/30 9:55 + * @param formDTO + */ + @Override + public boolean articleRemoveFile(RemoveFileFormDTO formDTO) { + String[] strings = formDTO.getUrl().split(StrConstant.SEPARATOR); + String fileName = strings[strings.length - 1]; + OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); + long thirty = 30*60*1000; + Date now = new Date(); + long time = now.getTime() - entity.getCreatedTime().getTime(); + if (time > thirty) { + return false; + } + baseDao.deleteDataById(entity.getId()); + String dateStr = DateUtils.format(entity.getCreatedTime(), DateUtils.DATE_PATTERN_YYYYMMDD); + fileName = StrConstant.SEPARATOR + dateStr + StrConstant.SEPARATOR + fileName; + String key = RedisKeys.getOssFileKey(formDTO.getUrl()); + redisUtils.delete(key); + return Objects.requireNonNull(OssFactory.build()).delete(fileName); + } + + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml index 2531640cb1..a7489f514b 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/mapper/SysOssDao.xml @@ -2,5 +2,11 @@ + + delete from sys_oss where id = #{id} + + From bb2238013cccd0e3e1a6d789d9641dc0c8f23ff9 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 15:50:53 +0800 Subject: [PATCH 47/63] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/DraftContentDao.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml index 906a248e3c..cd90573da5 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftContentDao.xml @@ -9,6 +9,7 @@ CUSTOMER_ID, CONTENT, CONTENT_TYPE, + FILE_NAME, AUDIT_STATUS, AUDIT_REASON, ORDER_NUM @@ -28,7 +29,8 @@ SELECT ID, CONTENT, - CONTENT_TYPE + CONTENT_TYPE, + FILE_NAME FROM DRAFT_CONTENT WHERE @@ -41,4 +43,4 @@ DELETE FROM draft_content WHERE DRAFT_ID = #{draftId,jdbcType=VARCHAR} - \ No newline at end of file + From 33c23917987f59906878455323ab3d6db2686df3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 15:52:12 +0800 Subject: [PATCH 48/63] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/cloud/AbstractCloudStorageService.java | 2 +- .../main/java/com/epmet/cloud/AliyunCloudStorageService.java | 4 ++-- .../src/main/java/com/epmet/service/impl/OssServiceImpl.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java index 8cd699e5e9..74a38551d0 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java @@ -114,6 +114,6 @@ public abstract class AbstractCloudStorageService { * @param objectName * @return boolean */ - public abstract boolean delete(String objectName); + public abstract boolean delete(String objectName, String privacyType); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index c8d30d1c7d..4938319ecd 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -82,8 +82,8 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { } @Override - public boolean delete(String objectName) { - CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(null); + public boolean delete(String objectName,String privacyType) { + CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), props.getAliyunAccessKeySecret()); try { diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index f1f236e7e6..8cced9932a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -206,7 +206,7 @@ public class OssServiceImpl extends BaseServiceImpl implement fileName = StrConstant.SEPARATOR + dateStr + StrConstant.SEPARATOR + fileName; String key = RedisKeys.getOssFileKey(formDTO.getUrl()); redisUtils.delete(key); - return Objects.requireNonNull(OssFactory.build()).delete(fileName); + return Objects.requireNonNull(OssFactory.build()).delete(fileName,null); } From 7a28485378ccbaa75e00c199ec3ea41d4025c0b1 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 16:03:22 +0800 Subject: [PATCH 49/63] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/cloud/FastDFSCloudStorageService.java | 3 ++- .../main/java/com/epmet/cloud/LocalCloudStorageService.java | 3 ++- .../main/java/com/epmet/cloud/QcloudCloudStorageService.java | 3 ++- .../main/java/com/epmet/cloud/QiniuCloudStorageService.java | 3 ++- .../src/main/java/com/epmet/service/impl/OssServiceImpl.java | 3 +++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java index 41ceb4024e..08a591e86d 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java @@ -70,12 +70,13 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService { * 文件删除 * * @param objectName + * @param privacyType * @return boolean * @author zhaoqifeng * @date 2021/3/30 11:05 */ @Override - public boolean delete(String objectName) { + public boolean delete(String objectName, String privacyType) { return false; } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java index 76968ff118..7317bbd780 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java @@ -63,12 +63,13 @@ public class LocalCloudStorageService extends AbstractCloudStorageService { * 文件删除 * * @param objectName + * @param privacyType * @return boolean * @author zhaoqifeng * @date 2021/3/30 11:05 */ @Override - public boolean delete(String objectName) { + public boolean delete(String objectName, String privacyType) { return false; } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java index 5b91aa84c0..5d657ba318 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java @@ -93,12 +93,13 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService { * 文件删除 * * @param objectName + * @param privacyType * @return boolean * @author zhaoqifeng * @date 2021/3/30 11:05 */ @Override - public boolean delete(String objectName) { + public boolean delete(String objectName, String privacyType) { return false; } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java index 3b2035c89e..2fe73cddeb 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java @@ -87,12 +87,13 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService { * 文件删除 * * @param objectName + * @param privacyType * @return boolean * @author zhaoqifeng * @date 2021/3/30 11:05 */ @Override - public boolean delete(String objectName) { + public boolean delete(String objectName, String privacyType) { return false; } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 8cced9932a..03e30b4da3 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -8,6 +8,7 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.cloud.AbstractCloudStorageService; @@ -192,6 +193,7 @@ public class OssServiceImpl extends BaseServiceImpl implement */ @Override public boolean articleRemoveFile(RemoveFileFormDTO formDTO) { + logger.info("articleRemoveFile param:{}", JSON.toJSONString(formDTO)); String[] strings = formDTO.getUrl().split(StrConstant.SEPARATOR); String fileName = strings[strings.length - 1]; OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); @@ -206,6 +208,7 @@ public class OssServiceImpl extends BaseServiceImpl implement fileName = StrConstant.SEPARATOR + dateStr + StrConstant.SEPARATOR + fileName; String key = RedisKeys.getOssFileKey(formDTO.getUrl()); redisUtils.delete(key); + logger.info("articleRemoveFile oss delete fileName:{}", JSON.toJSONString(fileName)); return Objects.requireNonNull(OssFactory.build()).delete(fileName,null); } From 366ee1edfdaa64127b535b5e3acd8e0e45ff312a Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 17:02:07 +0800 Subject: [PATCH 50/63] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/RemoveFileResultDTO.java | 16 --------- .../cloud/AliyunCloudStorageService.java | 2 +- .../com/epmet/controller/OssController.java | 13 ++++---- .../epmet/service/impl/OssServiceImpl.java | 33 +++++++++---------- 4 files changed, 23 insertions(+), 41 deletions(-) delete mode 100644 epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java deleted file mode 100644 index e8a39a8a96..0000000000 --- a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/dto/result/RemoveFileResultDTO.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.epmet.dto.result; - -import lombok.Data; - -import java.io.Serializable; - -/** - * @author zhaoqifeng - * @dscription - * @date 2021/3/30 9:52 - */ -@Data -public class RemoveFileResultDTO implements Serializable { - private static final long serialVersionUID = 6509372741520843201L; - private Boolean delSuccess; -} diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 4938319ecd..151e70f979 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -87,7 +87,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), props.getAliyunAccessKeySecret()); try { - client.deleteObject(props.getAliyunBucketName(), props.getAliyunPrefix() + objectName); + client.deleteObject(props.getAliyunBucketName(), objectName); client.shutdown(); } catch (Exception e){ return false; diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 53c8befb84..be8513438e 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -24,7 +24,6 @@ import com.epmet.commons.tools.validator.group.QcloudGroup; import com.epmet.commons.tools.validator.group.QiniuGroup; import com.epmet.dto.UploadDTO; import com.epmet.dto.form.RemoveFileFormDTO; -import com.epmet.dto.result.RemoveFileResultDTO; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.OssEntity; import com.epmet.enums.OssTypeEnum; @@ -241,7 +240,6 @@ public class OssController { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } - //todo 获取url 缓存半小时 删除时获取并调用删除方法 } else { // 校验文件体积,不超过2m long maxSize = 2 * 1024 * 1024; @@ -255,7 +253,10 @@ public class OssController { if (result != null && result.success() ){ UploadImgResultDTO data = result.getData(); if ( data!= null && StringUtils.isNotBlank(data.getUrl())){ - String path = data.getUrl().replace(data.getUrl(), StrConstant.EPMETY_STR); + String path = data.getUrl().replace(data.getDomain(), StrConstant.EPMETY_STR); + if (path.startsWith(StrConstant.SEPARATOR)){ + path = path.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); + } redisUtils.set(RedisKeys.getOssFileKey(path),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } @@ -357,10 +358,8 @@ public class OssController { } @PostMapping("article/remove/file") - public Result articleRemoveFile(@RequestBody RemoveFileFormDTO formDTO) { - RemoveFileResultDTO resultDTO = new RemoveFileResultDTO(); - resultDTO.setDelSuccess(ossService.articleRemoveFile(formDTO)); - return new Result().ok(resultDTO); + public Result articleRemoveFile(@RequestBody RemoveFileFormDTO formDTO) { + return new Result().ok(ossService.articleRemoveFile(formDTO)); } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 03e30b4da3..83eeb2949d 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -20,7 +20,6 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constants.PrivacyType; import com.epmet.dao.OssDao; @@ -37,9 +36,7 @@ import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; -import java.util.Date; import java.util.Map; -import java.util.Objects; @Service public class OssServiceImpl extends BaseServiceImpl implements OssService { @@ -194,22 +191,24 @@ public class OssServiceImpl extends BaseServiceImpl implement @Override public boolean articleRemoveFile(RemoveFileFormDTO formDTO) { logger.info("articleRemoveFile param:{}", JSON.toJSONString(formDTO)); - String[] strings = formDTO.getUrl().split(StrConstant.SEPARATOR); - String fileName = strings[strings.length - 1]; + AbstractCloudStorageService build = OssFactory.build(); + String ossDomain = build.getOssDomain(null); + String fileName = formDTO.getUrl().replace(ossDomain, StrConstant.EPMETY_STR); + if (fileName.startsWith(StrConstant.SEPARATOR)){ + fileName = fileName.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); + } + String key = RedisKeys.getOssFileKey(fileName); + Object o = redisUtils.get(key); + if (o == null){ + //return false; + } + logger.info("articleRemoveFile oss delete fileName:{}", fileName); + OssFactory.build().delete(fileName,null); OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); - long thirty = 30*60*1000; - Date now = new Date(); - long time = now.getTime() - entity.getCreatedTime().getTime(); - if (time > thirty) { - return false; + if (entity != null){ + baseDao.deleteDataById(entity.getId()); } - baseDao.deleteDataById(entity.getId()); - String dateStr = DateUtils.format(entity.getCreatedTime(), DateUtils.DATE_PATTERN_YYYYMMDD); - fileName = StrConstant.SEPARATOR + dateStr + StrConstant.SEPARATOR + fileName; - String key = RedisKeys.getOssFileKey(formDTO.getUrl()); - redisUtils.delete(key); - logger.info("articleRemoveFile oss delete fileName:{}", JSON.toJSONString(fileName)); - return Objects.requireNonNull(OssFactory.build()).delete(fileName,null); + return true; } From bdcb8947dd6e23af8aec9ffb37ce458d9790550e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 17:13:40 +0800 Subject: [PATCH 51/63] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/OssController.java | 3 ++- .../com/epmet/service/impl/OssServiceImpl.java | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index be8513438e..8a52849edf 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -257,7 +257,8 @@ public class OssController { if (path.startsWith(StrConstant.SEPARATOR)){ path = path.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); } - redisUtils.set(RedisKeys.getOssFileKey(path),path,RedisUtils.MINUTE_THIRTY_EXPIRE); + String fileName = data.getUrl().substring(data.getUrl().lastIndexOf(StrConstant.SEPARATOR)); + redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } return ossService.uploadImg(file, null); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 83eeb2949d..21c82039e4 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.entity.OssEntity; import com.epmet.exception.ModuleErrorCode; import com.epmet.service.OssService; import org.apache.commons.io.FilenameUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -191,17 +192,23 @@ public class OssServiceImpl extends BaseServiceImpl implement @Override public boolean articleRemoveFile(RemoveFileFormDTO formDTO) { logger.info("articleRemoveFile param:{}", JSON.toJSONString(formDTO)); + if (StringUtils.isBlank(formDTO.getUrl())){ + logger.warn("articleRemoveFile param is empty"); + return false; + } + String key = RedisKeys.getOssFileKey(formDTO.getUrl().substring(formDTO.getUrl().lastIndexOf(StrConstant.SEPARATOR))); + Object o = redisUtils.get(key); + if (o == null){ + return false; + } + redisUtils.delete(key); AbstractCloudStorageService build = OssFactory.build(); String ossDomain = build.getOssDomain(null); String fileName = formDTO.getUrl().replace(ossDomain, StrConstant.EPMETY_STR); if (fileName.startsWith(StrConstant.SEPARATOR)){ fileName = fileName.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); } - String key = RedisKeys.getOssFileKey(fileName); - Object o = redisUtils.get(key); - if (o == null){ - //return false; - } + logger.info("articleRemoveFile oss delete fileName:{}", fileName); OssFactory.build().delete(fileName,null); OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); From 78bcaea9e6b76f9d761fd55abfb13824722e041e Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 17:20:44 +0800 Subject: [PATCH 52/63] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6?= =?UTF-8?q?=20=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/OssController.java | 2 +- .../src/main/java/com/epmet/service/impl/OssServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 8a52849edf..72f934756d 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -257,7 +257,7 @@ public class OssController { if (path.startsWith(StrConstant.SEPARATOR)){ path = path.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); } - String fileName = data.getUrl().substring(data.getUrl().lastIndexOf(StrConstant.SEPARATOR)); + String fileName = data.getUrl().substring(data.getUrl().lastIndexOf(StrConstant.SEPARATOR)+1); redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index 21c82039e4..ce0928f3e9 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -196,7 +196,7 @@ public class OssServiceImpl extends BaseServiceImpl implement logger.warn("articleRemoveFile param is empty"); return false; } - String key = RedisKeys.getOssFileKey(formDTO.getUrl().substring(formDTO.getUrl().lastIndexOf(StrConstant.SEPARATOR))); + String key = RedisKeys.getOssFileKey(formDTO.getUrl().substring(formDTO.getUrl().lastIndexOf(StrConstant.SEPARATOR) +1)); Object o = redisUtils.get(key); if (o == null){ return false; From fee3efa95c0f370ee8faa48891e39f3342a0d767 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 30 Mar 2021 17:36:09 +0800 Subject: [PATCH 53/63] =?UTF-8?q?oss=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/OssController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 72f934756d..7410f81b6a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -261,7 +261,7 @@ public class OssController { redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } - return ossService.uploadImg(file, null); + return result; } From 63725e21cfdb553128b9bc6d6b4b8073d7bc2d59 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 09:31:32 +0800 Subject: [PATCH 54/63] =?UTF-8?q?oss=E5=88=A0=E9=99=A4=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/GovLoginServiceImpl.java | 2 +- .../com/epmet/service/impl/ThirdLoginServiceImpl.java | 2 +- .../main/java/com/epmet/service/impl/OssServiceImpl.java | 8 +------- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index ee60b3c22f..88f9f1a5a2 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -362,7 +362,7 @@ public class GovLoginServiceImpl implements GovLoginService { } //密码错误 if(!passwordRightFlag){ - logger.error(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile())); + logger.warn(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile())); throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode()); } StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO(); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index d1cc70552e..4363556cf9 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -484,7 +484,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { } //密码错误 if(!passwordRightFlag){ - logger.error(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile())); + logger.warn(String.format("根据当前手机号(%s)密码未找到所属组织,密码错误",formDTO.getMobile())); throw new RenException(EpmetErrorCode.PASSWORD_ERROR.getCode()); } StaffOrgFormDTO staffOrgFormDTO = new StaffOrgFormDTO(); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index ce0928f3e9..f112dc69b1 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -202,13 +202,7 @@ public class OssServiceImpl extends BaseServiceImpl implement return false; } redisUtils.delete(key); - AbstractCloudStorageService build = OssFactory.build(); - String ossDomain = build.getOssDomain(null); - String fileName = formDTO.getUrl().replace(ossDomain, StrConstant.EPMETY_STR); - if (fileName.startsWith(StrConstant.SEPARATOR)){ - fileName = fileName.replaceFirst(StrConstant.SEPARATOR,StrConstant.EPMETY_STR); - } - + String fileName = (String) o; logger.info("articleRemoveFile oss delete fileName:{}", fileName); OssFactory.build().delete(fileName,null); OssEntity entity = baseDao.selectByUrl(formDTO.getUrl()); From 86caa3708e74ea47624d9330ee82434b1eba5470 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 13:39:43 +0800 Subject: [PATCH 55/63] =?UTF-8?q?oss=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cloud/AliyunCloudStorageService.java | 38 +++++++++++++++++-- .../main/java/com/epmet/cloud/OssFactory.java | 31 +++++++-------- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 151e70f979..1a2864d6e1 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -26,16 +26,47 @@ import java.io.InputStream; */ public class AliyunCloudStorageService extends AbstractCloudStorageService { + private OSSClient internalClient = null; + private OSSClient externalClient = null; + + { + + } + public AliyunCloudStorageService(CloudStorageConfig config){ this.config = config; } /** - * @Description 根据隐私类型获取属性。传递internal的时候会返回内部的,否则返回外部的,即公开的 + * @Description 根据隐私类型获取属性。获取client * @return * @author wxz * @date 2021.01.04 13:49 */ + public OSSClient getOssClient(String privacyType) { + if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) { + if (internalClient == null){ + CloudStorageConfig.AliyunCloudStorageConfigProps props = config.getAliyun().getInternal(); + internalClient = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + props.getAliyunAccessKeySecret()); + } + return internalClient; + } else { + if (externalClient == null) { + CloudStorageConfig.AliyunCloudStorageConfigProps props = config.getAliyun().getExternal(); + externalClient = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + props.getAliyunAccessKeySecret()); + } + return externalClient; + } + } + + /** + * @Description 根据隐私类型获取属性。传递internal的时候会返回内部的,否则返回外部的,即公开的 + * @return + * @author wxz + * @date 2021.01.04 13:49 + */ public CloudStorageConfig.AliyunCloudStorageConfigProps getPropsByprivacyType(String privacyType) { if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) { return config.getAliyun().getInternal(); @@ -69,11 +100,10 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public String upload(InputStream inputStream, String path, String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), - props.getAliyunAccessKeySecret()); + OSSClient client = getOssClient(privacyType); try { client.putObject(props.getAliyunBucketName(), path, inputStream); - client.shutdown(); + //client.shutdown(); } catch (Exception e){ throw new RenException(ModuleErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java index 7febe43644..3d69543784 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/OssFactory.java @@ -20,28 +20,29 @@ import com.epmet.utils.ModuleConstant; */ public final class OssFactory { private static ParamsRemoteService paramsRemoteService; + private static AbstractCloudStorageService abstractCloudStorageService; static { OssFactory.paramsRemoteService = SpringContextUtils.getBean(ParamsRemoteService.class); } public static AbstractCloudStorageService build(){ - //获取云存储配置信息 - CloudStorageConfig config = paramsRemoteService.getValueObject(ModuleConstant.CLOUD_STORAGE_CONFIG_KEY, CloudStorageConfig.class); - - if(config.getType() == OssTypeEnum.QINIU.value()){ - return new QiniuCloudStorageService(config); - }else if(config.getType() == OssTypeEnum.ALIYUN.value()){ - return new AliyunCloudStorageService(config); - }else if(config.getType() == OssTypeEnum.QCLOUD.value()){ - return new QcloudCloudStorageService(config); - }else if(config.getType() == OssTypeEnum.FASTDFS.value()){ - return new FastDFSCloudStorageService(config); - }else if(config.getType() == OssTypeEnum.LOCAL.value()){ - return new LocalCloudStorageService(config); + if (abstractCloudStorageService == null){ + //获取云存储配置信息 + CloudStorageConfig config = paramsRemoteService.getValueObject(ModuleConstant.CLOUD_STORAGE_CONFIG_KEY, CloudStorageConfig.class); + if(config.getType() == OssTypeEnum.QINIU.value()){ + abstractCloudStorageService = new QiniuCloudStorageService(config); + }else if(config.getType() == OssTypeEnum.ALIYUN.value()){ + abstractCloudStorageService = new AliyunCloudStorageService(config); + }else if(config.getType() == OssTypeEnum.QCLOUD.value()){ + abstractCloudStorageService = new QcloudCloudStorageService(config); + }else if(config.getType() == OssTypeEnum.FASTDFS.value()){ + abstractCloudStorageService = new FastDFSCloudStorageService(config); + }else if(config.getType() == OssTypeEnum.LOCAL.value()){ + abstractCloudStorageService = new LocalCloudStorageService(config); + } } - - return null; + return abstractCloudStorageService; } } From d655c70fa0e26dbd83b0b57fa76e45a249efb49e Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 13:42:02 +0800 Subject: [PATCH 56/63] =?UTF-8?q?oss=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/cloud/AliyunCloudStorageService.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 1a2864d6e1..53a49f0034 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -114,8 +114,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public boolean delete(String objectName,String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), - props.getAliyunAccessKeySecret()); + OSSClient client = getOssClient(privacyType); try { client.deleteObject(props.getAliyunBucketName(), objectName); client.shutdown(); @@ -141,8 +140,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public void down(String privacyType) throws IOException { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), - props.getAliyunAccessKeySecret()); + OSSClient client = getOssClient(privacyType); try { /* From f903f933681a9ac930dfa2ff9c4c7f55e6bef0af Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 31 Mar 2021 14:36:27 +0800 Subject: [PATCH 57/63] =?UTF-8?q?/epmet/ext/user/userinfo=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=97=A5=E5=BF=97=E9=99=8D=E7=BA=A7=EF=BC=8C=E4=B8=94?= =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/UserBaseInfoServiceImpl.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 852ca55843..e779487861 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -383,11 +383,10 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl govOrgResult = govOrgOpenFeignClient.userInfoExt(result); - if(govOrgResult.success() && null != govOrgResult.getData()){ - return govOrgResult.getData();} - + if (govOrgResult.success() && null != govOrgResult.getData()) { + return govOrgResult.getData(); + } return result; } } From a4a1790ff52e6a150d171edd3cb4efd75ff0d631 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 14:41:30 +0800 Subject: [PATCH 58/63] =?UTF-8?q?oss=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/cloud/AliyunCloudStorageService.java | 4 ++-- .../main/java/com/epmet/controller/OssController.java | 7 +++---- .../main/java/com/epmet/service/impl/OssServiceImpl.java | 9 +++------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index 53a49f0034..d270023543 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -117,7 +117,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { OSSClient client = getOssClient(privacyType); try { client.deleteObject(props.getAliyunBucketName(), objectName); - client.shutdown(); + //client.shutdown(); } catch (Exception e){ return false; } @@ -178,7 +178,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { downloadRes.getObjectMetadata(); // 关闭OSSClient。 - client.shutdown(); + //client.shutdown(); } catch (Exception e){ throw new RenException(ModuleErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); } catch (Throwable throwable) { diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 7410f81b6a..04889584db 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -232,18 +232,17 @@ public class OssController { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); } + long size = file.getSize(); if (ModuleConstant.FILE_CONTENT_TYPE_PDF.equals(file.getContentType())) { - // 校验文件体积,不超过5m + // 校验文件大小,不超过5m long maxSize = 5 * 1024 * 1024; - long size = file.getSize(); if (size > maxSize) { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } } else { - // 校验文件体积,不超过2m + // 校验文件大小,不超过2m long maxSize = 2 * 1024 * 1024; - long size = file.getSize(); if (size > maxSize) { throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode() , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index f112dc69b1..eb38a6520a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -74,8 +74,7 @@ public class OssServiceImpl extends BaseServiceImpl implement url = storageService.uploadSuffix(file.getBytes(), extension, privacy); ossDomain = storageService.getOssDomain(privacy); } catch (IOException e) { - e.printStackTrace(); - logger.error("图片上传异常"); + logger.error("图片上传异常", e); throw new RenException("图片上传异常"); } @@ -134,8 +133,7 @@ public class OssServiceImpl extends BaseServiceImpl implement try { url = OssFactory.build().uploadSuffix(file.getBytes(), extension, PrivacyType.INTERNAL); } catch (IOException e) { - e.printStackTrace(); - logger.error("文件上传异常"); + logger.error("文件上传异常", e); throw new RenException("文件上传异常"); } //保存文件信息 @@ -165,8 +163,7 @@ public class OssServiceImpl extends BaseServiceImpl implement try { url = OssFactory.build().uploadSuffix(file.getBytes(), extension, null); } catch (IOException e) { - e.printStackTrace(); - logger.error("语音上传异常"); + logger.error("语音上传异常", e); throw new RenException("语音上传异常"); } From ff8bea4200738e2167cbdf1ccf16b5d163e8dd05 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 15:10:49 +0800 Subject: [PATCH 59/63] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/SysDeptController.java | 4 - .../controller/SysDictDataController.java | 4 - .../controller/SysDictTypeController.java | 4 - .../controller/SysLogErrorController.java | 2 - .../controller/SysLogLoginController.java | 2 - .../controller/SysLogOperationController.java | 2 - .../epmet/controller/SysMenuController.java | 4 - .../epmet/controller/SysParamsController.java | 5 - .../epmet/controller/SysRegionController.java | 10 +- .../epmet/controller/SysRoleController.java | 4 - .../epmet/controller/SysUserController.java | 6 - .../main/java/com/epmet/log/LogConsumer.java | 95 ----------- .../epmet/service/impl/AuthServiceImpl.java | 8 - .../tools/annotation/LogOperation.java | 24 --- .../commons/tools/aop/NoRepeatSubmitAop.java | 13 +- .../tools/aspect/LogOperationAspect.java | 121 -------------- .../tools/exception/RenExceptionHandler.java | 153 ------------------ .../tools/log/producer/LogProducer.java | 43 ----- .../epmet/commons/tools/redis/RedisKeys.java | 7 - .../epmet/controller/ActModelController.java | 6 - .../controller/ActProcessController.java | 6 - .../controller/ActRunningController.java | 4 - .../epmet/controller/ActTaskController.java | 2 - .../demo/controller/CorrectionController.java | 5 - .../controller/ScheduleJobController.java | 19 +-- .../controller/MailTemplateController.java | 1 - .../com/epmet/controller/OssController.java | 2 + .../epmet/service/impl/OssServiceImpl.java | 7 + 28 files changed, 20 insertions(+), 543 deletions(-) delete mode 100644 epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java delete mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java delete mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java delete mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java delete mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java index 62374c4bb9..49f4889c29 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDeptController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysDeptDTO; import com.epmet.service.SysDeptService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -56,7 +55,6 @@ public class SysDeptController { @PostMapping @ApiOperation("保存") - @LogOperation("Save Dept") public Result save(@RequestBody SysDeptDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -68,7 +66,6 @@ public class SysDeptController { @PutMapping @ApiOperation("修改") - @LogOperation("Update Dept") public Result update(@RequestBody SysDeptDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -80,7 +77,6 @@ public class SysDeptController { @DeleteMapping("{id}") @ApiOperation("删除") - @LogOperation("Delete Dept") public Result delete(@PathVariable("id") Long id){ //效验数据 AssertUtils.isNull(id, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java index c136a05cde..005c205f46 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysDictDataDTO; import com.epmet.service.SysDictDataService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -67,7 +66,6 @@ public class SysDictDataController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") public Result save(@RequestBody SysDictDataDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, DefaultGroup.class); @@ -79,7 +77,6 @@ public class SysDictDataController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") public Result update(@RequestBody SysDictDataDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -91,7 +88,6 @@ public class SysDictDataController { @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java index 9d54f1e138..f6289329ab 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictTypeController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysDictTypeDTO; import com.epmet.service.SysDictTypeService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -69,7 +68,6 @@ public class SysDictTypeController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") public Result save(@RequestBody SysDictTypeDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, DefaultGroup.class); @@ -81,7 +79,6 @@ public class SysDictTypeController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") public Result update(@RequestBody SysDictTypeDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -93,7 +90,6 @@ public class SysDictTypeController { @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java index e6260f7fd4..a000b0bebd 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogErrorController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysLogErrorDTO; import com.epmet.service.SysLogErrorService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -59,7 +58,6 @@ public class SysLogErrorController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export Log Error") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = sysLogErrorService.list(params); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java index 6df2a4ca9b..e503be46c2 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogLoginController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysLogLoginDTO; import com.epmet.service.SysLogLoginService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -60,7 +59,6 @@ public class SysLogLoginController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export Log Login") @ApiImplicitParams({ @ApiImplicitParam(name = "status", value = "状态 0:失败 1:成功 2:账号已锁定", paramType = "query", dataType="int"), @ApiImplicitParam(name = "creatorName", value = "用户名", paramType = "query", dataType="String") diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java index 85ec7cd34f..429375ffb4 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysLogOperationController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysLogOperationDTO; import com.epmet.service.SysLogOperationService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -63,7 +62,6 @@ public class SysLogOperationController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export Log Operation") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = sysLogOperationService.list(params); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java index 90c1ca5d63..2b60b0b25c 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysMenuController.java @@ -12,7 +12,6 @@ import com.epmet.dto.MenuResourceDTO; import com.epmet.dto.SysMenuDTO; import com.epmet.service.SysMenuService; import com.epmet.service.SysResourceService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.security.user.UserDetail; import com.epmet.commons.tools.utils.Result; @@ -83,7 +82,6 @@ public class SysMenuController { @PostMapping @ApiOperation("保存") - @LogOperation("Save Menu") public Result save(@RequestBody SysMenuDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, DefaultGroup.class); @@ -95,7 +93,6 @@ public class SysMenuController { @PutMapping @ApiOperation("修改") - @LogOperation("Update Menu") public Result update(@RequestBody SysMenuDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, DefaultGroup.class); @@ -107,7 +104,6 @@ public class SysMenuController { @DeleteMapping("{id}") @ApiOperation("删除") - @LogOperation("Delete Menu") public Result delete(@PathVariable("id") Long id){ //效验数据 AssertUtils.isNull(id, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java index 0185e12b0e..419d168392 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysParamsController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysParamsDTO; import com.epmet.service.SysParamsService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; @@ -72,7 +71,6 @@ public class SysParamsController { @PostMapping @ApiOperation("保存") - @LogOperation("Save Params") public Result save(@RequestBody SysParamsDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -84,7 +82,6 @@ public class SysParamsController { @PutMapping @ApiOperation("修改") - @LogOperation("Update Params") public Result update(@RequestBody SysParamsDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -96,7 +93,6 @@ public class SysParamsController { @DeleteMapping @ApiOperation("删除") - @LogOperation("Delete Params") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); @@ -108,7 +104,6 @@ public class SysParamsController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export Params") @ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = sysParamsService.list(params); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java index c3bc399a57..b61c522004 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRegionController.java @@ -11,7 +11,6 @@ package com.epmet.controller; import com.epmet.dto.SysRegionDTO; import com.epmet.dto.region.RegionProvince; import com.epmet.service.SysRegionService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.Result; @@ -71,8 +70,7 @@ public class SysRegionController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") - public Result save(@RequestBody SysRegionDTO dto){ + public Result save(@RequestBody SysRegionDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -83,8 +81,7 @@ public class SysRegionController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") - public Result update(@RequestBody SysRegionDTO dto){ + public Result update(@RequestBody SysRegionDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -95,8 +92,7 @@ public class SysRegionController { @DeleteMapping("{id}") @ApiOperation("删除") - @LogOperation("删除") - public Result delete(@PathVariable("id") Long id){ + public Result delete(@PathVariable("id") Long id){ //效验数据 AssertUtils.isNull(id, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java index 67be9b29c9..6093e3ec4e 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysRoleController.java @@ -10,7 +10,6 @@ package com.epmet.controller; import com.epmet.dto.SysRoleDTO; import com.epmet.service.SysRoleService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -94,7 +93,6 @@ public class SysRoleController { @PostMapping @ApiOperation("保存") - @LogOperation("Save Role") public Result save(@RequestBody SysRoleDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -106,7 +104,6 @@ public class SysRoleController { @PutMapping @ApiOperation("修改") - @LogOperation("Update Role") public Result update(@RequestBody SysRoleDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -118,7 +115,6 @@ public class SysRoleController { @DeleteMapping @ApiOperation("删除") - @LogOperation("Delete Role") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java index 6618195db8..a7f9fb9eef 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysUserController.java @@ -13,7 +13,6 @@ import com.epmet.dto.PasswordDTO; import com.epmet.dto.SysUserDTO; import com.epmet.service.SysResourceService; import com.epmet.service.SysUserService; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; @@ -98,7 +97,6 @@ public class SysUserController { @PostMapping @ApiOperation("保存") - @LogOperation("Save User") public Result save(@RequestBody SysUserDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -110,7 +108,6 @@ public class SysUserController { @PutMapping @ApiOperation("修改") - @LogOperation("Update User") public Result update(@RequestBody SysUserDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -122,7 +119,6 @@ public class SysUserController { @PutMapping("password") @ApiOperation("修改密码") - @LogOperation("Password User") public Result password(@RequestBody PasswordDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto); @@ -141,7 +137,6 @@ public class SysUserController { @DeleteMapping @ApiOperation("删除") - @LogOperation("Delete User") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); @@ -153,7 +148,6 @@ public class SysUserController { @GetMapping("export") @ApiOperation("导出") - @LogOperation("Export User") @ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType="String") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { List list = sysUserService.list(params); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java deleted file mode 100644 index 67f6f8d051..0000000000 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/log/LogConsumer.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.log; - -import com.epmet.commons.tools.exception.ExceptionUtils; -import com.epmet.commons.tools.log.BaseLog; -import com.epmet.commons.tools.log.enums.LogTypeEnum; -import com.epmet.commons.tools.redis.RedisKeys; -import com.epmet.commons.tools.redis.RedisUtils; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.entity.SysLogErrorEntity; -import com.epmet.entity.SysLogLoginEntity; -import com.epmet.entity.SysLogOperationEntity; -import com.epmet.service.SysLogErrorService; -import com.epmet.service.SysLogLoginService; -import com.epmet.service.SysLogOperationService; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.CommandLineRunner; -import org.springframework.stereotype.Component; - -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -/** - * 从Redis队列中获取Log,保存到DB - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Slf4j -@Component -public class LogConsumer implements CommandLineRunner { - @Autowired - private RedisUtils redisUtils; - @Autowired - private SysLogErrorService sysLogErrorService; - @Autowired - private SysLogLoginService sysLogLoginService; - @Autowired - private SysLogOperationService sysLogOperationService; - private ScheduledExecutorService scheduledService = new ScheduledThreadPoolExecutor(1, - new BasicThreadFactory.Builder().namingPattern("log-consumer-schedule-pool-%d").daemon(true).build()); - - @Override - public void run(String... args) { - //上次任务结束后,等待10秒钟,再执行下次任务 - scheduledService.scheduleWithFixedDelay(() -> { - try { - receiveQueue(); - }catch (Exception e){ - log.error("LogConsumer Error:"+ ExceptionUtils.getErrorStackTrace(e)); - } - }, 1, 10, TimeUnit.SECONDS); - } - - private void receiveQueue() { - String key = RedisKeys.getSysLogKey(); - //每次插入100条 - int count = 100; - for(int i = 0; i < count; i++){ - BaseLog log = (BaseLog) redisUtils.rightPop(key); - if(log == null){ - return; - } - - //登录日志 - if(log.getType() == LogTypeEnum.LOGIN.value()){ - SysLogLoginEntity entity = ConvertUtils.sourceToTarget(log, SysLogLoginEntity.class); - sysLogLoginService.save(entity); - } - - //操作日志 - if(log.getType() == LogTypeEnum.OPERATION.value()){ - SysLogOperationEntity entity = ConvertUtils.sourceToTarget(log, SysLogOperationEntity.class); - sysLogOperationService.save(entity); - } - - //异常日志 - if(log.getType() == LogTypeEnum.ERROR.value()){ - SysLogErrorEntity entity = ConvertUtils.sourceToTarget(log, SysLogErrorEntity.class); - sysLogErrorService.save(entity); - } - } - } - -} diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java index d8bdd0548a..67ef6c0e90 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/AuthServiceImpl.java @@ -14,7 +14,6 @@ import com.epmet.commons.tools.log.SysLogLogin; import com.epmet.commons.tools.log.enums.LogTypeEnum; import com.epmet.commons.tools.log.enums.LoginOperationEnum; import com.epmet.commons.tools.log.enums.LoginStatusEnum; -import com.epmet.commons.tools.log.producer.LogProducer; import com.epmet.commons.tools.redis.UserDetailRedis; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.security.user.SecurityUser; @@ -49,8 +48,6 @@ public class AuthServiceImpl implements AuthService { @Autowired private UserDetailRedis userDetailRedis; @Autowired - private LogProducer logProducer; - @Autowired private JwtUtils jwtUtils; @Autowired private JwtProperties jwtProperties; @@ -76,7 +73,6 @@ public class AuthServiceImpl implements AuthService { if(user == null){ log.setStatus(LoginStatusEnum.FAIL.value()); log.setCreatorName(login.getUsername()); - logProducer.saveLog(log); throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); } @@ -86,7 +82,6 @@ public class AuthServiceImpl implements AuthService { log.setStatus(LoginStatusEnum.FAIL.value()); log.setCreator(user.getId()); log.setCreatorName(user.getUsername()); - logProducer.saveLog(log); throw new RenException(ErrorCode.ACCOUNT_PASSWORD_ERROR); } @@ -96,7 +91,6 @@ public class AuthServiceImpl implements AuthService { log.setStatus(LoginStatusEnum.LOCK.value()); log.setCreator(user.getId()); log.setCreatorName(user.getUsername()); - logProducer.saveLog(log); throw new RenException(ErrorCode.ACCOUNT_DISABLE); } @@ -116,7 +110,6 @@ public class AuthServiceImpl implements AuthService { log.setCreator(user.getId()); log.setCreatorName(user.getUsername()); log.setStatus(LoginStatusEnum.SUCCESS.value()); - logProducer.saveLog(log); return authorization; } @@ -138,7 +131,6 @@ public class AuthServiceImpl implements AuthService { log.setCreator(user.getId()); log.setCreatorName(user.getUsername()); log.setCreateDate(new Date()); - logProducer.saveLog(log); userDetailRedis.logout(userId); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java deleted file mode 100644 index a93a9ef538..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/annotation/LogOperation.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.commons.tools.annotation; - -import java.lang.annotation.*; - -/** - * 操作日志注解 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Target(ElementType.METHOD) -@Retention(RetentionPolicy.RUNTIME) -@Documented -public @interface LogOperation { - String value() default ""; -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java index 42f1950d5f..f887dd1aab 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java @@ -6,19 +6,14 @@ import com.epmet.commons.tools.exception.RenException; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.JoinPoint; import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.AfterThrowing; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Before; import org.springframework.context.annotation.Configuration; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.Method; -import java.util.Objects; import java.util.concurrent.TimeUnit; /** @@ -35,16 +30,12 @@ public class NoRepeatSubmitAop { /** * 重复提交判断时间为2s */ - private static final Cache CACHES = CacheBuilder.newBuilder() + private static final Cache CACHES = CacheBuilder.newBuilder() // 最大缓存 100 个 .maximumSize(1000) // 设置写缓存后 5 秒钟过期 .expireAfterWrite(5, TimeUnit.SECONDS) .build(); - @Before("execution(public * com.epmet..*Controller.*(..))") - public void before(JoinPoint joinPoint) { - System.out.println(joinPoint.getSignature().getName()); - } @Around("execution(public * com.epmet..*Controller.*(..)) && @annotation(com.epmet.commons.tools.aop.NoRepeatSubmit)") public Object around(ProceedingJoinPoint pjp) { @@ -79,4 +70,4 @@ public class NoRepeatSubmitAop { } -} \ No newline at end of file +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java deleted file mode 100644 index d51d147a8e..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/LogOperationAspect.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.commons.tools.aspect; - -import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.annotation.LogOperation; -import com.epmet.commons.tools.config.ModuleConfig; -import com.epmet.commons.tools.security.user.SecurityUser; -import com.epmet.commons.tools.log.SysLogOperation; -import com.epmet.commons.tools.log.enums.LogTypeEnum; -import com.epmet.commons.tools.log.enums.OperationStatusEnum; -import com.epmet.commons.tools.log.producer.LogProducer; -import com.epmet.commons.tools.security.user.UserDetail; -import com.epmet.commons.tools.utils.HttpContextUtils; -import com.epmet.commons.tools.utils.IpUtils; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; -import org.aspectj.lang.annotation.Aspect; -import org.aspectj.lang.annotation.Pointcut; -import org.aspectj.lang.reflect.MethodSignature; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpHeaders; -import org.springframework.stereotype.Component; - -import javax.servlet.http.HttpServletRequest; -import java.lang.reflect.Method; -import java.util.Date; - -/** - * 操作日志,切面处理类 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Aspect -@Component -public class LogOperationAspect { - @Autowired - private ModuleConfig moduleConfig; - @Autowired - private LogProducer logProducer; - - @Pointcut("@annotation(com.epmet.commons.tools.annotation.LogOperation)") - public void logPointCut() { - - } - - @Around("logPointCut()") - public Object around(ProceedingJoinPoint point) throws Throwable { - long beginTime = System.currentTimeMillis(); - try { - //执行方法 - Object result = point.proceed(); - - //执行时长(毫秒) - long time = System.currentTimeMillis() - beginTime; - //保存日志 - saveLog(point, time, OperationStatusEnum.SUCCESS.value()); - - return result; - }catch(Exception e) { - //执行时长(毫秒) - long time = System.currentTimeMillis() - beginTime; - //保存日志 - saveLog(point, time, OperationStatusEnum.FAIL.value()); - - throw e; - } - } - - - private void saveLog(ProceedingJoinPoint joinPoint, long time, Integer status) { - MethodSignature signature = (MethodSignature) joinPoint.getSignature(); - Method method = signature.getMethod(); - - SysLogOperation log = new SysLogOperation(); - LogOperation annotation = method.getAnnotation(LogOperation.class); - if(annotation != null){ - //注解上的描述 - log.setOperation(annotation.value()); - } - - //登录用户信息 - UserDetail user = SecurityUser.getUser(); - if(user != null){ - log.setCreator(user.getId()); - log.setCreatorName(user.getUsername()); - } - - log.setType(LogTypeEnum.OPERATION.value()); - log.setModule(moduleConfig.getName()); - log.setStatus(status); - log.setRequestTime((int)time); - log.setCreateDate(new Date()); - - //请求相关信息 - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - log.setIp(IpUtils.getIpAddr(request)); - log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); - log.setRequestUri(request.getRequestURI()); - log.setRequestMethod(request.getMethod()); - - //请求参数 - Object[] args = joinPoint.getArgs(); - try{ - String params = JSON.toJSONString(args[0]); - log.setRequestParams(params); - }catch (Exception e){ - - } - - //保存到Redis队列里 - logProducer.saveLog(log); - } -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java deleted file mode 100644 index 035ec89088..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.commons.tools.exception; - -import cn.hutool.core.map.MapUtil; -import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.config.ModuleConfig; -import com.epmet.commons.tools.log.SysLogError; -import com.epmet.commons.tools.log.enums.LogTypeEnum; -import com.epmet.commons.tools.log.producer.LogProducer; -import com.epmet.commons.tools.security.user.LoginUserUtil; -import com.epmet.commons.tools.utils.HttpContextUtils; -import com.epmet.commons.tools.utils.IpUtils; -import com.epmet.commons.tools.utils.Result; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DuplicateKeyException; -import org.springframework.http.HttpHeaders; -import org.springframework.web.bind.annotation.ExceptionHandler; - -import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.Map; - - -/** - * 异常处理器 - * 暂停使用,改用BaseRequestLogAspect - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -//@RestControllerAdvice -public class RenExceptionHandler { - private static final Logger logger = LoggerFactory.getLogger(RenExceptionHandler.class); - @Autowired - private ModuleConfig moduleConfig; - @Autowired - private LogProducer logProducer; - @Autowired - private LoginUserUtil loginUserUtil; - - /** - * 处理自定义异常 - * "code": 8000, - * "msg": "服务器开小差了...", - */ - @ExceptionHandler(RenException.class) - public Result handleRRException(RenException ex){ - if (ex.getCode() > 8000) { - Result result=new Result().error(ex.getCode()); - result.setData(ex.getInternalMsg()); - return result; - } - logger.error(ExceptionUtils.getErrorStackTrace(ex)); - Result result=new Result().error(); - result.setData(ex.getInternalMsg()); - return result; -// return new Result().error(); - } - - - /** - * 处理自定义异常 - * "code": 8000, - * "msg": "服务器开小差了...", - */ - @ExceptionHandler(ValidateException.class) - public Result handleVException(ValidateException ex){ - logger.error(ExceptionUtils.getErrorStackTrace(ex)); - Result result=new Result(); - result.setCode(ex.getCode()); - result.setMsg(ex.getMsg()); - return result; -// return new Result().error(); - } - - /** - * 运行时异常拦截 - * "code": 8000, - * "msg": "服务器开小差了...", - */ - @ExceptionHandler(RuntimeException.class) - public Result handleRuntimeException(RuntimeException ex){ - logger.error(ExceptionUtils.getErrorStackTrace(ex)); - Result result=new Result().error(); - result.setData(ex.getMessage()); - return result; -// return new Result().error(); - } - - /** - * 处理自定义异常 - * "code": 10002, - * "msg": "数据库中已存在该记录", - */ - @ExceptionHandler(DuplicateKeyException.class) - public Result handleDuplicateKeyException(DuplicateKeyException ex){ - logger.error(ExceptionUtils.getErrorStackTrace(ex)); - return new Result().error(ErrorCode.DB_RECORD_EXISTS); - } - - /** - * 异常 - * "code": 8000, - * "msg": "服务器开小差了...", - */ - @ExceptionHandler(Exception.class) - public Result handleException(Exception ex){ - logger.error(ExceptionUtils.getErrorStackTrace(ex)); -// saveLog(ex); - Result result=new Result().error(); - result.setData(ex.getMessage()); - return result; -// return new Result().error(); - } - - /** - * 保存异常日志 - */ - private void saveLog(Exception ex){ - SysLogError log = new SysLogError(); - log.setType(LogTypeEnum.ERROR.value()); - log.setModule(moduleConfig.getName()); - - //请求相关信息 - HttpServletRequest request = HttpContextUtils.getHttpServletRequest(); - log.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT)); - log.setRequestUri(request.getRequestURI()); - log.setRequestMethod(request.getMethod()); - log.setIp(IpUtils.getIpAddr(request)); - Map params = HttpContextUtils.getParameterMap(request); - if(MapUtil.isNotEmpty(params)){ - log.setRequestParams(JSON.toJSONString(params)); - } - - //登录用户ID - - log.setCreator(loginUserUtil.getLoginUserId()); - //异常信息 - log.setErrorInfo(ExceptionUtils.getErrorStackTrace(ex)); - - //保存到Redis队列里 - log.setCreateDate(new Date()); - logProducer.saveLog(log); - } -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java deleted file mode 100644 index 4712a5c5a9..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/log/producer/LogProducer.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.epmet.commons.tools.log.producer; - -import com.google.common.util.concurrent.ThreadFactoryBuilder; -import com.epmet.commons.tools.log.BaseLog; -import com.epmet.commons.tools.redis.RedisKeys; -import com.epmet.commons.tools.redis.RedisUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import java.util.concurrent.*; - -/** - * 日志通过redis队列,异步保存到数据库 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Component -public class LogProducer { - @Autowired - private RedisUtils redisUtils; - ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat("log-producer-pool-%d").build(); - ExecutorService pool = new ThreadPoolExecutor(5, 200, 0L,TimeUnit.MILLISECONDS, - new LinkedBlockingQueue<>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); - - /** - * 保存Log到Redis消息队列 - */ - public void saveLog(BaseLog log){ - String key = RedisKeys.getSysLogKey(); - - //异步保存到队列 - pool.execute(() -> redisUtils.leftPush(key, log, RedisUtils.NOT_EXPIRE)); - } -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 716e22a223..d7aa1ca071 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -43,13 +43,6 @@ public class RedisKeys { return rootPrefix.concat("sys:security:user:").concat(String.valueOf(id)); } - /** - * 系统日志Key - */ - public static String getSysLogKey() { - return rootPrefix.concat("sys:log"); - } - /** * 系统资源Key */ diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java index 8d3b0db55f..6ef0f13807 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActModelController.java @@ -8,7 +8,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -55,7 +54,6 @@ public class ActModelController { @PostMapping @ApiOperation("新增模型") - @LogOperation("新增模型") public Result save(@RequestBody ModelDTO dto) throws Exception{ //效验数据 ValidatorUtils.validateEntity(dto); @@ -67,7 +65,6 @@ public class ActModelController { @PostMapping("deploy/{id}") @ApiOperation("部署") - @LogOperation("部署") public Result deploy(@PathVariable("id") String id) { actModelService.deploy(id); return new Result(); @@ -75,14 +72,12 @@ public class ActModelController { @GetMapping("export/{id}") @ApiOperation("导出") - @LogOperation("导出") public void export(@PathVariable("id") String id, @ApiIgnore HttpServletResponse response) { actModelService.export(id, response); } @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") public Result delete(@RequestBody String[] ids) { for(String id : ids) { actModelService.delete(id); @@ -92,7 +87,6 @@ public class ActModelController { @GetMapping("image/{deploymentId}") @ApiOperation(value = "查看流程图", produces="application/octet-stream") - @LogOperation("查看流程图") public void viewDeployImage(@PathVariable("deploymentId") String deploymentId, @ApiIgnore HttpServletResponse response){ actModelService.deployImage(deploymentId, response); } diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java index e317d0f4fc..6615e815f6 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActProcessController.java @@ -8,7 +8,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; @@ -82,7 +81,6 @@ public class ActProcessController { @PostMapping("deploy") @ApiOperation("部署流程文件") - @LogOperation("部署流程文件") @ApiImplicitParam(name = "processFile", value = "流程文件", paramType = "query", dataType="file") public Result deploy(@RequestParam("processFile") MultipartFile file) throws IOException { if (file.isEmpty()) { @@ -95,7 +93,6 @@ public class ActProcessController { } @PutMapping("active/{id}") - @LogOperation("激活流程") public Result active(@PathVariable("id") String id) { actProcessService.active(id); @@ -104,7 +101,6 @@ public class ActProcessController { @PutMapping("suspend/{id}") @ApiOperation("挂起流程") - @LogOperation("挂起流程") public Result suspend(@PathVariable("id") String id) { actProcessService.suspend(id); @@ -113,7 +109,6 @@ public class ActProcessController { @PostMapping("convertToModel/{id}") @ApiOperation("将部署的流程转换为模型") - @LogOperation("将部署的流程转换为模型") public Result convertToModel(@PathVariable("id") String id) throws Exception { actProcessService.convertToModel(id); @@ -122,7 +117,6 @@ public class ActProcessController { @DeleteMapping @ApiOperation("删除流程") - @LogOperation("删除流程") public Result delete(@RequestBody String[] deploymentIds) { for(String deploymentId : deploymentIds) { actProcessService.deleteDeployment(deploymentId); diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java index 6d938406fc..65b7da62f4 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActRunningController.java @@ -8,7 +8,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -53,7 +52,6 @@ public class ActRunningController { @DeleteMapping("{id}") @ApiOperation("删除") - @LogOperation("删除") @ApiImplicitParam(name = "id", value = "ID", paramType = "query", dataType="String") public Result deleteInstance(@PathVariable("id") String id) { actRunningService.delete(id); @@ -62,7 +60,6 @@ public class ActRunningController { @PostMapping("start") @ApiOperation("启动流程实例,依据流程定义KEY,启动流程实例") - @LogOperation("启动流程实例,依据流程定义KEY,启动流程实例") @ApiImplicitParam(name = "key", value = "流程定义标识key", paramType = "query", dataType="String") public Result start(String key){ ProcessInstanceDTO dto = actRunningService.startProcess(key); @@ -71,7 +68,6 @@ public class ActRunningController { @PostMapping("startOfBusinessKey") @ApiOperation("启动流程实例,依据流程定义ID和业务唯一标示启动实例") - @LogOperation("启动流程实例,依据流程定义ID和业务唯一标示启动实例") public Result startOfBusinessKey(@RequestBody ProcessStartDTO processStartDTO){ ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO); return new Result().ok(dto); diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java index c0a9ee2bec..e7fbf44ca1 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/controller/ActTaskController.java @@ -1,6 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.page.PageData; @@ -82,7 +81,6 @@ public class ActTaskController { */ @GetMapping("task/{id}") @ApiOperation("获取任务详情") - @LogOperation("获取任务详情") public Result getTaskById(@PathVariable("id") String id){ TaskDTO task = actTaskService.taskDetail(id); return new Result().ok(task); diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java index 85c0557e31..ae24d55c6f 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/demo/controller/CorrectionController.java @@ -1,6 +1,5 @@ package com.epmet.demo.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -59,7 +58,6 @@ public class CorrectionController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") public Result save(@RequestBody CorrectionDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); @@ -72,7 +70,6 @@ public class CorrectionController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") public Result update(@RequestBody CorrectionDTO dto){ //效验数据 ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); @@ -84,7 +81,6 @@ public class CorrectionController { @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") public Result delete(@RequestBody Long[] ids){ //效验数据 AssertUtils.isArrayEmpty(ids, "id"); @@ -96,7 +92,6 @@ public class CorrectionController { @PostMapping("updateInstanceId") @ApiOperation("更新实例ID") - @LogOperation("更新实例ID") @ApiImplicitParams({ @ApiImplicitParam(name = "businessKey", value = "业务KEY", paramType = "query", required = true, dataType="String"), @ApiImplicitParam(name = "processInstanceId", value = "实例ID", paramType = "query",required = true, dataType="String") diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java index 5c12cd27bf..ecd1b10718 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/controller/ScheduleJobController.java @@ -8,7 +8,6 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; @@ -66,8 +65,7 @@ public class ScheduleJobController { @PostMapping @ApiOperation("保存") - @LogOperation("保存") - public Result save(@RequestBody ScheduleJobDTO dto){ + public Result save(@RequestBody ScheduleJobDTO dto){ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); scheduleJobService.save(dto); @@ -77,8 +75,7 @@ public class ScheduleJobController { @PutMapping @ApiOperation("修改") - @LogOperation("修改") - public Result update(@RequestBody ScheduleJobDTO dto){ + public Result update(@RequestBody ScheduleJobDTO dto){ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); scheduleJobService.update(dto); @@ -88,8 +85,7 @@ public class ScheduleJobController { @DeleteMapping @ApiOperation("删除") - @LogOperation("删除") - public Result delete(@RequestBody Long[] ids){ + public Result delete(@RequestBody Long[] ids){ scheduleJobService.deleteBatch(ids); return new Result(); @@ -97,8 +93,7 @@ public class ScheduleJobController { @PutMapping("/run") @ApiOperation("立即执行") - @LogOperation("立即执行") - public Result run(@RequestBody Long[] ids){ + public Result run(@RequestBody Long[] ids){ scheduleJobService.run(ids); return new Result(); @@ -106,8 +101,7 @@ public class ScheduleJobController { @PutMapping("/pause") @ApiOperation("暂停") - @LogOperation("暂停") - public Result pause(@RequestBody Long[] ids){ + public Result pause(@RequestBody Long[] ids){ scheduleJobService.pause(ids); return new Result(); @@ -115,8 +109,7 @@ public class ScheduleJobController { @PutMapping("/resume") @ApiOperation("恢复") - @LogOperation("恢复") - public Result resume(@RequestBody Long[] ids){ + public Result resume(@RequestBody Long[] ids){ scheduleJobService.resume(ids); return new Result(); diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java index 550a83c112..56fd837daf 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/MailTemplateController.java @@ -9,7 +9,6 @@ package com.epmet.controller; import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.annotation.LogOperation; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 04889584db..23751d3b87 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -249,6 +249,7 @@ public class OssController { } } Result result = ossService.uploadImg(file, null); + long start = System.currentTimeMillis(); if (result != null && result.success() ){ UploadImgResultDTO data = result.getData(); if ( data!= null && StringUtils.isNotBlank(data.getUrl())){ @@ -260,6 +261,7 @@ public class OssController { redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } + log.info("service setRedis:{}",System.currentTimeMillis()-start); return result; } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index eb38a6520a..c39c9b5b47 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -69,9 +69,14 @@ public class OssServiceImpl extends BaseServiceImpl implement String extension = FilenameUtils.getExtension(file.getOriginalFilename()); String url = null; String ossDomain = null; + long start = System.currentTimeMillis(); try { + AbstractCloudStorageService storageService = OssFactory.build(); + logger.info("build service:{}",System.currentTimeMillis()-start); + start = System.currentTimeMillis(); url = storageService.uploadSuffix(file.getBytes(), extension, privacy); + logger.info("service uploadSuffix:{}",System.currentTimeMillis()-start); ossDomain = storageService.getOssDomain(privacy); } catch (IOException e) { logger.error("图片上传异常", e); @@ -82,7 +87,9 @@ public class OssServiceImpl extends BaseServiceImpl implement OssEntity ossEntity = new OssEntity(); ossEntity.setUrl(url); + start = System.currentTimeMillis(); baseDao.insert(ossEntity); + logger.info("service insert:{}",System.currentTimeMillis()-start); //文件信息 UploadImgResultDTO dto = new UploadImgResultDTO(); dto.setUrl(url); From 568c600c90fcda91dc7f10de0ae87a978d2554c4 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 15:20:27 +0800 Subject: [PATCH 60/63] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BD=BF=E7=94=A8@Before=E6=B3=A8=E8=A7=A3->=E8=BF=98=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E4=BC=98=E5=8C=96=20=E6=9C=AC=E5=9C=B0=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E8=A7=A3=E5=86=B3=E4=B8=8D=E4=BA=86=20=E5=88=86?= =?UTF-8?q?=E5=B8=83=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/aop/NoRepeatSubmitAop.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java index f887dd1aab..7dfbd88a75 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java @@ -6,9 +6,10 @@ import com.epmet.commons.tools.exception.RenException; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; import lombok.extern.slf4j.Slf4j; -import org.aspectj.lang.ProceedingJoinPoint; -import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Before; +import org.aspectj.lang.annotation.Pointcut; import org.springframework.context.annotation.Configuration; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -32,13 +33,18 @@ public class NoRepeatSubmitAop { */ private static final Cache CACHES = CacheBuilder.newBuilder() // 最大缓存 100 个 - .maximumSize(1000) + .maximumSize(100) // 设置写缓存后 5 秒钟过期 .expireAfterWrite(5, TimeUnit.SECONDS) .build(); - @Around("execution(public * com.epmet..*Controller.*(..)) && @annotation(com.epmet.commons.tools.aop.NoRepeatSubmit)") - public Object around(ProceedingJoinPoint pjp) { + @Pointcut("@annotation(com.epmet.commons.tools.aop.NoRepeatSubmit)") + public void doAspect() { + + } + + @Before("doAspect()") + public void around(JoinPoint pjp) { try { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); assert attributes != null; @@ -46,9 +52,7 @@ public class NoRepeatSubmitAop { String key = getKey(request.getRequestURI(), pjp.getArgs()); // 如果缓存中有这个url视为重复提交 if (CACHES.getIfPresent(key) == null) { - Object o = pjp.proceed(); CACHES.put(key, NumConstant.ZERO); - return o; } else { log.error("重复提交"); throw new RenException(EpmetErrorCode.REPEATED_SUBMIT_ERROR.getCode()); @@ -59,7 +63,6 @@ public class NoRepeatSubmitAop { log.error("验证重复提交时出现未知异常!"); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } - } private String getKey(String keyExpress, Object[] args) { From 7d0333004a11360c55dc42a8f4ff631cea90349b Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 31 Mar 2021 16:22:11 +0800 Subject: [PATCH 61/63] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=84=E4=BB=B7?= =?UTF-8?q?=E5=91=A8=E6=9C=9F=E5=86=85=E8=A2=AB=E5=90=B9=E5=93=A8=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E6=95=B0=E4=B8=8E=E8=AF=84=E4=BB=B7=E5=91=A8=E6=9C=9F?= =?UTF-8?q?=E5=86=85=E8=A2=AB=E5=8A=9E=E7=BB=93=E9=A1=B9=E7=9B=AE=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E7=AE=97=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectLogDailyDao.xml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 0fe89ad0e9..1d5b5c6e79 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -165,7 +165,7 @@ AGENCY_ID, COUNT(DISTINCT PROJECT_ID) AS count FROM - fact_origin_project_log_daily + fact_origin_project_log_daily log WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} AND IS_ACTIVE = '0' @@ -173,13 +173,14 @@ AND MONTH_ID = #{dimId} AND NOT EXISTS( SELECT ID - FROM fact_origin_project_log_daily + FROM fact_origin_project_log_daily innerLog WHERE DEL_FLAG = '0' AND MONTH_ID #{dimId} AND IS_ACTIVE = '0' + AND log.project_id = innerLog.project_id - AGENCY_ID = #{agencyId} + innerLog.AGENCY_ID = #{agencyId} ) @@ -204,13 +205,10 @@ AND log.MONTH_ID = #{dimId} AND EXISTS ( - select id from fact_origin_project_log_daily where del_flag = '0' - and customer_id = #{customerId} and month_id = #{dimId} - and action_code like 'close%' - - - AGENCY_ID = #{agencyId} - + select innerLog.id from fact_origin_project_log_daily innerLog where innerLog.del_flag = '0' + and innerLog.customer_id = #{customerId} and innerLog.month_id = #{dimId} + and innerLog.action_code like 'close%' + and innerLog.project_id = log.project_id ) From 7f22d27e2b18ed922fe69ee14f211705f7a1f1f0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 16:31:48 +0800 Subject: [PATCH 62/63] =?UTF-8?q?=E5=8D=87=E7=BA=A7aliyun-sdk-oss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet-oss/epmet-oss-server/pom.xml | 8 +------- .../cloud/AliyunCloudStorageService.java | 20 +++++++++---------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index a29c4474cc..2264f855e4 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -14,8 +14,7 @@ 7.2.22 - 2.8.3 - 3.2.2 + 3.10.2 5.4.4 1.26.2 @@ -82,11 +81,6 @@ - - com.aliyun - aliyun-java-sdk-core - ${aliyun.core.version} - com.github.tobato fastdfs-client diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index d270023543..c1865d8234 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -8,7 +8,9 @@ package com.epmet.cloud; +import com.aliyun.oss.OSS; import com.aliyun.oss.OSSClient; +import com.aliyun.oss.OSSClientBuilder; import com.aliyun.oss.model.DownloadFileRequest; import com.aliyun.oss.model.DownloadFileResult; import com.epmet.commons.tools.exception.RenException; @@ -26,12 +28,8 @@ import java.io.InputStream; */ public class AliyunCloudStorageService extends AbstractCloudStorageService { - private OSSClient internalClient = null; - private OSSClient externalClient = null; - - { - - } + private OSS internalClient = null; + private OSS externalClient = null; public AliyunCloudStorageService(CloudStorageConfig config){ this.config = config; @@ -43,11 +41,11 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { * @author wxz * @date 2021.01.04 13:49 */ - public OSSClient getOssClient(String privacyType) { + public OSS getOssClient(String privacyType) { if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) { if (internalClient == null){ CloudStorageConfig.AliyunCloudStorageConfigProps props = config.getAliyun().getInternal(); - internalClient = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + internalClient = new OSSClientBuilder().build(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), props.getAliyunAccessKeySecret()); } return internalClient; @@ -100,7 +98,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public String upload(InputStream inputStream, String path, String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = getOssClient(privacyType); + OSS client = getOssClient(privacyType); try { client.putObject(props.getAliyunBucketName(), path, inputStream); //client.shutdown(); @@ -114,7 +112,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public boolean delete(String objectName,String privacyType) { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = getOssClient(privacyType); + OSS client = getOssClient(privacyType); try { client.deleteObject(props.getAliyunBucketName(), objectName); //client.shutdown(); @@ -140,7 +138,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { @Override public void down(String privacyType) throws IOException { CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); - OSSClient client = getOssClient(privacyType); + OSS client = getOssClient(privacyType); try { /* From d798d0fcd38b7a25d11b6d9259fc70749dbf2f16 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 31 Mar 2021 17:24:47 +0800 Subject: [PATCH 63/63] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/controller/OssController.java | 2 -- .../main/java/com/epmet/service/impl/OssServiceImpl.java | 6 ------ 2 files changed, 8 deletions(-) diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 23751d3b87..04889584db 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -249,7 +249,6 @@ public class OssController { } } Result result = ossService.uploadImg(file, null); - long start = System.currentTimeMillis(); if (result != null && result.success() ){ UploadImgResultDTO data = result.getData(); if ( data!= null && StringUtils.isNotBlank(data.getUrl())){ @@ -261,7 +260,6 @@ public class OssController { redisUtils.set(RedisKeys.getOssFileKey(fileName),path,RedisUtils.MINUTE_THIRTY_EXPIRE); } } - log.info("service setRedis:{}",System.currentTimeMillis()-start); return result; } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index c39c9b5b47..6e9e8e2d90 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -69,14 +69,10 @@ public class OssServiceImpl extends BaseServiceImpl implement String extension = FilenameUtils.getExtension(file.getOriginalFilename()); String url = null; String ossDomain = null; - long start = System.currentTimeMillis(); try { AbstractCloudStorageService storageService = OssFactory.build(); - logger.info("build service:{}",System.currentTimeMillis()-start); - start = System.currentTimeMillis(); url = storageService.uploadSuffix(file.getBytes(), extension, privacy); - logger.info("service uploadSuffix:{}",System.currentTimeMillis()-start); ossDomain = storageService.getOssDomain(privacy); } catch (IOException e) { logger.error("图片上传异常", e); @@ -87,9 +83,7 @@ public class OssServiceImpl extends BaseServiceImpl implement OssEntity ossEntity = new OssEntity(); ossEntity.setUrl(url); - start = System.currentTimeMillis(); baseDao.insert(ossEntity); - logger.info("service insert:{}",System.currentTimeMillis()-start); //文件信息 UploadImgResultDTO dto = new UploadImgResultDTO(); dto.setUrl(url);