Browse Source

Merge branch 'dev_import' of http://git.elinkit.com.cn:7070/r/epmet-cloud into release_temp

dev
wangxianzhang 4 years ago
parent
commit
04f6fc197c
  1. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java
  2. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java
  3. 39
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java
  4. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.12__insert_ic_party_relation.sql
  5. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/BuildingController.java
  6. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  7. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcNeighborHoodController.java

4
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<String> unitIdList;
private List<String> unitNameList;
/**
* 活动目标
*/
@ -196,4 +198,6 @@ public class ResiActDetailResultDTO implements Serializable {
*/
private String serviceMatter;
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
}

6
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)

39
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<ActInfoDao, ActInfoEntit
private IcPartyUnitService icPartyUnitService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
@Resource
private IcPartyActivityService icPartyActivityService;
@Resource
private IcActivityServiceRelationService icActivityServiceRelationService;
@Resource
private IcActivityUnitRelationService icActivityUnitRelationService;
@Override
public PageData<ActInfoDTO> page(Map<String, Object> params) {
@ -255,16 +260,26 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
String currentUserStatus = getCurrentUserStatus(formDto.getActId(), formDto.getUserId());
detailResultDTO.setCurrentUserStatus(currentUserStatus);
if (StringUtils.isNotBlank(detailResultDTO.getServiceMatter())) {
//获取服务事项
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> 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<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(tokenDto.getCustomerId());
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<String> services = icActivityServiceRelationService.getServiceList(dto.getId());
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList());
detailResultDTO.setServiceMatterList(services);
detailResultDTO.setServiceMatterNameList(serviceNames);
//获取联建单位
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(dto.getAgencyId());
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<String> unitIds = icActivityUnitRelationService.getUnitList(dto.getId());
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
detailResultDTO.setUnitIdList(unitIds);
detailResultDTO.setUnitNameList(unitNames);
}
}
return new Result<ResiActDetailResultDTO>().ok(detailResultDTO);
}

40
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, '-', '');

2
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<ImportTaskCommonResultDTO> importTask = epmetCommonServiceOpenFeignClient.createImportTask(importFormDTO);
if (!importTask.success()){
throw new EpmetException("当前存在上传任务");

2
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<ImportTaskCommonResultDTO> importTask = epmetCommonServiceOpenFeignClient.createImportTask(importFormDTO);
if (!importTask.success()){
throw new EpmetException("当前存在上传任务");

2
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<ImportTaskCommonResultDTO> importTask = epmetCommonServiceOpenFeignClient.createImportTask(importFormDTO);
if (!importTask.success()){
throw new EpmetException("当前存在上传任务");

Loading…
Cancel
Save