|
@@ -6,6 +6,7 @@ import com.its.op.dto.its.common.NewIdIntegerDto;
|
|
|
import com.its.op.dto.its.common.UsageCountDto;
|
|
import com.its.op.dto.its.common.UsageCountDto;
|
|
|
import com.its.op.dto.its.vms.TbVmsSymbLibDto;
|
|
import com.its.op.dto.its.vms.TbVmsSymbLibDto;
|
|
|
import com.its.op.entity.its.vms.TbVmsSymbLib;
|
|
import com.its.op.entity.its.vms.TbVmsSymbLib;
|
|
|
|
|
+import com.its.op.global.TbVmsSymbLibManager;
|
|
|
import com.its.utils.ItsUtils;
|
|
import com.its.utils.ItsUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
@@ -22,13 +23,15 @@ public class TbVmsSymbLibService {
|
|
|
private final Integer maxNmbr;
|
|
private final Integer maxNmbr;
|
|
|
private final TbVmsSymbLibRepository repo;
|
|
private final TbVmsSymbLibRepository repo;
|
|
|
private final TbVmsFormObjectRepository formObjectRepository;
|
|
private final TbVmsFormObjectRepository formObjectRepository;
|
|
|
|
|
+ private final TbVmsSymbLibManager manager;
|
|
|
|
|
|
|
|
- public TbVmsSymbLibService(String symbType, Integer minNmbr, Integer maxNmbr, TbVmsSymbLibRepository repo, TbVmsFormObjectRepository formObjectRepository) {
|
|
|
|
|
|
|
+ public TbVmsSymbLibService(String symbType, Integer minNmbr, Integer maxNmbr, TbVmsSymbLibRepository repo, TbVmsFormObjectRepository formObjectRepository, TbVmsSymbLibManager manager) {
|
|
|
this.SYMB_TYPE = symbType;
|
|
this.SYMB_TYPE = symbType;
|
|
|
this.minNmbr = minNmbr;
|
|
this.minNmbr = minNmbr;
|
|
|
this.maxNmbr = maxNmbr;
|
|
this.maxNmbr = maxNmbr;
|
|
|
this.repo = repo;
|
|
this.repo = repo;
|
|
|
this.formObjectRepository = formObjectRepository;
|
|
this.formObjectRepository = formObjectRepository;
|
|
|
|
|
+ this.manager = manager;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 데이터 1건 조회, 없으면 exception
|
|
// 데이터 1건 조회, 없으면 exception
|
|
@@ -47,8 +50,7 @@ public class TbVmsSymbLibService {
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public List<TbVmsSymbLibDto> findAllSymbolImage() {
|
|
public List<TbVmsSymbLibDto> findAllSymbolImage() {
|
|
|
-
|
|
|
|
|
- String saveDir = ItsUtils.createUserDir("/image/vms/");
|
|
|
|
|
|
|
+ //String saveDir = ItsUtils.createUserDir("/image/vms/");
|
|
|
List<TbVmsSymbLibDto> result = new ArrayList<>();
|
|
List<TbVmsSymbLibDto> result = new ArrayList<>();
|
|
|
List<TbVmsSymbLib> data = this.repo.findAllSymbolImage(this.SYMB_TYPE);
|
|
List<TbVmsSymbLib> data = this.repo.findAllSymbolImage(this.SYMB_TYPE);
|
|
|
if (data != null) {
|
|
if (data != null) {
|
|
@@ -69,6 +71,7 @@ public class TbVmsSymbLibService {
|
|
|
result.add(entity.toDto());
|
|
result.add(entity.toDto());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ this.manager.refresh(data);
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -86,6 +89,7 @@ public class TbVmsSymbLibService {
|
|
|
req.setUpdtDt(ItsUtils.getSysTime()); // 현재시각으로 업데이트
|
|
req.setUpdtDt(ItsUtils.getSysTime()); // 현재시각으로 업데이트
|
|
|
entity.updateInfo(req);
|
|
entity.updateInfo(req);
|
|
|
this.repo.save(entity);
|
|
this.repo.save(entity);
|
|
|
|
|
+ this.manager.put(entity.getSymbLibNmbr(), entity);
|
|
|
return entity.toDto();
|
|
return entity.toDto();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -99,6 +103,9 @@ public class TbVmsSymbLibService {
|
|
|
TbVmsSymbLib obj = req.toEntity();
|
|
TbVmsSymbLib obj = req.toEntity();
|
|
|
this.repo.save(obj);
|
|
this.repo.save(obj);
|
|
|
result.add(obj.toDto());
|
|
result.add(obj.toDto());
|
|
|
|
|
+
|
|
|
|
|
+ TbVmsSymbLib entity = requireOne(req.getSymbLibNmbr());
|
|
|
|
|
+ this.manager.put(entity.getSymbLibNmbr(), entity);
|
|
|
}
|
|
}
|
|
|
return result;
|
|
return result;
|
|
|
}
|
|
}
|
|
@@ -113,6 +120,10 @@ public class TbVmsSymbLibService {
|
|
|
req.setUpdtDt(ItsUtils.getSysTime()); // 현재시각으로 업데이트
|
|
req.setUpdtDt(ItsUtils.getSysTime()); // 현재시각으로 업데이트
|
|
|
TbVmsSymbLib obj = req.toEntity();
|
|
TbVmsSymbLib obj = req.toEntity();
|
|
|
this.repo.save(obj);
|
|
this.repo.save(obj);
|
|
|
|
|
+
|
|
|
|
|
+ TbVmsSymbLib entity = requireOne(req.getSymbLibNmbr());
|
|
|
|
|
+ this.manager.put(entity.getSymbLibNmbr(), entity);
|
|
|
|
|
+
|
|
|
return obj.toDto();
|
|
return obj.toDto();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -120,6 +131,7 @@ public class TbVmsSymbLibService {
|
|
|
public TbVmsSymbLibDto deleteById(Integer id) {
|
|
public TbVmsSymbLibDto deleteById(Integer id) {
|
|
|
TbVmsSymbLib entity = requireOne(id);
|
|
TbVmsSymbLib entity = requireOne(id);
|
|
|
this.repo.deleteById(id);
|
|
this.repo.deleteById(id);
|
|
|
|
|
+ this.manager.remove(id);
|
|
|
return entity.toDto();
|
|
return entity.toDto();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -130,6 +142,7 @@ public class TbVmsSymbLibService {
|
|
|
Optional<TbVmsSymbLib> obj = this.repo.findById(id);
|
|
Optional<TbVmsSymbLib> obj = this.repo.findById(id);
|
|
|
if (obj.isPresent()) {
|
|
if (obj.isPresent()) {
|
|
|
this.repo.deleteById(id);
|
|
this.repo.deleteById(id);
|
|
|
|
|
+ this.manager.remove(id);
|
|
|
result.add(obj.get().toDto());
|
|
result.add(obj.get().toDto());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|