diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java index a232ebdf33..aa33f41e69 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java @@ -186,6 +186,8 @@ public class ResiActDetailResultDTO implements Serializable { */ private String unitId; private String unitName; + private List unitIdList; + private List unitNameList; /** * 活动目标 */ @@ -196,4 +198,6 @@ public class ResiActDetailResultDTO implements Serializable { */ private String serviceMatter; private String serviceMatterName; + private List serviceMatterList; + private List serviceMatterNameList; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java index 2a9995be2a..e6b04d8938 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java @@ -5,6 +5,7 @@ import cn.afterturn.easypoi.excel.annotation.ExcelCollection; import com.epmet.commons.tools.utils.ExcelVerifyInfo; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.util.Date; import java.util.List; @@ -17,18 +18,23 @@ import java.util.List; public class ImportCommunitySelfOrganization extends ExcelVerifyInfo { @Excel(name = "组织名称", needMerge = true) + @NotBlank(message = "不能为空") private String organizationName; @Excel(name = "组织人数", needMerge = true) + //@NotNull(message = "不能为空") private Integer organizationPersonCount; @Excel(name = "服务事项", needMerge = true) + @NotBlank(message = "不能为空") private String serviceItem; @Excel(name = "负责人", needMerge = true) + @NotBlank(message = "不能为空") private String principalName; @Excel(name = "联系电话", needMerge = true) + @NotBlank(message = "不能为空") private String principalPhone; @Excel(name = "创建时间", needMerge = true) diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index e595bdd0c6..407cb74dac 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -22,7 +22,6 @@ 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.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; @@ -34,6 +33,7 @@ import com.epmet.dao.ActInfoDao; import com.epmet.dao.ActUserRelationDao; import com.epmet.dao.HeartUserInfoDao; import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.form.resi.*; import com.epmet.dto.result.demand.OptionDTO; @@ -42,7 +42,6 @@ import com.epmet.entity.ActInfoEntity; import com.epmet.entity.ActUserRelationEntity; import com.epmet.service.*; import com.epmet.utils.CaculateDistance; -import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -77,6 +76,12 @@ public class ActInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -255,16 +260,26 @@ public class ActInfoServiceImpl extends BaseServiceImpl serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); - Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); - detailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(detailResultDTO.getServiceMatter()) ? categoryMap.get(detailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR); - } - if (StringUtils.isNotBlank(detailResultDTO.getUnitId())) { - //获取单位名称 - IcPartyUnitDTO unitDTO = icPartyUnitService.get(detailResultDTO.getUnitId()); - detailResultDTO.setUnitName(null != unitDTO ? unitDTO.getUnitName() : StrConstant.EPMETY_STR); + if (ActConstant.PARTY.equals(detailResultDTO.getActType())) { + IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(formDto.getActId()); + if (null != dto) { + //获取服务事项 + List serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId()); + Map categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List services = icActivityServiceRelationService.getServiceList(dto.getId()); + List serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); + detailResultDTO.setServiceMatterList(services); + detailResultDTO.setServiceMatterNameList(serviceNames); + + //获取联建单位 + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(dto.getAgencyId()); + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List unitIds = icActivityUnitRelationService.getUnitList(dto.getId()); + List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); + detailResultDTO.setUnitIdList(unitIds); + detailResultDTO.setUnitNameList(unitNames); + } } return new Result().ok(detailResultDTO); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.12__insert_ic_party_relation.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.12__insert_ic_party_relation.sql new file mode 100644 index 0000000000..41aaf825dd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.12__insert_ic_party_relation.sql @@ -0,0 +1,40 @@ +INSERT INTO ic_activity_unit_relation +SELECT + UUID() AS ID, + CUSTOMER_ID, + AGENCY_ID, + PIDS, + ID AS ACTIVITY_ID, + ACT_ID, + UNIT_ID, + 1 AS SORT, + DEL_FLAG, + REVISION, + CREATED_BY, + NOW(), + UPDATED_BY, + NOW() +FROM + ic_party_activity +WHERE UNIT_ID IS NOT NULL AND UNIT_ID != ''; +UPDATE ic_activity_unit_relation SET ID = REPLACE (ID, '-', ''); +INSERT INTO ic_activity_service_relation +SELECT + UUID() AS ID, + CUSTOMER_ID, + AGENCY_ID, + PIDS, + ID AS ACTIVITY_ID, + ACT_ID, + SERVICE_MATTER, + 1 AS SORT, + DEL_FLAG, + REVISION, + CREATED_BY, + NOW(), + UPDATED_BY, + NOW() +FROM + ic_party_activity +WHERE SERVICE_MATTER IS NOT NULL AND UNIT_ID != ''; +UPDATE ic_activity_service_relation SET ID = REPLACE (ID, '-', ''); \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java index 83165b6c4f..90b9a9353c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java @@ -219,7 +219,7 @@ public class BuildingController { ImportTaskCommonFormDTO importFormDTO = new ImportTaskCommonFormDTO(); importFormDTO.setBizType(ImportTaskConstants.BIZ_TYPE_BUILDING); importFormDTO.setOperatorId(formDTO.getUserId()); - importFormDTO.setOriginFileName(ImportErrorMsgConstants.BUILDING_ERROR_NAME); + importFormDTO.setOriginFileName(file.getOriginalFilename()); Result importTask = epmetCommonServiceOpenFeignClient.createImportTask(importFormDTO); if (!importTask.success()){ throw new EpmetException("当前存在上传任务"); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java index 09d8336954..b585396e0b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java @@ -269,7 +269,7 @@ public class HouseController implements ResultDataResolver { ImportTaskCommonFormDTO importFormDTO = new ImportTaskCommonFormDTO(); importFormDTO.setBizType(ImportTaskConstants.BIZ_TYPE_HOUSE); importFormDTO.setOperatorId(formDTO.getUserId()); - importFormDTO.setOriginFileName(ImportErrorMsgConstants.HOUSE_ERROR_NAME); + importFormDTO.setOriginFileName(file.getOriginalFilename()); Result importTask = epmetCommonServiceOpenFeignClient.createImportTask(importFormDTO); if (!importTask.success()){ throw new EpmetException("当前存在上传任务"); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java index fba75d9432..4128ed84c3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java @@ -139,7 +139,7 @@ public class IcNeighborHoodController { ImportTaskCommonFormDTO importFormDTO = new ImportTaskCommonFormDTO(); importFormDTO.setBizType(ImportTaskConstants.BIZ_TYPE_NEIGHBOR_HOOD); importFormDTO.setOperatorId(formDTO.getUserId()); - importFormDTO.setOriginFileName(ImportErrorMsgConstants.NEIGHBORHOOD_ERROR_NAME); + importFormDTO.setOriginFileName(file.getOriginalFilename()); Result importTask = epmetCommonServiceOpenFeignClient.createImportTask(importFormDTO); if (!importTask.success()){ throw new EpmetException("当前存在上传任务");