|
@@ -12,23 +12,20 @@ import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.failure.vo.IotFailureReportProcessVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.failure.vo.IotFailureReportProcessVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.bom.vo.IotMaintainBomSaveReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.bom.vo.IotMaintainBomSaveReqVO;
|
|
-import cn.iocoder.yudao.module.pms.controller.admin.maintain.material.vo.IotMaintainMaterialPageReqVO;
|
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainPageReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainSaveReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainSaveReqVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainSaveVO;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.maintain.vo.IotMaintainSaveVO;
|
|
-import cn.iocoder.yudao.module.pms.controller.admin.stat.IotStaticController;
|
|
|
|
import cn.iocoder.yudao.module.pms.controller.admin.stat.vo.OrderVo;
|
|
import cn.iocoder.yudao.module.pms.controller.admin.stat.vo.OrderVo;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotDeviceDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.IotProductClassifyDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.failure.IotFailureReportDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.failure.IotFailureReportDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.information.IotInformationDbDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.information.IotInformationDbDO;
|
|
-import cn.iocoder.yudao.module.pms.dal.dataobject.inspect.IotInspectRouteDO;
|
|
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotlockstock.IotLockStockDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotlockstock.IotLockStockDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotoutbound.IotOutboundDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.iotoutbound.IotOutboundDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainBomDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainBomDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainMaterialsDO;
|
|
import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.IotMaintainMaterialsDO;
|
|
-import cn.iocoder.yudao.module.pms.dal.dataobject.maintain.material.IotMaintainMaterialDO;
|
|
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.dataobject.oa.IotOaPersonDO;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.failure.IotFailureReportMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.failure.IotFailureReportMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.information.IotInformationDbMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.information.IotInformationDbMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotlockstock.IotLockStockMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.iotlockstock.IotLockStockMapper;
|
|
@@ -37,7 +34,11 @@ import cn.iocoder.yudao.module.pms.dal.mysql.maintain.IotMaintainBomMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.maintain.IotMaintainMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.maintain.IotMaintainMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.maintain.IotMaintainMaterialsMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.maintain.IotMaintainMaterialsMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.maintain.material.IotMaintainMaterialMapper;
|
|
import cn.iocoder.yudao.module.pms.dal.mysql.maintain.material.IotMaintainMaterialMapper;
|
|
|
|
+import cn.iocoder.yudao.module.pms.dal.mysql.oa.IotOaPersonMapper;
|
|
import cn.iocoder.yudao.module.pms.enums.common.FailureAuditStatusEnum;
|
|
import cn.iocoder.yudao.module.pms.enums.common.FailureAuditStatusEnum;
|
|
|
|
+import cn.iocoder.yudao.module.pms.oa.CallBackOaVo;
|
|
|
|
+import cn.iocoder.yudao.module.pms.oa.OaFlow;
|
|
|
|
+import cn.iocoder.yudao.module.pms.oa.OaVo;
|
|
import cn.iocoder.yudao.module.pms.service.IotDeviceService;
|
|
import cn.iocoder.yudao.module.pms.service.IotDeviceService;
|
|
import cn.iocoder.yudao.module.pms.service.IotProductClassifyService;
|
|
import cn.iocoder.yudao.module.pms.service.IotProductClassifyService;
|
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
|
@@ -47,7 +48,6 @@ import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
|
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
|
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
-import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
|
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -64,9 +64,11 @@ import java.math.BigDecimal;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.concurrent.CompletableFuture;
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
-import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.*;
|
|
|
|
|
|
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_MAINTAIN_BOMS_NOT_EXISTS;
|
|
|
|
+import static cn.iocoder.yudao.module.pms.enums.ErrorCodeConstant.IOT_MAINTAIN_NOT_EXISTS;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 维修工单 Service 实现类
|
|
* 维修工单 Service 实现类
|
|
@@ -109,6 +111,10 @@ public class IotMaintainServiceImpl implements IotMaintainService {
|
|
private IotInformationDbMapper iotInformationDbMapper;
|
|
private IotInformationDbMapper iotInformationDbMapper;
|
|
@Resource
|
|
@Resource
|
|
private DeptService deptService;
|
|
private DeptService deptService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private IotOaPersonMapper iotOaPersonMapper;
|
|
|
|
+ @Autowired
|
|
|
|
+ private OaFlow oaFlow;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void approvalMaintain(Long businessKey, Integer bpmStatus) {
|
|
public void approvalMaintain(Long businessKey, Integer bpmStatus) {
|
|
@@ -152,9 +158,11 @@ public class IotMaintainServiceImpl implements IotMaintainService {
|
|
IotMaintainDO iotMaintain = BeanUtils.toBean(createReqVO.getMaintain(), IotMaintainDO.class);
|
|
IotMaintainDO iotMaintain = BeanUtils.toBean(createReqVO.getMaintain(), IotMaintainDO.class);
|
|
iotMaintain.setFailureCode("GZ"+ DateUtil.format(new Date(), "yyyyMMddHHmmss"));
|
|
iotMaintain.setFailureCode("GZ"+ DateUtil.format(new Date(), "yyyyMMddHHmmss"));
|
|
iotMaintain.setFailureName(createReqVO.getMaintain().getDeviceCode()+createReqVO.getMaintain().getDeviceName()+DateUtil.format(new Date(), "yyyyMMddHHmmss"));
|
|
iotMaintain.setFailureName(createReqVO.getMaintain().getDeviceCode()+createReqVO.getMaintain().getDeviceName()+DateUtil.format(new Date(), "yyyyMMddHHmmss"));
|
|
-// if (Objects.nonNull(iotMaintain.getAuditStatus())&&iotMaintain.getAuditStatus()==20&&"out".equals(iotMaintain.getType())){
|
|
|
|
|
|
+ if ("out".equals(iotMaintain.getType())){
|
|
|
|
+ iotMaintain.setStatus("oa");
|
|
|
|
+ } else {
|
|
iotMaintain.setStatus("finished");
|
|
iotMaintain.setStatus("finished");
|
|
-// }
|
|
|
|
|
|
+ }
|
|
iotMaintain.setDeleted(false);
|
|
iotMaintain.setDeleted(false);
|
|
iotMaintain.setMaintainPerson(SecurityFrameworkUtils.getLoginUserId());
|
|
iotMaintain.setMaintainPerson(SecurityFrameworkUtils.getLoginUserId());
|
|
if (Objects.isNull(SecurityFrameworkUtils.getLoginUserId())) throw new ServiceException(new ErrorCode(11,"责任人id不存在"));
|
|
if (Objects.isNull(SecurityFrameworkUtils.getLoginUserId())) throw new ServiceException(new ErrorCode(11,"责任人id不存在"));
|
|
@@ -201,14 +209,13 @@ public class IotMaintainServiceImpl implements IotMaintainService {
|
|
// sendMessage(BeanUtils.toBean(iotMaintain, IotMaintainDO.class), "maintain-report", msg);
|
|
// sendMessage(BeanUtils.toBean(iotMaintain, IotMaintainDO.class), "maintain-report", msg);
|
|
// }
|
|
// }
|
|
//如果委外发起流程
|
|
//如果委外发起流程
|
|
-// if ("out".equals(createReqVO.getMaintain().getType())){
|
|
|
|
-// String processInstanceId = processInstanceApi.createProcessInstance(SecurityFrameworkUtils.getLoginUserId(),
|
|
|
|
-// new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY).setBusinessKey(String.valueOf(iotMaintain.getId())));
|
|
|
|
-// // 将流程实例id 更新到维修工单主数据表
|
|
|
|
-// iotMaintainMapper.updateById(new IotMaintainDO().setId(iotMaintain.getId()).setProcessInstanceId(processInstanceId).setAuditStatus(FailureAuditStatusEnum.PROCESS.getStatus()));
|
|
|
|
-// String msg = "【PMS】有新的委外维修流程, 请前往系统审批";
|
|
|
|
-//// sendMessage(BeanUtils.toBean(iotMaintain, IotMaintainDO.class), "maintain-out", msg);
|
|
|
|
-// }
|
|
|
|
|
|
+ if ("out".equals(createReqVO.getMaintain().getType())){
|
|
|
|
+ try {
|
|
|
|
+ oaFlow.createOutRepairFlow(iotMaintain);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ServiceException(122, e.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//异步写入故障知识库
|
|
//异步写入故障知识库
|
|
CompletableFuture.runAsync(()->{
|
|
CompletableFuture.runAsync(()->{
|
|
IotDeviceDO iotDevice = iotDeviceService.getIotDevice(iotMaintain.getDeviceId());
|
|
IotDeviceDO iotDevice = iotDeviceService.getIotDevice(iotMaintain.getDeviceId());
|
|
@@ -420,4 +427,160 @@ public class IotMaintainServiceImpl implements IotMaintainService {
|
|
IPage<OrderVo> notices = iotMaintainMapper.selectNotice(Page.of(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO);
|
|
IPage<OrderVo> notices = iotMaintainMapper.selectNotice(Page.of(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO);
|
|
return new PageResult<>(notices.getRecords(), notices.getTotal());
|
|
return new PageResult<>(notices.getRecords(), notices.getTotal());
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void oaDeal(CallBackOaVo callBackOaVo) {
|
|
|
|
+ List<IotMaintainDO> iotMaintainDOS = iotMaintainMapper.selectList("request_id", callBackOaVo.getRequestId());
|
|
|
|
+ if (CollUtil.isEmpty(iotMaintainDOS)) {
|
|
|
|
+ throw new ServiceException(new ErrorCode(300,"无该流程"));
|
|
|
|
+ }
|
|
|
|
+ IotMaintainDO iotMaintainDO = iotMaintainDOS.get(0);
|
|
|
|
+ iotMaintainDO.setOaFlowNo(callBackOaVo.getFlowNo());
|
|
|
|
+ if ("0".equals(callBackOaVo.getIfSuccess())){
|
|
|
|
+ iotMaintainDO.setStatus("oareject");
|
|
|
|
+ } else {
|
|
|
|
+ iotMaintainDO.setStatus("finished");
|
|
|
|
+ }
|
|
|
|
+ iotMaintainDO.setSuggestionJson(JSON.toJSONString(callBackOaVo.getMainData()));
|
|
|
|
+// List<OaVo.MainData> mainData = callBackOaVo.getMainData();
|
|
|
|
+// mainData.forEach(e -> {
|
|
|
|
+// if ("wxyy".equals(e.getFieldName())&&!iotMaintainDO.getMaintainDescription().equals(e.getFieldValue())) {
|
|
|
|
+// iotMaintainDO.setMaintainDescription(e.getFieldValue());
|
|
|
|
+// } else if ("ygjey".equals(e.getFieldName())&&!iotMaintainDO.getMaintainFee().toString().equals(e.getFieldValue())){
|
|
|
|
+// iotMaintainDO.setMaintainFee(new BigDecimal(e.getFieldValue()));
|
|
|
|
+// } else if ("wxdd".equals(e.getFieldName())&&!iotMaintainDO.getAddress().equals(e.getFieldValue())){
|
|
|
|
+// iotMaintainDO.setAddress(e.getFieldValue());
|
|
|
|
+// } else if ("ggxh".equals(e.getFieldName())&&!iotMaintainDO.getModel().equals(e.getFieldValue())) {
|
|
|
|
+// iotMaintainDO.setModel(e.getFieldValue());
|
|
|
|
+// } else if ("qyrq".equals(e.getFieldName())&&!iotMaintainDO.getEnableDate().equals(e.getFieldValue())) {
|
|
|
|
+// iotMaintainDO.setEnableDate(e.getFieldValue());
|
|
|
|
+// } else if ("wxlb".equals(e.getFieldName())&&!iotMaintainDO.getMaintainClassify().equals(e.getFieldValue())) {
|
|
|
|
+// iotMaintainDO.setMaintainClassify(e.getFieldValue());
|
|
|
|
+// } else if ("yzglxs".equals(e.getFieldName())&&!iotMaintainDO.getKmHour().equals(e.getFieldValue())) {
|
|
|
|
+// iotMaintainDO.setKmHour(e.getFieldValue());
|
|
|
|
+// } else if ("wxcj".equals(e.getFieldName())&&!iotMaintainDO.getSupplier().equals(e.getFieldValue())) {
|
|
|
|
+// iotMaintainDO.setSupplier(e.getFieldValue());
|
|
|
|
+// } else if ("gzms".equals(e.getFieldName())&&!iotMaintainDO.getDescription().equals(e.getFieldValue())) {
|
|
|
|
+// iotMaintainDO.setDescription(e.getFieldValue());
|
|
|
|
+// } else if ("wxxm".equals(e.getFieldName())&&!iotMaintainDO.getMaintainItem().equals(e.getFieldValue())) {
|
|
|
|
+// iotMaintainDO.setMaintainItem(e.getFieldValue());
|
|
|
|
+// }
|
|
|
|
+// });
|
|
|
|
+ iotMaintainMapper.updateById(iotMaintainDO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<IotOaPersonDO> getMaintainPerson(String id) {
|
|
|
|
+ Long loginUserId;
|
|
|
|
+ if (StringUtils.isBlank(id)||"undefined".equals(id)) {
|
|
|
|
+ loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
|
+ } else {
|
|
|
|
+ loginUserId = Long.valueOf(id);
|
|
|
|
+ }
|
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(loginUserId);
|
|
|
|
+ if (Objects.isNull(user)) {
|
|
|
|
+ throw new ServiceException(new ErrorCode(666,"用户不存在"));
|
|
|
|
+ }
|
|
|
|
+ List<IotOaPersonDO> currentUser;
|
|
|
|
+ if ("admin".equals(user.getUsername())) {
|
|
|
|
+ currentUser = iotOaPersonMapper.selectList().stream().filter(e -> "0".equals(e.getStatus()) || "1".equals(e.getStatus()) || "2".equals(e.getStatus()) || "3".equals(e.getStatus())).collect(Collectors.toList());
|
|
|
|
+ return currentUser;
|
|
|
|
+ } else {
|
|
|
|
+ String workcode = user.getUsername();
|
|
|
|
+ currentUser = iotOaPersonMapper.selectList("workcode", workcode);
|
|
|
|
+ }
|
|
|
|
+ if (CollUtil.isNotEmpty(currentUser)) {
|
|
|
|
+ return currentUser;
|
|
|
|
+ }
|
|
|
|
+ Long deptId = user.getDeptId();
|
|
|
|
+ DeptRespDTO dept = deptApi.getDept(deptId);
|
|
|
|
+ String name = dept.getName();
|
|
|
|
+ String companyCode = "";
|
|
|
|
+ if (name.contains("瑞恒")) {
|
|
|
|
+ companyCode = "6000";
|
|
|
|
+ } else if (name.contains("瑞都")) {
|
|
|
|
+ companyCode = "5020";
|
|
|
|
+ } else if (name.contains("瑞鹰")) {
|
|
|
|
+ companyCode = "6010";
|
|
|
|
+ } else {
|
|
|
|
+ DeptRespDTO dept1 = deptApi.getDept(dept.getParentId());
|
|
|
|
+ String name1 = dept1.getName();
|
|
|
|
+ if (name1.contains("瑞恒")) {
|
|
|
|
+ companyCode = "6000";
|
|
|
|
+ } else if (name1.contains("瑞都")) {
|
|
|
|
+ companyCode = "5020";
|
|
|
|
+ } else if (name1.contains("瑞鹰")) {
|
|
|
|
+ companyCode = "6010";
|
|
|
|
+ } else {
|
|
|
|
+ DeptRespDTO dept2 = deptApi.getDept(dept1.getParentId());
|
|
|
|
+ String name2 = dept2.getName();
|
|
|
|
+ if (name2.contains("瑞恒")) {
|
|
|
|
+ companyCode = "6000";
|
|
|
|
+ } else if (name2.contains("瑞都")) {
|
|
|
|
+ companyCode = "5020";
|
|
|
|
+ } else if (name2.contains("瑞鹰")) {
|
|
|
|
+ companyCode = "6010";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<IotOaPersonDO> companyUsers = iotOaPersonMapper.selectList("subcompanycode", companyCode);
|
|
|
|
+ List<IotOaPersonDO> result = companyUsers.stream().filter(e -> "0".equals(e.getStatus()) || "1".equals(e.getStatus()) || "2".equals(e.getStatus()) || "3".equals(e.getStatus())).collect(Collectors.toList());
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public List<IotOaPersonDO> getProjectPerson(String id) {
|
|
|
|
+ Long loginUserId;
|
|
|
|
+ if (StringUtils.isBlank(id)||"undefined".equals(id)) {
|
|
|
|
+ loginUserId = SecurityFrameworkUtils.getLoginUserId();
|
|
|
|
+ } else {
|
|
|
|
+ loginUserId = Long.valueOf(id);
|
|
|
|
+ }
|
|
|
|
+ AdminUserRespDTO user = adminUserApi.getUser(loginUserId);
|
|
|
|
+ if (Objects.isNull(user)) {
|
|
|
|
+ throw new ServiceException(new ErrorCode(666,"用户不存在"));
|
|
|
|
+ }
|
|
|
|
+ List<IotOaPersonDO> currentUser = Collections.emptyList();
|
|
|
|
+ if ("admin".equals(user.getUsername())) {
|
|
|
|
+ currentUser = iotOaPersonMapper.selectList().stream().filter(e -> "0".equals(e.getStatus()) || "1".equals(e.getStatus()) || "2".equals(e.getStatus()) || "3".equals(e.getStatus())).collect(Collectors.toList());
|
|
|
|
+ return currentUser;
|
|
|
|
+ }
|
|
|
|
+ if (CollUtil.isNotEmpty(currentUser)) {
|
|
|
|
+ return currentUser;
|
|
|
|
+ }
|
|
|
|
+ Long deptId = user.getDeptId();
|
|
|
|
+ DeptRespDTO dept = deptApi.getDeptNoPermission(deptId);
|
|
|
|
+ String name = dept.getName();
|
|
|
|
+ String companyCode = "";
|
|
|
|
+ if (name.contains("瑞恒")) {
|
|
|
|
+ companyCode = "6000";
|
|
|
|
+ } else if (name.contains("瑞都")) {
|
|
|
|
+ companyCode = "5020";
|
|
|
|
+ } else if (name.contains("瑞鹰")) {
|
|
|
|
+ companyCode = "6010";
|
|
|
|
+ } else {
|
|
|
|
+ Long parentId = dept.getParentId();
|
|
|
|
+ DeptRespDTO dept1 = deptApi.getDeptNoPermission(parentId);
|
|
|
|
+ String name1 = dept1.getName();
|
|
|
|
+ if (name1.contains("瑞恒")) {
|
|
|
|
+ companyCode = "6000";
|
|
|
|
+ } else if (name1.contains("瑞都")) {
|
|
|
|
+ companyCode = "5020";
|
|
|
|
+ } else if (name1.contains("瑞鹰")) {
|
|
|
|
+ companyCode = "6010";
|
|
|
|
+ } else {
|
|
|
|
+ DeptRespDTO dept2 = deptApi.getDeptNoPermission(dept1.getParentId());
|
|
|
|
+ String name2 = dept2.getName();
|
|
|
|
+ if (name2.contains("瑞恒")) {
|
|
|
|
+ companyCode = "6000";
|
|
|
|
+ } else if (name2.contains("瑞都")) {
|
|
|
|
+ companyCode = "5020";
|
|
|
|
+ } else if (name2.contains("瑞鹰")) {
|
|
|
|
+ companyCode = "6010";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ List<IotOaPersonDO> companyUsers = iotOaPersonMapper.selectList("subcompanycode", companyCode);
|
|
|
|
+ List<IotOaPersonDO> result = companyUsers.stream().filter(e -> "0".equals(e.getStatus()) || "1".equals(e.getStatus()) || "2".equals(e.getStatus()) || "3".equals(e.getStatus())).collect(Collectors.toList());
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
}
|
|
}
|