From c518d4b5d816a515b6c811c75b2ed639b4d1f595 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 23 Aug 2022 10:43:48 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/AddSocietyOrgFormDTO.java | 9 +++++++-- .../com/epmet/dto/form/EditSocietyOrgFormDTO.java | 9 ++++++++- .../dto/result/GetListSocietyOrgResultDTO.java | 4 ++++ .../epmet/dto/result/SocietyOrgListResultDTO.java | 4 ++++ .../java/com/epmet/entity/IcSocietyOrgEntity.java | 4 ++++ .../epmet/service/impl/IcSocietyOrgServiceImpl.java | 13 +++++++++++-- .../src/main/resources/mapper/IcSocietyOrgDao.xml | 3 ++- 7 files changed, 40 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java index 1217c647c5..3473fde8c0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java @@ -23,6 +23,7 @@ import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; @@ -48,6 +49,11 @@ public class AddSocietyOrgFormDTO implements Serializable { * agency_id的所有上级 */ private String pids; + /** + * 社会组织头像 + */ + @NotEmpty(message = "组织头像不能为空", groups = { AddSocietyOrgFormDTO.Add.class}) + private String[] imageList; /** * 社会组织名称 */ @@ -87,7 +93,6 @@ public class AddSocietyOrgFormDTO implements Serializable { /** * 绑定管理员[组织下录入的工作人员] */ - @NotBlank(message = "绑定管理员名称不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) private String adminStaffId; /** * 地址 @@ -106,4 +111,4 @@ public class AddSocietyOrgFormDTO implements Serializable { public interface Add extends CustomerClientShowGroup {} -} \ No newline at end of file +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java index 2acad633c0..044d8ae3f0 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java @@ -22,6 +22,7 @@ import lombok.Data; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.util.Date; @@ -40,6 +41,12 @@ public class EditSocietyOrgFormDTO implements Serializable { */ @NotBlank(message = "社会组织Id不能为空", groups = { Edit.class, Del.class }) private String societyId; + + /** + * 社会组织头像 + */ + @NotEmpty(message = "组织头像不能为空", groups = { Edit.class}) + private String[] imageList; /** * 社会组织名称 */ @@ -92,4 +99,4 @@ public class EditSocietyOrgFormDTO implements Serializable { public interface Edit {} public interface Del {} -} \ No newline at end of file +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java index 0130b246a7..0edc99c42f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java @@ -44,6 +44,10 @@ public class GetListSocietyOrgResultDTO implements Serializable { private String agencyId; //社会组织Id private String societyId; + /** + * 社会组织头像 + */ + private String imgUrl; //社会组织名称 private String societyName; //服务事项 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java index 38a081d2bc..b5ed492b5d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java @@ -35,6 +35,10 @@ public class SocietyOrgListResultDTO implements Serializable { private String agencyName; //社会组织Id private String societyId; + /** + * 图像 + */ + private String imgUrl; //社会组织名称 private String societyName; //服务事项 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java index 7c6dcc0316..cc694cd625 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java @@ -87,6 +87,10 @@ public class IcSocietyOrgEntity extends BaseEpmetEntity { */ private String adminStaffId; + /** + * 地址 + */ + private String imgUrl; /** * 地址 */ diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java index 6542740821..08725a6a1c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -80,6 +80,10 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl%s", formDTO.getSocietyId())); } + //图片必填 + if(formDTO.getImageList() != null&& StringUtils.isNotBlank(formDTO.getImageList()[0])){ + entity.setImgUrl(formDTO.getImageList()[0]); + } entity = ConvertUtils.sourceToTarget(formDTO, IcSocietyOrgEntity.class); entity.setId(formDTO.getSocietyId()); baseDao.updateById(entity); @@ -115,7 +123,8 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl - \ No newline at end of file + From 98144e3d0e3143f911ba796e24f9ed3c933fe46f Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 23 Aug 2022 17:21:37 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AC=AC=E4=BA=8C=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/AddSocietyOrgFormDTO.java | 8 +++++--- .../java/com/epmet/dto/form/EditSocietyOrgFormDTO.java | 6 ++++++ .../com/epmet/dto/result/GetListSocietyOrgResultDTO.java | 4 ++++ .../com/epmet/dto/result/SocietyOrgListResultDTO.java | 4 ++++ .../main/java/com/epmet/entity/IcSocietyOrgEntity.java | 5 +++++ .../com/epmet/service/impl/IcSocietyOrgServiceImpl.java | 4 +++- .../src/main/resources/mapper/IcSocietyOrgDao.xml | 1 + 7 files changed, 28 insertions(+), 4 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java index 3473fde8c0..391652762d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java @@ -24,7 +24,6 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; @@ -78,16 +77,19 @@ public class AddSocietyOrgFormDTO implements Serializable { @NotBlank(message = "负责人电话不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) @Length(max = 11, message = "负责人电话不能超过11个字符",groups = {Add.class}) private String mobile; + /** + * 服务时间 + */ + @NotBlank(message = "服务时间不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + private String serviceTimeStr; /** * 起始服务时间 */ - @NotNull(message = "起始服务时间不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date serviceStartTime; /** * 终止服务时间 */ - @NotNull(message = "终止服务时间不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date serviceEndTime; /** diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java index 044d8ae3f0..4dfe1df9b2 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java @@ -67,6 +67,12 @@ public class EditSocietyOrgFormDTO implements Serializable { */ @Length(max = 11, message = "负责人电话不能超过11个字符",groups = {Edit.class}) private String mobile; + + /** + * 服务时间 + */ + @NotBlank(message = "服务时间不能为空",groups = {Edit.class}) + private String serviceTimeStr; /** * 起始服务时间 */ diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java index 0edc99c42f..08404eff6d 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java @@ -56,6 +56,10 @@ public class GetListSocietyOrgResultDTO implements Serializable { private String personInCharge; //负责人电话 private String mobile; + /** + * 服务时间 + */ + private String serviceTimeStr; //起始服务时间 @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date serviceStartTime; diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java index b5ed492b5d..2d77374893 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java @@ -47,6 +47,10 @@ public class SocietyOrgListResultDTO implements Serializable { private String personInCharge; //负责人电话 private String mobile; + /** + * 服务时间 + */ + private String serviceTimeStr; //起始服务时间 //@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //private Date serviceStartTime; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java index cc694cd625..20cd08c3b1 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java @@ -73,6 +73,11 @@ public class IcSocietyOrgEntity extends BaseEpmetEntity { private String mobile; /** + * 服务时间 + */ + private String serviceTimeStr; + + /** * 起始服务时间 */ private Date serviceStartTime; diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java index 08725a6a1c..800d2e447c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -131,7 +131,9 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml index 9ac12b6b1a..4939225de6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml @@ -12,6 +12,7 @@ service_matters serviceMatters, person_in_charge personInCharge, mobile mobile, + service_time_str, service_start_time serviceStartTime, service_end_time serviceEndTime, admin_staff_id adminStaffId, From 7694d3e9afd85bd5ce08acc58bab062139ce0c69 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Aug 2022 09:42:56 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/IcSocietyOrgDTO.java | 39 +++++-------------- .../controller/IcSocietyOrgController.java | 11 ++++++ .../com/epmet/entity/IcSocietyOrgEntity.java | 2 +- 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java index f0304874e5..8b1d9f8a57 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcSocietyOrgDTO.java @@ -39,6 +39,11 @@ public class IcSocietyOrgDTO implements Serializable { */ private String id; + /** + * 图片地址 + */ + private String imgUrl; + /** * 客户Id */ @@ -74,6 +79,11 @@ public class IcSocietyOrgDTO implements Serializable { */ private String mobile; + /** + * 服务时间 + */ + private String serviceTimeStr; + /** * 起始服务时间 */ @@ -109,34 +119,5 @@ public class IcSocietyOrgDTO implements Serializable { */ private String remarks; - /** - * 删除标识:0.未删除 1.已删除 - */ - private Integer delFlag; - - /** - * 乐观锁 - */ - private Integer revision; - - /** - * 创建人 - */ - private String createdBy; - - /** - * 创建时间 - */ - private Date createdTime; - - /** - * 更新人 - */ - private String updatedBy; - - /** - * 更新时间 - */ - private Date updatedTime; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java index 2b07959e33..831fc62b3c 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.utils.ExcelPoiUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.IcSocietyOrgDTO; import com.epmet.dto.form.AddSocietyOrgFormDTO; import com.epmet.dto.form.EditSocietyOrgFormDTO; import com.epmet.dto.form.GetListSocietyOrgFormDTO; @@ -87,6 +88,16 @@ public class IcSocietyOrgController { return new Result(); } + /** + * @Author sun + * @Description 删除社会组织 + **/ + @RequestMapping("detail/{id}") + public Result detail(@LoginUser TokenDto tokenDto, @PathVariable(value = "id") String id) { + IcSocietyOrgDTO icSocietyOrgDTO = societyOrgService.get(id); + return new Result().ok(icSocietyOrgDTO); + } + /** * @Author sun * @Description 删除社会组织 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java index 20cd08c3b1..f97113dd58 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcSocietyOrgEntity.java @@ -93,7 +93,7 @@ public class IcSocietyOrgEntity extends BaseEpmetEntity { private String adminStaffId; /** - * 地址 + * 图片地址 */ private String imgUrl; /** From 06fc4b5c76ef5898a1f0b3217bd6e22dc5746c3d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 24 Aug 2022 10:03:19 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=A8=A1=E6=9D=BF=E3=80=81=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IcSocietyOrgController.java | 82 ++++++++++++++++-- .../com/epmet/excel/IcSocietyOrgExcel.java | 27 ++---- .../epmet/excel/IcSocietyOrgExportExcel.java | 42 +++++++++ .../service/impl/IcSocietyOrgServiceImpl.java | 72 ++++++++------- .../templates/societyorg_import_template.xlsx | Bin 0 -> 8953 bytes 5 files changed, 164 insertions(+), 59 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExportExcel.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/societyorg_import_template.xlsx diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java index 2b07959e33..ca877fda19 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -18,13 +18,17 @@ package com.epmet.controller; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelWriter; +import com.alibaba.excel.write.metadata.WriteSheet; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.ExcelPoiUtils; -import com.epmet.commons.tools.utils.ExcelUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.AddSocietyOrgFormDTO; import com.epmet.dto.form.EditSocietyOrgFormDTO; @@ -33,18 +37,26 @@ import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.GetListSocietyOrgResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.excel.IcSocietyOrgExcel; +import com.epmet.excel.IcSocietyOrgExportExcel; import com.epmet.service.IcSocietyOrgService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.IOUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; +import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.net.URLEncoder; import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -129,11 +141,46 @@ public class IcSocietyOrgController { **/ @PostMapping("export") public void export(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO, HttpServletResponse response) throws Exception { + //废弃原来的导出 + // formDTO.setCustomerId(tokenDto.getCustomerId()); + // formDTO.setStaffId(tokenDto.getUserId()); + // formDTO.setIsPage(false); + // GetListSocietyOrgResultDTO list = societyOrgService.getList(formDTO); + // ExcelUtils.exportExcelToTarget(response, null, list.getList(), IcSocietyOrgExportExcel.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setStaffId(tokenDto.getUserId()); formDTO.setIsPage(false); - GetListSocietyOrgResultDTO list = societyOrgService.getList(formDTO); - ExcelUtils.exportExcelToTarget(response, null, list.getList(), IcSocietyOrgExcel.class); + ExcelWriter excelWriter = null; + formDTO.setPageNo(NumConstant.ONE); + formDTO.setPageSize(NumConstant.TEN_THOUSAND); + try { + String fileName = "社会组织" + DateUtils.format(new Date()) + ".xlsx"; + excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(fileName, response), IcSocietyOrgExportExcel.class).build(); + WriteSheet writeSheet = EasyExcel.writerSheet("Sheet1").registerWriteHandler(new FreezeAndFilter()).build(); + GetListSocietyOrgResultDTO data = null; + List list = null; + do { + data = societyOrgService.getList(formDTO); + list = ConvertUtils.sourceToTarget(data.getList(), IcSocietyOrgExportExcel.class); + formDTO.setPageNo(formDTO.getPageNo() + NumConstant.ONE); + excelWriter.write(list, writeSheet); + } while (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list) && list.size() == formDTO.getPageSize()); + } catch (EpmetException e) { + response.reset(); + response.setCharacterEncoding("UTF-8"); + response.setHeader("content-type", "application/json; charset=UTF-8"); + PrintWriter printWriter = response.getWriter(); + Result result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg()); + printWriter.write(JSON.toJSONString(result)); + printWriter.close(); + } catch (Exception e) { + log.error("社会组织export exception", e); + } finally { + if (excelWriter != null) { + excelWriter.finish(); + } + } } /** @@ -168,4 +215,29 @@ public class IcSocietyOrgController { return new Result().ok(str); } + + /** + * 下载社会组织导入模板 + * @param response + * @throws IOException + */ + @RequestMapping(value = "import-template-download", method = {RequestMethod.GET, RequestMethod.POST}) + public void downloadTemplate(HttpServletResponse response) throws IOException { + response.setCharacterEncoding("UTF-8"); + response.addHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, "Content-Disposition"); + response.setHeader(HttpHeaders.CONTENT_TYPE, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename=" + URLEncoder.encode("社区组织导入模板", "UTF-8") + ".xlsx"); + + InputStream is = this.getClass().getClassLoader().getResourceAsStream("templates/societyorg_import_template.xlsx"); + try { + ServletOutputStream os = response.getOutputStream(); + IOUtils.copy(is, os); + } finally { + if (is != null) { + is.close(); + } + } + } + + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java index c4392b5e5a..e48c6cb6d6 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java @@ -34,37 +34,28 @@ import java.io.Serializable; @Data public class IcSocietyOrgExcel extends ExcelVerifyInfo implements Serializable { - @Excel(name = "组织名称") + @Excel(name = "所属组织") @NotBlank(message = "不能为空") private String agencyName; - @Excel(name = "社会组织名称") + @Excel(name = "组织名称") @NotBlank(message = "不能为空") @Length(max=50,message = "不能超过50个字") private String societyName; - @Excel(name = "服务事项") + @Excel(name = "服务内容") @NotBlank(message = "不能为空") @Length(max=1000,message = "不能超过1000个字") private String serviceMatters; - @Excel(name = "负责人") - @NotBlank(message = "不能为空") - @Length(max=20,message = "不能超过20个字") - private String personInCharge; - - @Excel(name = "负责人电话") + @Excel(name = "服务电话") @NotBlank(message = "不能为空") @Length(max=11,message = "不能超过11个字") private String mobile; - @Excel(name = "起始服务时间") + @Excel(name = "服务时间") @NotBlank(message = "不能为空") - private String serviceStartTime; - - @Excel(name = "终止服务时间") - @NotBlank(message = "不能为空") - private String serviceEndTime; + private String serviceTimeStr; @Excel(name = "管理员姓名") private String adminStaffName; @@ -72,10 +63,4 @@ public class IcSocietyOrgExcel extends ExcelVerifyInfo implements Serializable { @Excel(name = "地址") private String address; - @Excel(name = "经度") - private String longitude; - - @Excel(name = "维度") - private String latitude; - } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExportExcel.java new file mode 100644 index 0000000000..bf914d42d6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExportExcel.java @@ -0,0 +1,42 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +/** + * @Description + * @Author yzm + * @Date 2022/8/24 8:41 + */ +@Data +public class IcSocietyOrgExportExcel { + @ExcelProperty(value = "所属组织") + @ColumnWidth(30) + private String agencyName; + + @ExcelProperty(value = "组织名称") + @ColumnWidth(30) + private String societyName; + + @ColumnWidth(50) + @ExcelProperty(value = "服务内容") + private String serviceMatters; + + @ColumnWidth(20) + @ExcelProperty(value = "服务电话") + private String mobile; + + @ColumnWidth(20) + @ExcelProperty(value = "服务时间") + private String serviceTimeStr; + + @ColumnWidth(20) + @ExcelProperty(value = "管理员姓名") + private String adminStaffName; + + @ColumnWidth(30) + @ExcelProperty(value = "地址") + private String address; +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java index 800d2e447c..16e1cee8f4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -43,6 +43,7 @@ import com.epmet.service.IcSocietyOrgService; import com.epmet.service.IcUserDemandRecService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -52,7 +53,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.text.ParseException; -import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -232,53 +232,59 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl map=new HashMap<>(); //2.查询绑定的管理员信息 - Set staffNames = list.stream().map(item -> item.getAdminStaffName().trim()).collect(Collectors.toSet()); - GetByRealNamesFormDTO dto = new GetByRealNamesFormDTO(); - dto.setCustomerId(customerId); - dto.setRealNames(staffNames); - Result> staffResult = epmetUserOpenFeignClient.getByRealNames(dto); - if (!staffResult.success()) { - throw new RenException("获取工作人员基础信息失败......"); - } - if (null == staffResult.getData()) { - Iterator iter = list.iterator(); - while (iter.hasNext()) { - IcSocietyOrgExcel obj = iter.next(); - numList.add(obj.getRowNum()); - iterator.remove(); + Set staffNames = list.stream().filter(t -> StringUtils.isNotBlank(t.getAdminStaffName())).map(item -> item.getAdminStaffName().trim()).collect(Collectors.toSet()); + if(!CollectionUtils.isEmpty(staffNames)){ + GetByRealNamesFormDTO dto = new GetByRealNamesFormDTO(); + dto.setCustomerId(customerId); + dto.setRealNames(staffNames); + Result> staffResult = epmetUserOpenFeignClient.getByRealNames(dto); + if (!staffResult.success()) { + throw new RenException("获取工作人员基础信息失败......"); } - return numList; + if (null == staffResult.getData()) { + Iterator iter = list.iterator(); + while (iter.hasNext()) { + IcSocietyOrgExcel obj = iter.next(); + numList.add(obj.getRowNum()); + iterator.remove(); + } + return numList; + } + map= staffResult.getData().stream().collect(Collectors.toMap(CustomerStaffDTO::getRealName, CustomerStaffDTO::getUserId)); } - Map map = staffResult.getData().stream().collect(Collectors.toMap(CustomerStaffDTO::getRealName, CustomerStaffDTO::getUserId)); //3.遍历封装有效数据 List houseEntityList = new ArrayList<>(); Iterator iterator1 = list.iterator(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); while (iterator1.hasNext()) { - IcSocietyOrgExcel icHouseExcel = iterator1.next(); + IcSocietyOrgExcel icSocietyOrgExcel = iterator1.next(); IcSocietyOrgEntity entity = new IcSocietyOrgEntity(); entity.setCustomerId(customerId); entity.setAgencyId(staffInfoCache.getAgencyId()); entity.setPids(staffInfoCache.getAgencyPIds()); - entity.setSocietyName(icHouseExcel.getSocietyName()); - entity.setServiceMatters(icHouseExcel.getServiceMatters()); - entity.setPersonInCharge(icHouseExcel.getPersonInCharge()); - entity.setMobile(icHouseExcel.getMobile()); - entity.setServiceStartTime(sdf.parse(icHouseExcel.getServiceStartTime())); - entity.setServiceEndTime(sdf.parse(icHouseExcel.getServiceEndTime())); - entity.setAdminStaffId(map.containsKey(icHouseExcel.getAdminStaffName().trim()) ? map.get(icHouseExcel.getAdminStaffName().trim()) : ""); - if ("".equals(entity.getAdminStaffId())) { - numList.add(icHouseExcel.getRowNum()); - log.warn(String.format("绑定的管理员不存在,管理员名称->%s,行号->%s", icHouseExcel.getAdminStaffName(), icHouseExcel.getRowNum())); + entity.setSocietyName(icSocietyOrgExcel.getSocietyName()); + entity.setServiceMatters(icSocietyOrgExcel.getServiceMatters()); + //负责人去掉 + // entity.setPersonInCharge(icSocietyOrgExcel.getPersonInCharge()); + entity.setMobile(icSocietyOrgExcel.getMobile()); + //服务时间手动输入 + entity.setServiceTimeStr(icSocietyOrgExcel.getServiceTimeStr()); + // entity.setServiceStartTime(sdf.parse(icHouseExcel.getServiceStartTime())); + // entity.setServiceEndTime(sdf.parse(icHouseExcel.getServiceEndTime())); + entity.setAdminStaffId(MapUtils.isNotEmpty(map)&&map.containsKey(icSocietyOrgExcel.getAdminStaffName().trim()) ? map.get(icSocietyOrgExcel.getAdminStaffName().trim()) : ""); + if (StringUtils.isBlank(entity.getAdminStaffId())) { + numList.add(icSocietyOrgExcel.getRowNum()); + log.warn(String.format("绑定的管理员不存在,管理员名称->%s,行号->%s", icSocietyOrgExcel.getAdminStaffName(), icSocietyOrgExcel.getRowNum())); iterator1.remove(); continue; } - entity.setAddress(icHouseExcel.getAddress()); - entity.setLongitude(icHouseExcel.getLongitude()); - entity.setLatitude(icHouseExcel.getLatitude()); + entity.setAddress(icSocietyOrgExcel.getAddress()); + //经纬度不能导入 + // entity.setLongitude(icHouseExcel.getLongitude()); + // entity.setLatitude(icHouseExcel.getLatitude()); houseEntityList.add(entity); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/societyorg_import_template.xlsx b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/societyorg_import_template.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..5d02dae502b5326319fb9578a340a4d624c0fea2 GIT binary patch literal 8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PN< z%T`rJIr=n>(|0RWz9Q-`ZE>rLl0wkIaTHN1O-|e1%C-nNYU`ZSo8H`}en;8apbf9*+um(L*}? zCu9B@^l1rt^!Xih_%EMdDf8cgJt_ph$78U^@i%4upYfh*^N+^ABL z0`+vEPb=ADoZl#s693KZf7P|8^E~Z<{>;Pjpill=KlF5lr>x$e8B!lezQ-B<;`sjm z@7)sam+OBNrGGvlPc@}K5u^U@_D5lQy5y(b%%2G~A7rYBCI20^|F-Byx%c;Y++nBR uJN)SUm-ze7l|Pk#AANuCTE_qK{UZh|%EJ6gR*Z-Lrht2}`~K|F@BaWR=w|`| literal 0 HcmV?d00001 From 2d36e077aae02f484d5c29dd34b8e6917c96c69c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 24 Aug 2022 11:06:06 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=9C=AA=E5=AE=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/constants/ImportTaskConstants.java | 5 + .../controller/IcSocietyOrgController.java | 76 ++++++++++- .../excel/IcSocietyOrgImportExcelDTO.java | 75 +++++++++++ .../epmet/service/IcSocietyOrgService.java | 10 ++ .../service/impl/IcSocietyOrgServiceImpl.java | 120 +++++++++++++++++- .../templates/societyorg_import_template.xlsx | Bin 8953 -> 8928 bytes 6 files changed, 276 insertions(+), 10 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgImportExcelDTO.java diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java index 2108042cd6..705b037699 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java @@ -62,4 +62,9 @@ public interface ImportTaskConstants { * 城市管理 */ String IC_CITY_MANAGEMENT = "ic_city_management"; + + /** + * 社会组织 + */ + String IC_SOCIETY_ORG="ic_society_org"; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java index b08541a972..8c30990fc9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -23,22 +23,30 @@ import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dto.IcSocietyOrgDTO; import com.epmet.dto.form.AddSocietyOrgFormDTO; import com.epmet.dto.form.EditSocietyOrgFormDTO; import com.epmet.dto.form.GetListSocietyOrgFormDTO; +import com.epmet.dto.form.ImportTaskCommonFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.result.GetListSocietyOrgResultDTO; +import com.epmet.dto.result.ImportTaskCommonResultDTO; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.excel.IcSocietyOrgExcel; import com.epmet.excel.IcSocietyOrgExportExcel; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcSocietyOrgService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; @@ -50,15 +58,14 @@ import org.springframework.web.multipart.MultipartFile; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletResponse; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.net.URLEncoder; +import java.nio.file.Path; import java.text.ParseException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; +import java.util.*; import java.util.stream.Collectors; @@ -71,11 +78,12 @@ import java.util.stream.Collectors; @Slf4j @RestController @RequestMapping("societyorg") -public class IcSocietyOrgController { +public class IcSocietyOrgController implements ResultDataResolver { @Autowired private IcSocietyOrgService societyOrgService; - + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; /** * @Author sun * @Description 新增社会组织 @@ -195,6 +203,7 @@ public class IcSocietyOrgController { } /** + * 废弃此方法用下面的importV2 * @Author sun * @Description 九小场所下组织列表导入 **/ @@ -250,5 +259,60 @@ public class IcSocietyOrgController { } } + /** + * + * @param tokenDto + * @param file + * @return + */ + @PostMapping("importV2") + public Result importExcelV2(@LoginUser TokenDto tokenDto, @RequestPart("file") MultipartFile file) { + String userId = EpmetRequestHolder.getHeader(AppClientConstant.USER_ID); + + // 1.暂存文件 + String originalFilename = file.getOriginalFilename(); + String extName = originalFilename.substring(originalFilename.lastIndexOf(".")); + + Path fileSavePath; + try { + Path importPath = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_society_org", "import"); + fileSavePath = importPath.resolve(UUID.randomUUID().toString().concat(extName)); + } catch (IOException e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【社会组织】创建临时存储文件失败:{}", errorMsg); + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社会组织导入文件上传失败", "社会组织导入文件上传失败"); + } + + InputStream is = null; + FileOutputStream os = null; + + try { + is = file.getInputStream(); + os = new FileOutputStream(fileSavePath.toString()); + IOUtils.copy(is, os); + } catch (Exception e) { + log.error("【社会组织】导入method exception", e); + } finally { + org.apache.poi.util.IOUtils.closeQuietly(is); + org.apache.poi.util.IOUtils.closeQuietly(os); + } + + // 2.生成导入任务记录 + ImportTaskCommonFormDTO importTaskForm = new ImportTaskCommonFormDTO(); + importTaskForm.setOperatorId(userId); + importTaskForm.setBizType(ImportTaskConstants.IC_SOCIETY_ORG); + importTaskForm.setOriginFileName(originalFilename); + + ImportTaskCommonResultDTO rstData = getResultDataOrThrowsException(commonServiceOpenFeignClient.createImportTask(importTaskForm), + ServiceConstant.EPMET_COMMON_SERVICE, + EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), + "excel导入社会组织错误", + "社会组织导入失败"); + + // 3.执行导入 + societyOrgService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),tokenDto.getCustomerId(),tokenDto.getUserId()); + return new Result(); + } + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgImportExcelDTO.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgImportExcelDTO.java new file mode 100644 index 0000000000..284f6d024d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgImportExcelDTO.java @@ -0,0 +1,75 @@ +package com.epmet.excel; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; + +/** + * @Description + * @Author yzm + * @Date 2022/8/24 10:46 + */ +@Data +public class IcSocietyOrgImportExcelDTO { + + @ExcelProperty(value = "组织名称") + @NotBlank(message = "不能为空") + @Length(max=50,message = "不能超过50个字") + private String societyName; + + @ExcelProperty(value = "服务内容") + @NotBlank(message = "不能为空") + @Length(max=1000,message = "不能超过1000个字") + private String serviceMatters; + + @ExcelProperty(value = "服务电话") + @NotBlank(message = "不能为空") + @Length(max=11,message = "不能超过11个字") + private String mobile; + + @ExcelProperty(value = "服务时间") + @NotBlank(message = "不能为空") + private String serviceTimeStr; + + @ExcelProperty(value = "管理员姓名") + private String adminStaffName; + + @ExcelProperty(value = "地址") + private String address; + + @Data + public static class ErrorRow { + + @ColumnWidth(40) + @ExcelProperty(value = "组织名称") + private String societyName; + + @ColumnWidth(50) + @ExcelProperty(value = "服务内容") + private String serviceMatters; + + @ColumnWidth(20) + @ExcelProperty(value = "服务电话") + private String mobile; + + @ColumnWidth(25) + @ExcelProperty(value = "服务时间") + private String serviceTimeStr; + + @ColumnWidth(20) + @ExcelProperty(value = "管理员姓名") + private String adminStaffName; + + @ColumnWidth(50) + @ExcelProperty(value = "地址") + private String address; + + @ColumnWidth(60) + @ExcelProperty("错误信息") + private String errorInfo; + } +} + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java index 747ff6f14b..8685acaeef 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java @@ -28,6 +28,7 @@ import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcSocietyOrgEntity; import com.epmet.excel.IcSocietyOrgExcel; +import java.nio.file.Path; import java.text.ParseException; import java.util.List; @@ -79,4 +80,13 @@ public interface IcSocietyOrgService extends BaseService { List queryListById(List socialOrgIds); IcSocietyOrgDTO get(String id); + + /** + * 导入社会组织,之前的废弃了 + * @param fileSavePath + * @param taskId + * @param customerId + * @param userId + */ + void execAsyncExcelImport(Path fileSavePath, String taskId, String customerId, String userId); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java index 16e1cee8f4..332db0bae7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -17,41 +17,56 @@ package com.epmet.service.impl; +import com.alibaba.excel.EasyExcel; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.FileUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserDemandConstant; +import com.epmet.constants.ImportTaskConstants; import com.epmet.dao.IcSocietyOrgDao; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.IcSocietyOrgDTO; import com.epmet.dto.form.*; import com.epmet.dto.form.demand.ServiceQueryFormDTO; -import com.epmet.dto.result.GetListSocietyOrgResultDTO; -import com.epmet.dto.result.OrgInfoResultDTO; -import com.epmet.dto.result.SocietyOrgListResultDTO; -import com.epmet.dto.result.StaffSinGridResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.demand.OptionDTO; import com.epmet.entity.IcSocietyOrgEntity; import com.epmet.excel.IcSocietyOrgExcel; +import com.epmet.excel.IcSocietyOrgImportExcelDTO; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OssFeignClient; import com.epmet.service.IcSocietyOrgService; import com.epmet.service.IcUserDemandRecService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.MapUtils; +import org.apache.commons.fileupload.FileItem; +import org.apache.commons.fileupload.FileItemFactory; +import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.lang3.StringUtils; +import org.apache.http.entity.ContentType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import org.springframework.web.multipart.commons.CommonsMultipartFile; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.text.ParseException; import java.util.*; import java.util.stream.Collectors; @@ -71,6 +86,10 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl errorRows = null;// todo listener.getErrorRows(); + + boolean failed = errorRows.size() > 0; + if (failed) { + // 生成并上传错误文件 + try { + // 文件生成 + Path errorDescDir = FileUtils.getAndCreateDirUnderEpmetFilesDir("ic_enterprise", "import", "error_des"); + String fileName = UUID.randomUUID().toString().concat(".xlsx"); + errorDescFile = errorDescDir.resolve(fileName); + + FileItemFactory factory = new DiskFileItemFactory(16, errorDescDir.toFile()); + FileItem fileItem = factory.createItem("file", ContentType.APPLICATION_OCTET_STREAM.toString(), true, fileName); + OutputStream os = fileItem.getOutputStream(); + + EasyExcel.write(os, IcSocietyOrgImportExcelDTO.ErrorRow.class).sheet("导入失败列表").doWrite(errorRows); + + // 文件上传oss + Result errorDesFileUploadResult = ossFeignClient.uploadImportTaskDescFile(new CommonsMultipartFile(fileItem)); + if (errorDesFileUploadResult.success()) { + errorDesFileUrl = errorDesFileUploadResult.getData().getUrl(); + } + } finally { + if (Files.exists(errorDescFile)) { + Files.delete(errorDescFile); + } + } + } + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(failed ? ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL : ImportTaskConstants.PROCESS_STATUS_FINISHED_SUCCESS); + importFinishTaskForm.setOperatorId(userId); + importFinishTaskForm.setResultDesc(""); + importFinishTaskForm.setResultDescFilePath(errorDesFileUrl); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【社会组织】finishImportTask失败"); + } + } catch (Exception e) { + String errorMsg = ExceptionUtils.getErrorStackTrace(e); + log.error("【社会组织】出错:{}", errorMsg); + + ImportTaskCommonFormDTO importFinishTaskForm = new ImportTaskCommonFormDTO(); + importFinishTaskForm.setTaskId(importTaskId); + importFinishTaskForm.setProcessStatus(ImportTaskConstants.PROCESS_STATUS_FINISHED_FAIL); + importFinishTaskForm.setOperatorId(userId); + importFinishTaskForm.setResultDesc("导入失败"); + + Result result = commonServiceOpenFeignClient.finishImportTask(importFinishTaskForm); + if (!result.success()) { + log.error("【社会组织】导入记录状态修改为'完成'失败"); + } + } finally { + // 删除临时文件 + if (Files.exists(filePath)) { + try { + Files.delete(filePath); + } catch (IOException e) { + log.error("method exception", e); + } + } + } + } + + private CustomerStaffInfoCacheResult queryCurrentStaff(String customerId, String userId) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId); + if (null == staffInfo) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "查询工作人员缓存信息异常", EpmetErrorCode.SERVER_ERROR.getMsg()); + } + return staffInfo; + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/societyorg_import_template.xlsx b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/societyorg_import_template.xlsx index 5d02dae502b5326319fb9578a340a4d624c0fea2..a5562c9247c0f6f5d763faa99fbefc3f2ccd1f07 100644 GIT binary patch delta 1446 zcmV;X1zGy}Mc_rSlK}+`u`aqvlb8W4e-x;!B$WVlMI|JPKXP`nhmTBqoCIrpc?GnO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?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IcResiUserDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 976ab930d6..9373743976 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -1205,7 +1205,7 @@ + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java index 3f9abd5e70..ecfcade3fd 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java @@ -617,25 +617,23 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl staffInfoList = new ArrayList<>(); userIds.forEach(staffId -> { CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), staffId); - if (staffInfo == null) { - log.error("getStaffInfoList fail customerId:{}, staffId:{} not exist in db", formDTO.getCustomerId(), staffId); - return; + if (null != staffInfo) { + StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO(); + resultDTO.setStaffId(staffId); + resultDTO.setStaffName(staffInfo.getRealName()); + resultDTO.setHeadPhoto(staffInfo.getHeadPhoto()); + resultDTO.setGender(staffInfo.getGender()); + + List roleInfoList = new ArrayList<>(); + staffInfo.getRoleMap().forEach((key, value) -> { + RoleResultDTO dto = new RoleResultDTO(); + dto.setRoleKey(key); + dto.setRoleName(value); + roleInfoList.add(dto); + }); + resultDTO.setRoleList(roleInfoList); + staffInfoList.add(resultDTO); } - StaffSinGridResultDTO resultDTO = new StaffSinGridResultDTO(); - resultDTO.setStaffId(staffId); - resultDTO.setStaffName(staffInfo.getRealName()); - resultDTO.setHeadPhoto(staffInfo.getHeadPhoto()); - resultDTO.setGender(staffInfo.getGender()); - - List roleInfoList = new ArrayList<>(); - staffInfo.getRoleMap().forEach((key, value) -> { - RoleResultDTO dto = new RoleResultDTO(); - dto.setRoleKey(key); - dto.setRoleName(value); - roleInfoList.add(dto); - }); - resultDTO.setRoleList(roleInfoList); - staffInfoList.add(resultDTO); }); /*List staffInfoList = customerStaffDao.getStaffInfoList(userIds); From 521345a403e6bf5fce22469083d7d55f8b051d4e Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 24 Aug 2022 15:04:48 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java | 2 +- .../java/com/epmet/dto/form/EditSocietyOrgFormDTO.java | 2 +- .../main/java/com/epmet/excel/IcSocietyOrgExportExcel.java | 4 ++-- .../com/epmet/service/impl/IcSocietyOrgServiceImpl.java | 7 ------- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java index 391652762d..a78b42a471 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddSocietyOrgFormDTO.java @@ -68,7 +68,7 @@ public class AddSocietyOrgFormDTO implements Serializable { /** * 负责人 */ - @NotBlank(message = "负责人名称不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) + //@NotBlank(message = "负责人名称不能为空", groups = { AddSocietyOrgFormDTO.Add.class }) @Length(max = 20, message = "负责人名称不能超过20个字符",groups = {Add.class}) private String personInCharge; /** diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java index 4dfe1df9b2..1e65306066 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditSocietyOrgFormDTO.java @@ -60,7 +60,7 @@ public class EditSocietyOrgFormDTO implements Serializable { /** * 负责人 */ - @Length(max = 20, message = "负责人名称不能超过20个字符",groups = {Edit.class}) + //@Length(max = 20, message = "负责人名称不能超过20个字符",groups = {Edit.class}) private String personInCharge; /** * 负责人电话 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExportExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExportExcel.java index bf914d42d6..5f0c8bdb79 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExportExcel.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExportExcel.java @@ -35,8 +35,8 @@ public class IcSocietyOrgExportExcel { @ExcelProperty(value = "管理员姓名") private String adminStaffName; - @ColumnWidth(30) + /*@ColumnWidth(30) @ExcelProperty(value = "地址") - private String address; + private String address;*/ } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java index be5ccf565b..ebbc75615b 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -174,13 +174,6 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImplStringUtils.isNotBlank(f.getAdminStaffId())).forEach(r -> listResult.getData().stream().filter(u -> r.getAdminStaffId().equals(u.getStaffId())).forEach(u -> r.setAdminStaffName(u.getStaffName()))); - /* result.getList().forEach(dto1->{ - listResult.getData().forEach(staff->{ - if(dto1.getAdminStaffId().equals(staff.getStaffId())){ - dto1.setAdminStaffName(staff.getStaffName()); - } - }); - });*/ } //3.查询被绑定管理员信息 From 3c12af0ee8c9078b25435aec40de41858097322e Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 25 Aug 2022 16:26:46 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E5=A4=84=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/grid/controller/ResiMineGridController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java index e39bd2182c..c9a2f9996e 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java @@ -7,6 +7,7 @@ import com.epmet.dto.form.LatestGridInfoFormDTO; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.LatestGridInfoResultDTO; import com.epmet.modules.grid.service.ResiMineGridService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -63,7 +64,12 @@ public class ResiMineGridController { //formDTO.setAppId(appId); formDTO.setCustomerId(token.getCustomerId()); formDTO.setUserId(token.getUserId()); - return new Result().ok(resiMineGridService.latestGridInfo(formDTO)); + LatestGridInfoResultDTO data = resiMineGridService.latestGridInfo(formDTO); + //todo 兼容 一个老的 等删除这个if就行 + if ((data == null || StringUtils.isBlank(data.getGridId())&&"c2527f3d5cb8958583cc1348c328a784".equals(token.getCustomerId()))){ + return new Result().ok(null); + } + return new Result().ok(data); } /** From 71ddd6839452a031cbe61e51b606cf445a63d67f Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 26 Aug 2022 14:25:18 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E8=87=AA=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=A8=A1=E6=9D=BF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/societyorg_import_template.xlsx | Bin 8928 -> 8977 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/societyorg_import_template.xlsx b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/templates/societyorg_import_template.xlsx index a5562c9247c0f6f5d763faa99fbefc3f2ccd1f07..9ca4a73e2ff45ff4064c93823d38f0441b04667f 100644 GIT binary patch delta 4982 zcmZ9QWmME%yT)f2U>J0iZfQw@p+h8<8tDcRkS>vMX#Ubj!_eK`k|JHwDbkI!fOH6l z=Y2n%^PGFFeXq6mUi;o_{nqv6x|Ux>%T%JlFs|XHmX}}PUTPG2nbA%T>p?v4!DWgdgT+8|p`Re4 zPK`&_;iU>FhV^ZqT?BQ%W`l&!M-4|kc9^hrd$yT_cRY6*kJ<7t3%p0u2%;P#U?w8_ zeA79k%IrDbq|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{_CKtC?X~^hEvo;7?oG=387Wuboa$fwb0K}-meFe{AToK4r>o3iSHtPrsnqdnAO4 zEeol~vVq7G?MEAL@SWFA+bx)gvrl9id8mj(oR*SqxuvRXJ7t5xQ6>;y7r07VZl~aq z#Z)~HQlbBeb!ouN8nCPAn0lqMv~i2|-!QakcD-c(PkX9_a;9SfhUK4PKcK?HG+`hL zry|)Au#Y)Jt(2QsZR)!?wq~8)^do6RCCpSjgq|Y;_1mS07r0yAqnrH6Fj$O6IA0Wh?pNc727g;Bi~L`arYPbO_V4Ku!5PLL#GKkx>z`dx@!Gc{ZC}l`ee-TMdbr{9K%nMJa>-Wg`0% zRy68`H#FhHn_;ps@t2xzU$+29;qBk~VF%LZGgD4PWf2Ewhfc;MvOq9&j>Z-xxOwqI zRMtNXUOV$)_m+vd;C#y^p`n)G6XCt%bFq3uv=aP35Zl_~dE)UNXI6 z*v8`T5#~S7_KpT1FCVBD*4$hHKDv=OehQs>76A;)G@O#79NU+ zg`e@Cy8Uxme@T_U@^5D-%8iAS^Z&!I|6PyzgU0>=W2gsE=D&wy8KDkXMD7HDQL$iZ xloaeP?w@jK=0xehsIg>GFJV$x2viP?h4H_chkr%=PuMIJ2F8ome($gCe*jjMGN}Ln From 9063b1542f5d5c0d509596e2642cafec3545f7bb Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 26 Aug 2022 14:52:16 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E8=87=AA=E7=BB=84?= =?UTF-8?q?=E7=BB=87bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java index ebbc75615b..063064f9cd 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java @@ -120,11 +120,11 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl%s", formDTO.getSocietyId())); } + entity = ConvertUtils.sourceToTarget(formDTO, IcSocietyOrgEntity.class); //图片必填 - if(formDTO.getImageList() != null&& StringUtils.isNotBlank(formDTO.getImageList()[0])){ + if(formDTO.getImageList() != null && StringUtils.isNotBlank(formDTO.getImageList()[0])){ entity.setImgUrl(formDTO.getImageList()[0]); } - entity = ConvertUtils.sourceToTarget(formDTO, IcSocietyOrgEntity.class); entity.setId(formDTO.getSocietyId()); baseDao.updateById(entity); } From c69e69b65c6fe206de0f3dcdc610e53d79ee729f Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 26 Aug 2022 15:27:03 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E8=87=AA=E7=BB=84?= =?UTF-8?q?=E7=BB=87=20=E8=AF=A6=E6=83=85=E6=B7=BB=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/IcSocietyOrgController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java index a5123e155a..1d34519a54 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -50,6 +50,7 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.IcSocietyOrgService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; import org.springframework.util.CollectionUtils; @@ -79,6 +80,7 @@ import java.util.stream.Collectors; @RestController @RequestMapping("societyorg") public class IcSocietyOrgController implements ResultDataResolver { + private static final String DEFAULT_NO_IMG = "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20220826/38eb186191ab48fe8d3920b642b56e64.png"; @Autowired private IcSocietyOrgService societyOrgService; @@ -115,6 +117,9 @@ public class IcSocietyOrgController implements ResultDataResolver { @RequestMapping("detail/{id}") public Result detail(@LoginUser TokenDto tokenDto, @PathVariable(value = "id") String id) { IcSocietyOrgDTO icSocietyOrgDTO = societyOrgService.get(id); + if (StringUtils.isNotBlank(icSocietyOrgDTO.getImgUrl())){ + icSocietyOrgDTO.setImgUrl(DEFAULT_NO_IMG); + } return new Result().ok(icSocietyOrgDTO); } From ec0a6b1aad5e4c2b10926171af2b36db686dd6cf Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 26 Aug 2022 15:48:30 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E7=A4=BE=E4=BC=9A=E8=87=AA=E7=BB=84?= =?UTF-8?q?=E7=BB=87=20=E8=AF=A6=E6=83=85=E6=B7=BB=E5=8A=A0=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/IcSocietyOrgController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java index 1d34519a54..3267ef36bb 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java @@ -117,7 +117,7 @@ public class IcSocietyOrgController implements ResultDataResolver { @RequestMapping("detail/{id}") public Result detail(@LoginUser TokenDto tokenDto, @PathVariable(value = "id") String id) { IcSocietyOrgDTO icSocietyOrgDTO = societyOrgService.get(id); - if (StringUtils.isNotBlank(icSocietyOrgDTO.getImgUrl())){ + if (StringUtils.isBlank(icSocietyOrgDTO.getImgUrl())){ icSocietyOrgDTO.setImgUrl(DEFAULT_NO_IMG); } return new Result().ok(icSocietyOrgDTO);