|
|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package cn.iocoder.yudao.module.mes.service.deviceledger;
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
|
|
|
|
|
import cn.iocoder.yudao.module.erp.dal.mysql.product.ErpProductMapper;
|
|
|
|
|
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.controller.admin.ticketmanagement.enums.PlanTypeEnum;
|
|
|
|
|
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
|
|
|
|
|
@ -58,6 +60,9 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
|
|
|
|
|
@Resource
|
|
|
|
|
private CriticalComponentMapper criticalComponentMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private ErpProductMapper productMapper;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Long createDeviceLedger(DeviceLedgerSaveReqVO createReqVO) {
|
|
|
|
|
|
|
|
|
|
@ -172,9 +177,22 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
|
|
|
|
|
deviceLedgerDO.setComponentList(componentList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//备件列表
|
|
|
|
|
List<ErpProductDO> beijianList = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isNotBlank(deviceLedgerDO.getBeijianId())) {
|
|
|
|
|
// 将逗号分隔的字符串转换为Long类型的List
|
|
|
|
|
List<Long> idList = Arrays.stream(deviceLedgerDO.getBeijianId().split(","))
|
|
|
|
|
.map(String::trim) // 去除可能存在的空格
|
|
|
|
|
.map(Long::valueOf)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
for (Long beijianId : idList) {
|
|
|
|
|
ErpProductDO beijianDO = productMapper.selectById(beijianId);
|
|
|
|
|
if(beijianDO!=null){
|
|
|
|
|
beijianList.add(beijianDO);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
deviceLedgerDO.setBeijianList(beijianList);
|
|
|
|
|
}
|
|
|
|
|
return deviceLedgerDO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|