机具类型优化

This commit is contained in:
sxu 2024-10-29 16:34:11 +08:00
parent 15ac3613cd
commit a9eb35b238
1 changed files with 24 additions and 19 deletions

View File

@ -12,10 +12,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -94,24 +91,32 @@ public class MaTypeServiceImpl implements ITypeService {
typeFileMapper.insertMaTypeFile(typeFile1); typeFileMapper.insertMaTypeFile(typeFile1);
} }
// 库管员配置 // 库管员配置
MaTypeKeeper typeKeeper = new MaTypeKeeper(); if (Objects.nonNull(maType.getKeeperUserId())) {
typeKeeper.setUserId(maType.getKeeperUserId()); MaTypeKeeper typeKeeper = new MaTypeKeeper();
typeKeeper.setTypeId(typeId); typeKeeper.setUserId(maType.getKeeperUserId());
typeKeeper.setCreateTime(DateUtils.getNowDate()); typeKeeper.setTypeId(typeId);
maTypeMapper.insertKeeper(typeKeeper); typeKeeper.setCreateTime(DateUtils.getNowDate());
maTypeMapper.insertKeeper(typeKeeper);
}
// 维修员配置 // 维修员配置
MaTypeRepair typeRepair = new MaTypeRepair(); if (Objects.nonNull(maType.getRepairUserId())) {
typeRepair.setUserId(maType.getRepairUserId()); MaTypeRepair typeRepair = new MaTypeRepair();
typeRepair.setTypeId(typeId); typeRepair.setUserId(maType.getRepairUserId());
typeRepair.setCreateTime(DateUtils.getNowDate()); typeRepair.setTypeId(typeId);
maTypeMapper.insertRepair(typeRepair); typeRepair.setCreateTime(DateUtils.getNowDate());
maTypeMapper.insertRepair(typeRepair);
}
// 资产属性配置 // 资产属性配置
MaPropSet propSet = new MaPropSet(); if (maType.getPropId() > 0) {
propSet.setTypeId(typeId); MaPropSet propSet = new MaPropSet();
propSet.setPropId(maType.getPropId()); propSet.setTypeId(typeId);
propSet.setCreateTime(DateUtils.getNowDate()); propSet.setPropId(maType.getPropId());
maTypeMapper.insertMaPropSet(propSet); propSet.setCreateTime(DateUtils.getNowDate());
maTypeMapper.insertMaPropSet(propSet);
}
return i; return i;
} }