|
|
@@ -1,15 +1,23 @@
|
|
|
package com.xunmei.core.safetyCheck.service.impl;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.xunmei.common.core.constant.SecurityConstants;
|
|
|
import com.xunmei.common.core.utils.DateUtils;
|
|
|
+import com.xunmei.common.core.vo.IdNameVo;
|
|
|
import com.xunmei.core.safetyCheck.domain.CoreSafecheckPlanToExecOrg;
|
|
|
import com.xunmei.core.safetyCheck.mapper.CoreSafecheckPlanToExecOrgMapper;
|
|
|
import com.xunmei.core.safetyCheck.service.ICoreSafecheckPlanToExecOrgService;
|
|
|
+import com.xunmei.system.api.RemoteOrgService;
|
|
|
+import com.xunmei.system.api.domain.SysOrg;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
@@ -26,8 +34,8 @@ import com.xunmei.common.core.web.page.TableDataInfo;
|
|
|
public class CoreSafecheckPlanToExecOrgServiceImpl extends ServiceImpl<CoreSafecheckPlanToExecOrgMapper, CoreSafecheckPlanToExecOrg> implements ICoreSafecheckPlanToExecOrgService {
|
|
|
@Autowired
|
|
|
private CoreSafecheckPlanToExecOrgMapper coreSafecheckPlanToExecOrgMapper;
|
|
|
-// @Autowired
|
|
|
-// private ISysOrgService orgService;
|
|
|
+ @Autowired
|
|
|
+ private RemoteOrgService remoteOrgService;
|
|
|
|
|
|
@Override
|
|
|
public TableDataInfo<CoreSafecheckPlanToExecOrg> selectPage(CoreSafecheckPlanToExecOrg coreSafecheckPlanToExecOrg) {
|
|
|
@@ -75,6 +83,25 @@ public class CoreSafecheckPlanToExecOrgServiceImpl extends ServiceImpl<CoreSafec
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 获取计划指定检查机构的行社列表。非指定机构返回空列表
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<SysOrg> getDesignateHangshe(Long planId){
|
|
|
+ LambdaQueryWrapper<CoreSafecheckPlanToExecOrg> wrapper= new LambdaQueryWrapper<CoreSafecheckPlanToExecOrg>();
|
|
|
+ wrapper.eq(CoreSafecheckPlanToExecOrg::getPlanId,planId);
|
|
|
+ List<CoreSafecheckPlanToExecOrg> data= baseMapper.selectList(wrapper);
|
|
|
+ if(CollectionUtil.isEmpty(data)){
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Long> orgIds= data.stream().map(CoreSafecheckPlanToExecOrg::getOrgId).collect(Collectors.toList());
|
|
|
+ List<SysOrg> hsOrgs= remoteOrgService.selectParentHs(orgIds, SecurityConstants.INNER);
|
|
|
+
|
|
|
+ return hsOrgs;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 查询常规安全检查-检查机构关系列表
|
|
|
*
|
|
|
* @param coreSafecheckPlanToExecOrg 常规安全检查-检查机构关系
|