Commit 25e48b25 authored by hanbing's avatar hanbing

[update] 信号机管理,新增路口ID改为路网ID

parent bd6de449
......@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
* @author Kent HAN
* @date 2022/11/25 10:21
......@@ -13,7 +11,7 @@ import java.util.Date;
@Data
@ApiModel(value = "CrossInfoInsertOrUpdateDTO", description = "信号机新增或修改输入参数")
public class CrossInfoInsertOrUpdateDTO {
@ApiModelProperty(value = "路口ID。不传ID为新增,传ID为修改",notes = "")
@ApiModelProperty(value = "路口ID",notes = "")
private String id ;
/** 信号机编号 */
@ApiModelProperty(required = true, value = "信号机编号",notes = "")
......
......@@ -31,4 +31,6 @@ public interface CrossInfoMapper {
void deleteBatch(@Param("ids") List<String> ids);
void updateOneByCodeAndManufacturerId(CrossInfoPO crossInfoPO);
void deleteById(String id);
}
package net.wanji.utc.service.systemadmin.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import net.wanji.utc.common.exception.IpPortException;
import net.wanji.utc.common.exception.PortFormatException;
import net.wanji.utc.dto.systemadmin.CrossInfoInsertOrUpdateDTO;
import net.wanji.utc.dto.systemadmin.CrossInfoListDTO;
import net.wanji.utc.dto.systemadmin.DeleteByStringIdListDTO;
import net.wanji.utc.mapper.CrossInfoMapper;
import net.wanji.utc.mapper.ManufacturerInfoMapper;
import net.wanji.utc.po.CrossInfoPO;
......@@ -15,7 +15,6 @@ import net.wanji.utc.po.ManufacturerInfoPO;
import net.wanji.utc.service.systemadmin.CrossInfoService;
import net.wanji.utc.util.PageUtils;
import net.wanji.utc.vo.systemadmin.CrossInfoListVO;
import net.wanji.utc.dto.systemadmin.DeleteByStringIdListDTO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -100,13 +99,11 @@ public class CrossInfoServiceImpl implements CrossInfoService {
crossInfoPO.setInstallTime(installTime);
String id = inVO.getId();
if (id == null || "".equals(id)) {
// 添加
crossInfoPO.setId(IdUtil.simpleUUID());
if (id != null) {
// 删除旧记录
crossInfoMapper.deleteById(id);
// 插入新纪录
crossInfoMapper.insertOne(crossInfoPO);
} else {
// 修改
crossInfoMapper.updateOne(crossInfoPO);
}
}
......
......@@ -106,6 +106,11 @@
</foreach>
</delete>
<delete id="deleteById">
delete from t_cross_info
where id = #{id}
</delete>
<select id="selectByPrimaryKey" resultMap="BaseResultMap">
select
id,name,code,manufacturer_id,ip,port,location,version,model,install_time,gmt_create,gmt_modified
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment