|
|
@ -21,20 +21,32 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dao.IssueApplicationHistoryDao; |
|
|
|
import com.epmet.dto.IssueApplicationHistoryDTO; |
|
|
|
import com.epmet.dto.result.ApplicationHistoryResDTO; |
|
|
|
import com.epmet.dto.form.ApplicationDetailWorkFormDTO; |
|
|
|
import com.epmet.dto.form.ApplicationHistoryWorkFormDTO; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.IssueApplicationHistoryEntity; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; |
|
|
|
import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO; |
|
|
|
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; |
|
|
|
import com.epmet.service.IssueApplicationHistoryService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 话题转议题审核历史表 |
|
|
@ -45,6 +57,11 @@ import java.util.Map; |
|
|
|
@Service |
|
|
|
public class IssueApplicationHistoryServiceImpl extends BaseServiceImpl<IssueApplicationHistoryDao, IssueApplicationHistoryEntity> implements IssueApplicationHistoryService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ResiGroupOpenFeignClient resiGroupOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IssueApplicationHistoryDTO> page(Map<String, Object> params) { |
|
|
|
IPage<IssueApplicationHistoryEntity> page = baseDao.selectPage( |
|
|
@ -108,4 +125,48 @@ public class IssueApplicationHistoryServiceImpl extends BaseServiceImpl<IssueApp |
|
|
|
return baseDao.selectListByIssueApplicationId(issueApplicationId); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 待审核||已驳回 申请详情 |
|
|
|
* @Param applicationDetailWorkFormDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2020/11/19 下午2:26 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public ApplicationDetailWorkResultDTO applicationDetailWork(ApplicationDetailWorkFormDTO applicationDetailWorkFormDTO) { |
|
|
|
ApplicationDetailFormDTO formDTO = new ApplicationDetailFormDTO(); |
|
|
|
formDTO.setIssueApplicationId(applicationDetailWorkFormDTO.getIssueApplicationId()); |
|
|
|
Result<ApplicationDetailCopyResultDTO> result = resiGroupOpenFeignClient.applicationDetail(formDTO); |
|
|
|
if (!result.success()){ |
|
|
|
throw new RenException("工作端查询待审核||已驳回 申请详情失败......"); |
|
|
|
} |
|
|
|
if (null == result.getData()){ |
|
|
|
return new ApplicationDetailWorkResultDTO(); |
|
|
|
} |
|
|
|
ApplicationDetailWorkResultDTO applicationDetailWorkResultDTO = ConvertUtils.sourceToTarget(result.getData(), ApplicationDetailWorkResultDTO.class); |
|
|
|
TopicInfoWorkResultDTO topicInfoWorkResultDTO = ConvertUtils.sourceToTarget(result.getData().getTopicInfo(), TopicInfoWorkResultDTO.class); |
|
|
|
applicationDetailWorkResultDTO.setTopicInfo(topicInfoWorkResultDTO); |
|
|
|
return applicationDetailWorkResultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 议题详情- 根据issueId查询审核历史 |
|
|
|
* @Param applicationHistoryWorkFormDTO |
|
|
|
* @author zxc |
|
|
|
* @date 2020/11/19 下午2:26 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<ApplicationHistoryWorkResultDTO> applicationHistoryWork(ApplicationHistoryWorkFormDTO applicationHistoryWorkFormDTO) { |
|
|
|
List<ApplicationHistoryWorkResultDTO> result = baseDao.applicationHistoryWork(applicationHistoryWorkFormDTO.getIssueId()); |
|
|
|
if (CollectionUtils.isEmpty(result)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
List<String> userIds = result.stream().map(m -> m.getUserId()).collect(Collectors.toList()); |
|
|
|
Result<List<UserBaseInfoResultDTO>> listResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); |
|
|
|
if (!listResult.success()){ |
|
|
|
throw new RenException("议题审核历史查询用户基本信息失败......"); |
|
|
|
} |
|
|
|
result.forEach(r -> listResult.getData().stream().filter(u -> r.getUserId().equals(u.getUserId())).forEach(u -> r.setStaffName(u.getRealName()))); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
} |