机具类型优化

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