|
|
@ -22,9 +22,11 @@ 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.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.dao.IssueApplicationDao; |
|
|
@ -32,6 +34,7 @@ import com.epmet.dto.IssueApplicationDTO; |
|
|
|
import com.epmet.dto.form.AuditListFormDTO; |
|
|
|
import com.epmet.dto.form.IssueAppQueryFormDTO; |
|
|
|
import com.epmet.dto.form.UserPubAuditingIssueFormDTO; |
|
|
|
import com.epmet.dto.result.AllIssueListResultDTO; |
|
|
|
import com.epmet.dto.result.AuditListResultDTO; |
|
|
|
import com.epmet.dto.result.IssueApplicationResDTO; |
|
|
|
import com.epmet.dto.result.UserPubAuditingIssueResDTO; |
|
|
@ -46,11 +49,13 @@ import com.epmet.service.IssueApplicationService; |
|
|
|
import com.epmet.utils.ModuleConstants; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -62,6 +67,7 @@ import java.util.Map; |
|
|
|
* @since v1.0.0 2020-11-17 |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
@Slf4j |
|
|
|
public class IssueApplicationServiceImpl extends BaseServiceImpl<IssueApplicationDao, IssueApplicationEntity> implements IssueApplicationService { |
|
|
|
|
|
|
|
@Override |
|
|
@ -196,7 +202,34 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl<IssueApplicatio |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<AuditListResultDTO> auditList(AuditListFormDTO formDTO) { |
|
|
|
return null; |
|
|
|
if (StringUtils.isBlank(formDTO.getOrgId())){ |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId()); |
|
|
|
if (null == staffInfo){ |
|
|
|
throw new EpmetException("查询工作人员信息失败:"+formDTO.getUserId()); |
|
|
|
} |
|
|
|
formDTO.setOrgId(staffInfo.getAgencyId()); |
|
|
|
formDTO.setOrgType(ModuleConstants.ISSUE_PROCESS_ORG_TYPE_AGENCY); |
|
|
|
} |
|
|
|
PageData<AuditListResultDTO> result = new PageData<>(new ArrayList(),NumConstant.ZERO_L); |
|
|
|
if (formDTO.getIsPage()){ |
|
|
|
PageInfo<AuditListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.auditList(formDTO)); |
|
|
|
result.setList(pageInfo.getList()); |
|
|
|
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal()))); |
|
|
|
}else { |
|
|
|
List<AuditListResultDTO> auditListResultDTOS = baseDao.auditList(formDTO); |
|
|
|
result.setList(auditListResultDTOS); |
|
|
|
result.setTotal(auditListResultDTOS.size()); |
|
|
|
} |
|
|
|
if (CollectionUtils.isNotEmpty(result.getList())){ |
|
|
|
result.getList().forEach(l -> { |
|
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); |
|
|
|
if(null == gridInfo){ |
|
|
|
throw new EpmetException("查询网格信息失败:"+l.getGridId()); |
|
|
|
} |
|
|
|
l.setGridName(gridInfo.getGridNamePath()); |
|
|
|
}); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -208,14 +241,15 @@ public class IssueApplicationServiceImpl extends BaseServiceImpl<IssueApplicatio |
|
|
|
List<IssueApplicationDTO> list = pageInfo.getList(); |
|
|
|
size = list.size(); |
|
|
|
if (CollectionUtils.isNotEmpty(list)){ |
|
|
|
list.forEach(l -> { |
|
|
|
for (IssueApplicationDTO l : list) { |
|
|
|
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(l.getGridId()); |
|
|
|
if (null == gridInfo){ |
|
|
|
throw new EpmetException("查询网格信息失败:"+l.getGridId()); |
|
|
|
log.warn("查询网格信息失败:"+l.getGridId()); |
|
|
|
continue; |
|
|
|
} |
|
|
|
l.setOrgId(gridInfo.getPid()); |
|
|
|
l.setOrgIdPath(gridInfo.getPids()); |
|
|
|
}); |
|
|
|
} |
|
|
|
updateIssueApplication(list); |
|
|
|
} |
|
|
|
no++; |
|
|
|