|
|
|
@ -114,12 +114,13 @@ public class TerminalServiceImpl implements TerminalService {
|
|
|
|
|
Date time = new Date();
|
|
|
|
|
int i = terminalsDao.insertList(terminals, CommonStatus.EFFECTIVE.value(), time, time);
|
|
|
|
|
Integer termid = terminals.getId();
|
|
|
|
|
List<Integer> channelid = vo.getChannelid();
|
|
|
|
|
if (!BeanUtil.isEmpty(channelid) && channelid.size() > 0) {
|
|
|
|
|
List<TerminalVo.Item> channelId = vo.getChannelId();
|
|
|
|
|
if (CollectionUtil.isNotEmpty(channelId)) {
|
|
|
|
|
List<TerminalChannelMapper> list = new ArrayList<>();
|
|
|
|
|
for (Integer id : channelid) {
|
|
|
|
|
for (TerminalVo.Item item : channelId) {
|
|
|
|
|
TerminalChannelMapper record = new TerminalChannelMapper();
|
|
|
|
|
record.setChannelId(id);
|
|
|
|
|
record.setChannelId(item.getId());
|
|
|
|
|
record.setAlias(item.getChannelName());
|
|
|
|
|
record.setTermId(termid);
|
|
|
|
|
list.add(record);
|
|
|
|
|
}
|
|
|
|
@ -142,17 +143,17 @@ public class TerminalServiceImpl implements TerminalService {
|
|
|
|
|
@Override
|
|
|
|
|
public ServiceBody<String> updateTerminal(UpdateTerminalVo vo) {
|
|
|
|
|
Integer termid = vo.getId();
|
|
|
|
|
List<Integer> channelid = vo.getChannelid();
|
|
|
|
|
List<UpdateTerminalVo.Item> channelId = vo.getChannelId();
|
|
|
|
|
Terminals terminals = new Terminals();
|
|
|
|
|
BeanUtil.copyProperties(vo, terminals, true);
|
|
|
|
|
int i = terminalsDao.updateByPrimaryKeySelective(terminals, new Date());
|
|
|
|
|
|
|
|
|
|
terminalChannelMapperDao.deleteByTermId(termid);
|
|
|
|
|
if (!CollectionUtil.isEmpty(channelid)) {
|
|
|
|
|
if (!CollectionUtil.isNotEmpty(channelId)) {
|
|
|
|
|
List<TerminalChannelMapper> list = new ArrayList<>();
|
|
|
|
|
for (Integer id : channelid) {
|
|
|
|
|
for (UpdateTerminalVo.Item item : channelId) {
|
|
|
|
|
TerminalChannelMapper record = new TerminalChannelMapper();
|
|
|
|
|
record.setChannelId(id);
|
|
|
|
|
record.setChannelId(item.getId());
|
|
|
|
|
record.setAlias(item.getChannelName());
|
|
|
|
|
record.setTermId(termid);
|
|
|
|
|
list.add(record);
|
|
|
|
|
}
|
|
|
|
|