欣影管理平台装置通道表修改

jni
liuguijing 2 years ago
parent 15c446926c
commit 77b104587a

@ -115,7 +115,12 @@
<version>5.7.20</version> <version>5.7.20</version>
</dependency> </dependency>
<!--JNA:调用本地dll-->
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.9.0</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>

@ -93,6 +93,12 @@
<artifactId>pagehelper-spring-boot-starter</artifactId> <artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency> </dependency>
<!--JNA:调用本地dll-->
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

@ -12,5 +12,11 @@ import java.util.List;
public class TerminalChannelIdListVo { public class TerminalChannelIdListVo {
@NotEmpty(message = "不能传入空值") @NotEmpty(message = "不能传入空值")
@ApiModelProperty(value = "通道编号数组", required = true, example = "A0001") @ApiModelProperty(value = "通道编号数组", required = true, example = "A0001")
private List<Integer> list; private List<ChannelIdItem> list;
@Data
private static class ChannelIdItem {
@ApiModelProperty(value = "通道编号", example = "123")
private Integer id;
}
} }

@ -31,23 +31,18 @@ public class TerminalVo {
private String cmdid; private String cmdid;
@ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678") @ApiModelProperty(value = "原始 ID各厂家内部识别号", example = "12345678")
@NotBlank(message = "各厂家内部识别号不能缺少")
private Short orgId; private Short orgId;
@ApiModelProperty(value = "装置名称", example = "名称名称") @ApiModelProperty(value = "装置名称", example = "名称名称")
@NotBlank(message = "装置名称不能缺少")
private String equipName; private String equipName;
@ApiModelProperty(value = "显示名", example = "名称名称") @ApiModelProperty(value = "显示名", example = "名称名称")
@NotBlank(message = "显示名不能缺少")
private String displayName; private String displayName;
@ApiModelProperty(value = "装置型号", example = "型号型号") @ApiModelProperty(value = "装置型号", example = "型号型号")
@NotBlank(message = "装置型号不能缺少")
private String model; private String model;
@ApiModelProperty(value = "装置基本信息版本号", example = "型号型号") @ApiModelProperty(value = "装置基本信息版本号", example = "型号型号")
@NotBlank(message = "装置基本信息版本号不能缺少")
private String essentialInfoVersion; private String essentialInfoVersion;
@ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台") @ApiModelProperty(value = "是否带云台", example = " 0 不带云台 1带云台")
@ -55,23 +50,18 @@ public class TerminalVo {
private Byte hasPan; private Byte hasPan;
@ApiModelProperty(value = "生产厂家", example = "生产厂家") @ApiModelProperty(value = "生产厂家", example = "生产厂家")
@NotBlank(message = "生产厂家不能缺少")
private String bsManufacturer; private String bsManufacturer;
@ApiModelProperty(value = "生产日期", example = "2022-06-12") @ApiModelProperty(value = "生产日期", example = "2022-06-12")
@NotBlank(message = "生产日期不能缺少")
private Date bsProductionDate; private Date bsProductionDate;
@ApiModelProperty(value = "出厂编号", example = "123456") @ApiModelProperty(value = "出厂编号", example = "123456")
@NotBlank(message = "出厂编号不能缺少")
private String bsIdentifier; private String bsIdentifier;
@ApiModelProperty(value = "纬度", example = "21321") @ApiModelProperty(value = "纬度", example = "21321")
@NotBlank(message = "纬度不能缺少")
private Double latitude; private Double latitude;
@ApiModelProperty(value = "经度", example = "213") @ApiModelProperty(value = "经度", example = "213")
@NotBlank(message = "经度不能缺少")
private Double longitude; private Double longitude;
} }

@ -16,8 +16,8 @@ public class UpdateTerminalChannelVo {
private Integer id; private Integer id;
@NotNull(message = "通道编号不能缺少") @NotNull(message = "通道编号不能缺少")
@ApiModelProperty(value = "通道编号", example = "123455") @ApiModelProperty(value = "通道名称", example = "123455")
private Integer channelname; private String channelname;
@NotNull(message = "通道编号状态") @NotNull(message = "通道编号状态")
@ApiModelProperty(value = "通道状态", example = "0---关闭 1--开启") @ApiModelProperty(value = "通道状态", example = "0---关闭 1--开启")

@ -22,6 +22,6 @@ public interface TerminalChannelsDao {
int updateByPrimaryKeySelective(@Param("data") TerminalChannels record,@Param("updateat") Date update); int updateByPrimaryKeySelective(@Param("data") TerminalChannels record,@Param("updateat") Date update);
int deleteList(@Param("list") List<Integer> list,@Param("status") Integer status,@Param("updateat") Date update); int deleteList(@Param("list") List<TerminalChannels> list,@Param("status") Integer status,@Param("updateat") Date update);
} }

@ -196,9 +196,9 @@
update_time = #{updateat}, update_time = #{updateat},
</if> </if>
</set> </set>
where where id in
<foreach collection="list" item="id" index="index" open="(" close=")" separator=","> <foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{id} #{item.id}
</foreach> </foreach>
</update> </update>
</mapper> </mapper>

@ -140,17 +140,115 @@
<insert id="insertList"> <insert id="insertList">
insert into terminals insert into terminals
(line_id,tower_id,cmdid, org_id, equip_name, display_name, model, essential_info_version, has_pan, <foreach collection="list" item="item" index="index" separator=",">
bs_manufacturer, bs_production_date, bs_identifier, latitude, longitude,status, create_time, <if test="index == 0">
update_time) <trim prefix="(" suffix=") values " suffixOverrides=",">
VALUES <if test="#{item.lineid} != null">
<foreach collection="list" item="item" separator=","> line_id,
(#{item.lineid},#{item.towerid},#{item.cmdid}, </if>
#{item.orgId},#{item.equipName},#{item.displayName}, <if test="#{item.towerid} != null">
#{item.model},#{item.essentialInfoVersion},#{item.hasPan}, tower_id,
#{item.bsManufacturer},#{item.bsProductionDate},#{item.bsIdentifier}, </if>
#{item.latitude},#{item.longitude},#{status}, <if test="#{item.cmdid} != null">
#{createat},#{updateat}) cmdid,
</if>
<if test="#{item.orgId} != null">
org_id,
</if>
<if test="#{item.equipName} != null">
equip_name,
</if>
<if test="#{item.displayName} != null">
display_name,
</if>
<if test="#{item.model} != null">
model,
</if>
<if test="#{item.essentialInfoVersion} != null">
essential_info_version,
</if>
<if test="#{item.hasPan} != null">
has_pan,
</if>
<if test="#{item.bsManufacturer} != null">
bs_manufacturer,
</if>
<if test="#{item.bsProductionDate} != null">
bs_production_date,
</if>
<if test="#{item.bsIdentifier} != null">
bs_identifier,
</if>
<if test="#{item.latitude} != null">
latitude,
</if>
<if test="#{item.longitude} != null">
longitude,
</if>
<if test="#{status} != null">
status,
</if>
<if test="#{createat} != null">
create_time,
</if>
<if test="#{updateat} != null">
update_time,
</if>
</trim>
</if>
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="#{item.lineid} != null">
#{item.lineid},
</if>
<if test="#{item.towerid} != null">
#{item.towerid},
</if>
<if test="#{item.cmdid} != null">
#{item.cmdid},
</if>
<if test="#{item.orgId} != null">
#{item.orgId},
</if>
<if test="#{item.equipName} != null">
#{item.equipName},
</if>
<if test="#{item.displayName} != null">
#{item.displayName},
</if>
<if test="#{item.model} != null">
#{item.model},
</if>
<if test="#{item.essentialInfoVersion} != null">
#{item.essentialInfoVersion},
</if>
<if test="#{item.hasPan} != null">
#{item.hasPan},
</if>
<if test="#{item.bsManufacturer} != null">
#{item.bsManufacturer},
</if>
<if test="#{item.bsProductionDate} != null">
#{item.bsProductionDate},
</if>
<if test="#{item.bsIdentifier} != null">
#{item.bsIdentifier},
</if>
<if test="#{item.latitude} != null">
#{item.latitude},
</if>
<if test="#{item.longitude} != null">
#{item.longitude},
</if>
<if test="#{status} != null">
#{status},
</if>
<if test="#{createat} != null">
#{createat},
</if>
<if test="#{updateat} != null">
#{updateat},
</if>
</trim>
</foreach> </foreach>
</insert> </insert>

@ -7,6 +7,7 @@ import com.github.pagehelper.PageInfo;
import com.shxy.xymanager_common.bean.ServiceBody; import com.shxy.xymanager_common.bean.ServiceBody;
import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto; import com.shxy.xymanager_common.dto.DyLineAndTerminalAndChannelDto;
import com.shxy.xymanager_common.dto.TermChannelAndMapperDto; import com.shxy.xymanager_common.dto.TermChannelAndMapperDto;
import com.shxy.xymanager_common.entity.Lines;
import com.shxy.xymanager_common.entity.TerminalChannels; import com.shxy.xymanager_common.entity.TerminalChannels;
import com.shxy.xymanager_common.enums.CommonStatus; import com.shxy.xymanager_common.enums.CommonStatus;
import com.shxy.xymanager_common.exception.Asserts; import com.shxy.xymanager_common.exception.Asserts;
@ -61,7 +62,8 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
*/ */
@Override @Override
public ServiceBody<String> updateChannelList(UpdateTerminalChannelVo vo) { public ServiceBody<String> updateChannelList(UpdateTerminalChannelVo vo) {
TerminalChannels bean = BeanUtil.copyProperties(vo, TerminalChannels.class); TerminalChannels bean = new TerminalChannels();
BeanUtil.copyProperties(vo, bean,CopyOptions.create().ignoreCase());
int i = terminalChannelsDao.updateByPrimaryKeySelective(bean, new Date()); int i = terminalChannelsDao.updateByPrimaryKeySelective(bean, new Date());
if (i != 0) { if (i != 0) {
return Asserts.success("修改成功"); return Asserts.success("修改成功");
@ -70,9 +72,15 @@ public class TerminalChannelServiceImpl implements TerminalChannelService {
} }
} }
/**
*
* @param vo
* @return
*/
@Override @Override
public ServiceBody<String> deleteChannelList(TerminalChannelIdListVo vo) { public ServiceBody<String> deleteChannelList(TerminalChannelIdListVo vo) {
int i = terminalChannelsDao.deleteList(vo.getList(), CommonStatus.DELETE.value(), new Date()); List<TerminalChannels> list = BeanUtil.copyToList(vo.getList(), TerminalChannels.class);
int i = terminalChannelsDao.deleteList(list, CommonStatus.DELETE.value(), new Date());
if (i != 0) { if (i != 0) {
return Asserts.success("删除成功"); return Asserts.success("删除成功");
} else { } else {

Loading…
Cancel
Save