|
|
|
|
@ -16,6 +16,7 @@ import cn.iocoder.yudao.module.mes.controller.admin.orgworker.vo.OrgWorkerPageRe
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.organization.OrganizationDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.orgworker.OrgWorkerDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.deviceledger.DeviceLedgerMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.organization.OrganizationMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.mysql.orgworker.OrgWorkerMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.redis.no.MesNoRedisDAO;
|
|
|
|
|
@ -28,6 +29,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
|
|
|
|
|
@ -66,6 +68,9 @@ public class OrganizationServiceImpl implements OrganizationService {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private DeviceLedgerService deviceLedgerService;
|
|
|
|
|
@Resource
|
|
|
|
|
@Lazy
|
|
|
|
|
private DeviceLedgerMapper deviceLedgerMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private AutoCodeUtil autoCodeUtil;
|
|
|
|
|
@ -731,4 +736,46 @@ public class OrganizationServiceImpl implements OrganizationService {
|
|
|
|
|
.build();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// OrganizationServiceImpl.java
|
|
|
|
|
@Override
|
|
|
|
|
public OrganizationRespVO getOrganizationVO(Long id) {
|
|
|
|
|
OrganizationDO organization = organizationMapper.selectById(id);
|
|
|
|
|
if (organization == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OrganizationRespVO respVO = BeanUtils.toBean(organization, OrganizationRespVO.class);
|
|
|
|
|
|
|
|
|
|
if (organization.getMachineId() != null) {
|
|
|
|
|
DeviceLedgerDO ledger = deviceLedgerMapper.selectByIdWithDeleted(organization.getMachineId());
|
|
|
|
|
if (ledger != null) {
|
|
|
|
|
String machineName = (ledger.getDeviceCode() == null ? "" : ledger.getDeviceCode())
|
|
|
|
|
+ "-"
|
|
|
|
|
+ (ledger.getDeviceName() == null ? "" : ledger.getDeviceName());
|
|
|
|
|
if (Boolean.TRUE.equals(ledger.getDeleted())) {
|
|
|
|
|
machineName += "(已被删除)";
|
|
|
|
|
}
|
|
|
|
|
respVO.setMachineName(machineName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (organization.getDvId() != null) {
|
|
|
|
|
DeviceDO device = deviceMapper.selectByIdWithDeleted(organization.getDvId());
|
|
|
|
|
if (device != null) {
|
|
|
|
|
String deviceName = (device.getDeviceCode() == null ? "" : device.getDeviceCode())
|
|
|
|
|
+ "-"
|
|
|
|
|
+ (device.getDeviceName() == null ? "" : device.getDeviceName());
|
|
|
|
|
if (Boolean.TRUE.equals(device.getDeleted())) {
|
|
|
|
|
deviceName += "(已被删除)";
|
|
|
|
|
}
|
|
|
|
|
respVO.setDvName(deviceName);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return respVO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|