新增装置别名的修改

master
liuguijing 2 years ago
parent 3438605c57
commit 295d491b3f

@ -13,6 +13,8 @@ public class TerminalChannelMapper implements Serializable {
private Integer channelId;
private String alias;
private Date createTime;
private Date updateTime;

@ -6,6 +6,7 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
@ -13,20 +14,20 @@ import java.util.List;
@ApiModel(value = "装置信息对象", description = "设备信息对象描述")
public class TerminalVo {
@ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineid;
private Integer lineId;
@ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerid;
private Integer towerId;
@ApiModelProperty(value = "通道编号", example = "[{id:int , alias:dskafjl},{id,alias}]")
private List<Integer> channelid;
private List<Item> channelId;
@ApiModelProperty(value = "sim卡号", example = "123456")
private String sim;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
@NotBlank(message = "图像监测装置不能缺少")
private String cmdid;
private String cmdId;
@ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678")
private Short orgId;
@ -61,4 +62,16 @@ public class TerminalVo {
@ApiModelProperty(value = "经度", example = "213")
private Double longitude;
@Data
public static class Item {
@NotNull(message = "通道编号")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer id;
@NotNull(message = "通道编号不能缺少")
@ApiModelProperty(value = "通道编号", example = "123455")
private String channelName;
}
}

@ -19,20 +19,20 @@ public class UpdateTerminalVo {
private Integer id;
@ApiModelProperty(value = "线路编号", example = "123456")
private Integer lineid;
private Integer lineId;
@ApiModelProperty(value = "杆塔编号", example = "123456")
private Integer towerid;
private Integer towerId;
@ApiModelProperty(value = "通道编号", example = "123456")
private List<Integer> channelid;
private List<Item> channelId;
@ApiModelProperty(value = "sim卡号", example = "123456")
private String sim;
@ApiModelProperty(value = "图像监测装置 ID17 位编码)", example = "12345678")
@NotBlank(message = "图像监测装置不能缺少")
private String cmdid;
private String cmdId;
@ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678")
private Short orgId;
@ -67,4 +67,17 @@ public class UpdateTerminalVo {
@ApiModelProperty(value = "经度", example = "213")
private Double longitude;
@Data
public static class Item {
@NotNull(message = "通道编号")
@ApiModelProperty(value = "装置编号", example = "123455")
private Integer id;
@NotNull(message = "通道编号不能缺少")
@ApiModelProperty(value = "通道编号", example = "123455")
private String channelName;
}
}

@ -5,6 +5,7 @@
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="term_id" jdbcType="INTEGER" property="termId"/>
<result column="channel_id" jdbcType="INTEGER" property="channelId"/>
<result column="alias" jdbcType="VARCHAR" property="alias"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
@ -75,11 +76,11 @@
<insert id="insertList" parameterType="java.util.List">
insert into terminal_channel_mapper
(term_id, channel_id,
(term_id, channel_id,alias,
create_time, update_time)
VALUES
<foreach collection="list" item="item" separator=",">
(#{item.termId},#{item.channelId},#{createat},#{updateat})
(#{item.termId},#{item.channelId},#{item.alias},#{createat},#{updateat})
</foreach>
</insert>

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalParamsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -15,14 +12,4 @@ import org.springframework.stereotype.Service;
@Slf4j
public class TerminalParamsServiceImpl implements TerminalParamsService {
@Override
public ServiceBody<TerminalListModel> getTerminalList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
}

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalPresetsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -15,14 +12,4 @@ import org.springframework.stereotype.Service;
@Slf4j
public class TerminalPresetServiceImpl implements TerminalPresetsService {
@Override
public ServiceBody<TerminalListModel> getTerminalList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
}

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_service.service.TerminalScheduleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -15,13 +12,4 @@ import org.springframework.stereotype.Service;
@Slf4j
public class TerminalScheduleServiceImpl implements TerminalScheduleService {
@Override
public ServiceBody<TerminalListModel> getScheduleList() {
return null;
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
}

@ -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);
}

@ -9,7 +9,6 @@ import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalVo;
import com.shxy.xymanager_dao.dao.TerminalsDao;
import com.shxy.xymanager_service.service.TerminalStatusService;
import lombok.extern.slf4j.Slf4j;
@ -52,11 +51,6 @@ public class TerminalStatusServiceImpl implements TerminalStatusService {
return Asserts.success(terminalListModel);
}
@Override
public ServiceBody<String> addTerminal(TerminalVo terminalVo) {
return null;
}
/**
*

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
/**
*
@ -10,18 +7,5 @@ import com.shxy.xymanager_common.vo.TerminalVo;
* @author
*/
public interface TerminalParamsService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
}

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
/**
*
@ -10,18 +7,5 @@ import com.shxy.xymanager_common.vo.TerminalVo;
* @author
*/
public interface TerminalPresetsService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
}

@ -1,8 +1,5 @@
package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalVo;
/**
*
@ -10,18 +7,5 @@ import com.shxy.xymanager_common.vo.TerminalVo;
* @author
*/
public interface TerminalScheduleService {
/**
*
*
* @return
*/
ServiceBody<TerminalListModel> getScheduleList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
}

@ -3,7 +3,6 @@ package com.shxy.xymanager_service.service;
import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.model.TerminalListModel;
import com.shxy.xymanager_common.vo.TerminalIdListVo;
import com.shxy.xymanager_common.vo.TerminalVo;
/**
*
@ -18,13 +17,6 @@ public interface TerminalStatusService {
*/
ServiceBody<TerminalListModel> getTerminalList();
/**
*
*
* @return
*/
ServiceBody<String> addTerminal(TerminalVo terminalVo);
/**
*
* @param vo

Loading…
Cancel
Save