Browse Source

Merge remote-tracking branch 'origin/dev_import' into dev_import

dev
sunyuchao 4 years ago
parent
commit
8f450f696a
  1. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java
  2. 12
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
  3. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
  4. 12
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java
  5. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java
  6. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java
  7. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java
  8. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java
  9. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActServiceRelationEntity.java
  10. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActUnitRelationEntity.java
  11. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActServiceRelationService.java
  12. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActUnitRelationService.java
  13. 42
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActServiceRelationServiceImpl.java
  14. 42
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActUnitRelationServiceImpl.java
  15. 54
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java
  16. 190
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  17. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java

@ -170,7 +170,7 @@ public class DraftActInfoFormDTO implements Serializable {
* 联建单位
*/
private String unitId;
private List<String> unitIdList;
/**
* 活动目标
*/
@ -180,5 +180,6 @@ public class DraftActInfoFormDTO implements Serializable {
* 服务事项
*/
private String serviceMatter;
private List<String> serviceMatterList;
}

12
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java

@ -5,10 +5,7 @@ import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ -200,9 +197,9 @@ public class PublishActInfoFormDTO implements Serializable {
/**
* 联建单位
*/
@NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
private String unitId;
@NotEmpty(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
private List<String> unitIdList;
/**
* 活动目标
*/
@ -212,6 +209,7 @@ public class PublishActInfoFormDTO implements Serializable {
/**
* 服务事项
*/
@NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
private String serviceMatter;
@NotEmpty(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
private List<String> serviceMatterList;
}

11
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java

@ -5,10 +5,7 @@ import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@ -206,8 +203,9 @@ public class RePublishFormDTO implements Serializable {
/**
* 联建单位
*/
@NotBlank(message = "联建单位不能为空", groups = {AddPartyActivityGroup.class})
private String unitId;
@NotEmpty(message = "联建单位不能为空", groups = {PublishActInfoFormDTO.AddPartyActivityGroup.class})
private List<String> unitIdList;
/**
* 活动目标
@ -218,6 +216,7 @@ public class RePublishFormDTO implements Serializable {
/**
* 服务事项
*/
@NotBlank(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
private String serviceMatter;
@NotEmpty(message = "服务事项不能为空", groups = {PublishActInfoFormDTO.AddPartyActivityGroup.class})
private List<String> serviceMatterList;
}

12
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -74,7 +75,12 @@ public class ActPreviewResultDTO implements Serializable {
* 主办方名称
*/
private String sponsorName;
@JsonIgnore
private String sponsorType;
@JsonIgnore
private String sponsorId;
@JsonIgnore
private String pid;
/**
* 联系人
*/
@ -100,6 +106,8 @@ public class ActPreviewResultDTO implements Serializable {
*/
private String unitId;
private String unitName;
private List<String> unitIdList;
private List<String> unitNameList;
/**
* 活动目标
*/
@ -110,4 +118,6 @@ public class ActPreviewResultDTO implements Serializable {
*/
private String serviceMatter;
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
}

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java

@ -158,6 +158,8 @@ public class CanceledActDetailResultDTO implements Serializable {
*/
private String unitId;
private String unitName;
private List<String> unitIdList;
private List<String> unitNameList;
/**
* 活动目标
*/
@ -168,4 +170,6 @@ public class CanceledActDetailResultDTO implements Serializable {
*/
private String serviceMatter;
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
}

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java

@ -147,6 +147,8 @@ public class FinishedActDetailResultDTO implements Serializable {
*/
private String unitId;
private String unitName;
private List<String> unitIdList;
private List<String> unitNameList;
/**
* 活动目标
*/
@ -157,4 +159,6 @@ public class FinishedActDetailResultDTO implements Serializable {
*/
private String serviceMatter;
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
}

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java

@ -142,6 +142,8 @@ public class InProgressActDetailResultDTO implements Serializable {
*/
private String unitId;
private String unitName;
private List<String> unitIdList;
private List<String> unitNameList;
/**
* 活动目标
*/
@ -152,4 +154,6 @@ public class InProgressActDetailResultDTO implements Serializable {
*/
private String serviceMatter;
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
}

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java

@ -159,6 +159,8 @@ public class ReEditActInfoResultDTO implements Serializable {
*/
private String unitId;
private String unitName;
private List<String> unitIdList;
private List<String> unitNameList;
/**
* 活动目标
*/
@ -169,4 +171,6 @@ public class ReEditActInfoResultDTO implements Serializable {
*/
private String serviceMatter;
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
}

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActServiceRelationEntity.java

@ -23,16 +23,6 @@ public class LatestActServiceRelationEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* latest_act_info表ID
*/

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActUnitRelationEntity.java

@ -23,16 +23,6 @@ public class LatestActUnitRelationEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* latest_act_info表ID
*/

20
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActServiceRelationService.java

@ -3,6 +3,8 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.LatestActServiceRelationEntity;
import java.util.List;
/**
* 联建活动与服务事项关联表
*
@ -10,5 +12,23 @@ import com.epmet.entity.LatestActServiceRelationEntity;
* @since v1.0.0 2022-02-21
*/
public interface LatestActServiceRelationService extends BaseService<LatestActServiceRelationEntity> {
/**
* 获取活动所属服务事项列表
*
* @Param actId
* @Return {@link List < String>}
* @Author zhaoqifeng
* @Date 2022/2/22 14:53
*/
List<String> getServiceMatterList(String actId);
/**
* 删除活动所属服务事项
*
* @Param actId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/22 14:54
*/
void deleteByAct(String actId);
}

21
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActUnitRelationService.java

@ -3,6 +3,8 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.LatestActUnitRelationEntity;
import java.util.List;
/**
* 联建活动与单位关联表
*
@ -10,5 +12,24 @@ import com.epmet.entity.LatestActUnitRelationEntity;
* @since v1.0.0 2022-02-21
*/
public interface LatestActUnitRelationService extends BaseService<LatestActUnitRelationEntity> {
/**
* 获取活动所属联建单位列表
*
* @Param actId
* @Return {@link List< String>}
* @Author zhaoqifeng
* @Date 2022/2/22 14:53
*/
List<String> getUnitList(String actId);
/**
* 删除活动所属单位列表
*
* @Param actId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/22 14:54
*/
void deleteByAct(String actId);
}

42
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActServiceRelationServiceImpl.java

@ -1,10 +1,17 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.LatestActServiceRelationDao;
import com.epmet.entity.LatestActServiceRelationEntity;
import com.epmet.service.LatestActServiceRelationService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 联建活动与服务事项关联表
@ -16,4 +23,39 @@ import org.springframework.stereotype.Service;
public class LatestActServiceRelationServiceImpl extends BaseServiceImpl<LatestActServiceRelationDao, LatestActServiceRelationEntity> implements LatestActServiceRelationService {
/**
* 获取活动所属服务事项列表
*
* @param actId
* @Param actId
* @Return {@link List < String>}
* @Author zhaoqifeng
* @Date 2022/2/22 14:53
*/
@Override
public List<String> getServiceMatterList(String actId) {
LambdaQueryWrapper<LatestActServiceRelationEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LatestActServiceRelationEntity::getActId, actId);
wrapper.orderByAsc(LatestActServiceRelationEntity::getSort);
List<LatestActServiceRelationEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(LatestActServiceRelationEntity::getServiceMatter).collect(Collectors.toList());
}
/**
* 删除活动所属服务事项
*
* @param actId
* @Param actId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/22 14:54
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByAct(String actId) {
baseDao.deleteByActivity(actId);
}
}

42
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActUnitRelationServiceImpl.java

@ -1,10 +1,17 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.LatestActUnitRelationDao;
import com.epmet.entity.LatestActUnitRelationEntity;
import com.epmet.service.LatestActUnitRelationService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 联建活动与单位关联表
@ -16,4 +23,39 @@ import org.springframework.stereotype.Service;
public class LatestActUnitRelationServiceImpl extends BaseServiceImpl<LatestActUnitRelationDao, LatestActUnitRelationEntity> implements LatestActUnitRelationService {
/**
* 获取活动所属联建单位列表
*
* @param actId
* @Param actId
* @Return {@link List < String>}
* @Author zhaoqifeng
* @Date 2022/2/22 14:53
*/
@Override
public List<String> getUnitList(String actId) {
LambdaQueryWrapper<LatestActUnitRelationEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LatestActUnitRelationEntity::getActId, actId);
wrapper.orderByAsc(LatestActUnitRelationEntity::getSort);
List<LatestActUnitRelationEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(LatestActUnitRelationEntity::getUnitId).collect(Collectors.toList());
}
/**
* 删除活动所属单位列表
*
* @param actId
* @Param actId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/22 14:54
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByAct(String actId) {
baseDao.deleteByActivity(actId);
}
}

54
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java

@ -1,8 +1,10 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ActConstant;
import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.LatestActContentDTO;
import com.epmet.dto.LatestActInfoDTO;
@ -11,6 +13,8 @@ import com.epmet.dto.form.work.DraftActContentFormDTO;
import com.epmet.dto.form.work.DraftActInfoFormDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.work.*;
import com.epmet.entity.LatestActServiceRelationEntity;
import com.epmet.entity.LatestActUnitRelationEntity;
import com.epmet.service.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
@ -24,6 +28,7 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
@ -45,7 +50,10 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
private IcServiceItemDictService icServiceItemDictService;
@Resource
private IcPartyUnitService icPartyUnitService;
@Resource
private LatestActServiceRelationService latestActServiceRelationService;
@Resource
private LatestActUnitRelationService latestActUnitRelationService;
/**
* @return com.epmet.dto.form.work.PublishActInitResultDTO
@ -116,6 +124,32 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
}
SaveActDraftResultDTO resultDTO=new SaveActDraftResultDTO();
resultDTO.setActDraftId(actDraftId);
//保存活动与服务关系
latestActServiceRelationService.deleteByAct(actDraftId);
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
List<LatestActServiceRelationEntity> serviceList = formDTO.getServiceMatterList().stream().map(service -> {
LatestActServiceRelationEntity entity = new LatestActServiceRelationEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setActId(actDraftId);
entity.setServiceMatter(service);
entity.setSort(i.getAndIncrement());
return entity;
}).collect(Collectors.toList());
latestActServiceRelationService.insertBatch(serviceList);
//保存活动与单位关系
latestActUnitRelationService.deleteByAct(actDraftId);
AtomicInteger j = new AtomicInteger(NumConstant.ONE);
List<LatestActUnitRelationEntity> unitList = formDTO.getUnitIdList().stream().map(unitId -> {
LatestActUnitRelationEntity entity = new LatestActUnitRelationEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setActId(actDraftId);
entity.setUnitId(unitId);
entity.setSort(j.getAndIncrement());
return entity;
}).collect(Collectors.toList());
latestActUnitRelationService.insertBatch(unitList);
return resultDTO;
}
@ -146,6 +180,24 @@ public class WorkActDraftServiceImpl implements WorkActDraftService {
IcPartyUnitDTO unitDTO = icPartyUnitService.get(actPreviewResultDTO.getUnitId());
actPreviewResultDTO.setUnitName(unitDTO.getUnitName());
}
if (ActConstant.PARTY.equals(actPreviewResultDTO.getActType())) {
//获取服务事项
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<String> services = latestActServiceRelationService.getServiceMatterList(formDTO.getActDraftId());
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList());
actPreviewResultDTO.setServiceMatterList(services);
actPreviewResultDTO.setServiceMatterNameList(serviceNames);
//获取联建单位
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(ActConstant.SPONSOR_AGENCY.equals(actPreviewResultDTO.getSponsorType())?actPreviewResultDTO.getSponsorId():actPreviewResultDTO.getPid());
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<String> unitIds = latestActUnitRelationService.getUnitList(formDTO.getActDraftId());
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
actPreviewResultDTO.setUnitIdList(unitIds);
actPreviewResultDTO.setUnitNameList(unitNames);
}
}
return actPreviewResultDTO;
}

190
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -33,7 +33,6 @@ import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -44,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -102,6 +102,10 @@ public class WorkActServiceImpl implements WorkActService {
private IcPartyUnitService icPartyUnitService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
@Resource
private IcActivityUnitRelationService icActivityUnitRelationService;
@Resource
private IcActivityServiceRelationService icActivityServiceRelationService;
/**
@ -232,6 +236,36 @@ public class WorkActServiceImpl implements WorkActService {
if (ActConstant.PARTY.equals(formDTO.getActType())) {
IcPartyActivityEntity activity = getPartyActivityEntity(formDTO, actInfoEntity);
icPartyActivityService.insert(activity);
//保存活动与单位关系
icActivityUnitRelationService.deleteByActivity(activity.getId());
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
List<IcActivityUnitRelationEntity> unitRelationList = formDTO.getUnitIdList().stream().map(unitId -> {
IcActivityUnitRelationEntity relation = new IcActivityUnitRelationEntity();
relation.setCustomerId(activity.getCustomerId());
relation.setAgencyId(activity.getAgencyId());
relation.setPids(activity.getPids());
relation.setActivityId(activity.getId());
relation.setUnitId(unitId);
relation.setSort(i.getAndIncrement());
return relation;
}).collect(Collectors.toList());
icActivityUnitRelationService.insertBatch(unitRelationList);
//保存活动与服务关系
icActivityServiceRelationService.deleteByActivity(activity.getId());
AtomicInteger j = new AtomicInteger(NumConstant.ONE);
List<IcActivityServiceRelationEntity> serviceRelationList = formDTO.getServiceMatterList().stream().map(service -> {
IcActivityServiceRelationEntity relation = new IcActivityServiceRelationEntity();
relation.setCustomerId(activity.getCustomerId());
relation.setAgencyId(activity.getAgencyId());
relation.setPids(activity.getPids());
relation.setActivityId(activity.getId());
relation.setServiceMatter(service);
relation.setSort(j.getAndIncrement());
return relation;
}).collect(Collectors.toList());
icActivityServiceRelationService.insertBatch(serviceRelationList);
}
return publishActResultDTO;
@ -779,17 +813,26 @@ public class WorkActServiceImpl implements WorkActService {
canceledActDetailResultDTO.setIsMyPublish(false);
}
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getServiceMatter())) {
//获取服务事项
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId);
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
canceledActDetailResultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(canceledActDetailResultDTO.getServiceMatter()) ?
categoryMap.get(canceledActDetailResultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(canceledActDetailResultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(canceledActDetailResultDTO.getUnitId());
canceledActDetailResultDTO.setUnitName(unitDTO.getUnitName());
if (ActConstant.PARTY.equals(canceledActDetailResultDTO.getActType())) {
IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId);
if (null != dto) {
//获取服务事项
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId);
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());
canceledActDetailResultDTO.setServiceMatterList(services);
canceledActDetailResultDTO.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());
canceledActDetailResultDTO.setUnitIdList(unitIds);
canceledActDetailResultDTO.setUnitNameList(unitNames);
}
}
}
return canceledActDetailResultDTO;
@ -835,17 +878,26 @@ public class WorkActServiceImpl implements WorkActService {
}else{
resultDTO.setIsMyPublish(false);
}
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap = serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId());
resultDTO.setUnitName(unitDTO.getUnitName());
if (ActConstant.PARTY.equals(resultDTO.getActType())) {
IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(formDTO.getActId());
if (null != dto) {
//获取服务事项
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(formDTO.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());
resultDTO.setServiceMatterList(services);
resultDTO.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());
resultDTO.setUnitIdList(unitIds);
resultDTO.setUnitNameList(unitNames);
}
}
}
return resultDTO;
@ -915,16 +967,26 @@ public class WorkActServiceImpl implements WorkActService {
}else{
resultDTO.setIsMyPublish(false);
}
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(customerId);
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId());
resultDTO.setUnitName(unitDTO.getUnitName());
if (ActConstant.PARTY.equals(resultDTO.getActType())) {
IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId);
if (null != dto) {
//获取服务事项
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId);
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());
resultDTO.setServiceMatterList(services);
resultDTO.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());
resultDTO.setUnitIdList(unitIds);
resultDTO.setUnitNameList(unitNames);
}
}
}
return resultDTO;
@ -1309,16 +1371,26 @@ public class WorkActServiceImpl implements WorkActService {
List<ActPreviewContentResultDTO> actContent=actContentDao.selectByActId(actId);
resultDTO.setActContent(actContent);
if (StringUtils.isNotBlank(resultDTO.getServiceMatter())) {
//获取服务事项
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(customerId);
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
resultDTO.setServiceMatterName(MapUtils.isNotEmpty(categoryMap) && categoryMap.containsKey(resultDTO.getServiceMatter()) ? categoryMap.get(resultDTO.getServiceMatter()) : StrConstant.EPMETY_STR);
}
if (StringUtils.isNotBlank(resultDTO.getUnitId())) {
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(resultDTO.getUnitId());
resultDTO.setUnitName(unitDTO.getUnitName());
if (ActConstant.PARTY.equals(resultDTO.getActType())) {
IcPartyActivityDTO dto = icPartyActivityService.getActivityByActId(actId);
if (null != dto) {
//获取服务事项
List<OptionDTO> serviceItemList = icServiceItemDictService.queryDictList(customerId);
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());
resultDTO.setServiceMatterList(services);
resultDTO.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());
resultDTO.setUnitIdList(unitIds);
resultDTO.setUnitNameList(unitNames);
}
}
return resultDTO;
@ -1438,6 +1510,36 @@ public class WorkActServiceImpl implements WorkActService {
IcPartyActivityEntity activity = getPartyActivityEntity(ConvertUtils.sourceToTarget(rePublishFormDTO, PublishActInfoFormDTO.class), newActInfoEntity);
activity.setId(activityDTO.getId());
icPartyActivityService.updateById(activity);
//保存活动与单位关系
icActivityUnitRelationService.deleteByActivity(activity.getId());
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
List<IcActivityUnitRelationEntity> unitRelationList = rePublishFormDTO.getUnitIdList().stream().map(unitId -> {
IcActivityUnitRelationEntity relation = new IcActivityUnitRelationEntity();
relation.setCustomerId(activity.getCustomerId());
relation.setAgencyId(activity.getAgencyId());
relation.setPids(activity.getPids());
relation.setActivityId(activity.getId());
relation.setUnitId(unitId);
relation.setSort(i.getAndIncrement());
return relation;
}).collect(Collectors.toList());
icActivityUnitRelationService.insertBatch(unitRelationList);
//保存活动与服务关系
icActivityServiceRelationService.deleteByActivity(activity.getId());
AtomicInteger j = new AtomicInteger(NumConstant.ONE);
List<IcActivityServiceRelationEntity> serviceRelationList = rePublishFormDTO.getServiceMatterList().stream().map(service -> {
IcActivityServiceRelationEntity relation = new IcActivityServiceRelationEntity();
relation.setCustomerId(activity.getCustomerId());
relation.setAgencyId(activity.getAgencyId());
relation.setPids(activity.getPids());
relation.setActivityId(activity.getId());
relation.setServiceMatter(service);
relation.setSort(j.getAndIncrement());
return relation;
}).collect(Collectors.toList());
icActivityServiceRelationService.insertBatch(serviceRelationList);
}
}
@ -1462,8 +1564,6 @@ public class WorkActServiceImpl implements WorkActService {
logger.warn("根据agencyId查询组织信息失败,agencyId={}",formDTO.getSponsorId());
}
entity.setActId(actInfoEntity.getId());
entity.setUnitId(actInfoEntity.getUnitId());
entity.setServiceMatter(actInfoEntity.getServiceMatter());
entity.setTitle(actInfoEntity.getTitle());
entity.setTarget(actInfoEntity.getTarget());
entity.setContent(getContent(formDTO.getActContent()));

3
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml

@ -114,6 +114,9 @@
lai.SPONSOR_NAME AS sponsorName,
lai.SPONSOR_CONTACTS AS sponsorContacts,
lai.SPONSOR_TEL AS sponsorTel,
lai.SPONSOR_TYPE,
lai.SPONSOR_ID,
lai.PID,
lai.ACT_TYPE,
lai.UNIT_ID,
lai.SERVICE_MATTER,

Loading…
Cancel
Save