添加用户
This commit is contained in:
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -27,6 +28,10 @@ public class CsDevModelAddParm {
|
||||
@ApiModelProperty(value = "装置型号")
|
||||
private String devType;
|
||||
|
||||
@ApiModelProperty(value = "装置型号")
|
||||
@NotBlank(message="装置型号名称不能为空!")
|
||||
private String devTypeName;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "模板名称")
|
||||
private String name;
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -28,6 +29,8 @@ public class CsDevModelAuditParm {
|
||||
*/
|
||||
@ApiModelProperty(value = "装置型号")
|
||||
private String devType;
|
||||
@ApiModelProperty(value = "装置型号")
|
||||
private String devTypeName;
|
||||
@ApiModelProperty(value = "模板名称")
|
||||
private String name;
|
||||
/**
|
||||
|
||||
@@ -31,6 +31,9 @@ public class CsEdDataAddParm {
|
||||
@ApiModelProperty(value = "装置型号")
|
||||
@NotBlank(message="装置型号不能为空!")
|
||||
private String devType;
|
||||
@ApiModelProperty(value = "装置型号")
|
||||
@NotBlank(message="装置型号名称不能为空!")
|
||||
private String devTypeName;
|
||||
@ApiModelProperty(value = "装置类型")
|
||||
private String type;
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -30,6 +31,8 @@ public class CsEdDataAuditParm {
|
||||
*/
|
||||
@ApiModelProperty(value = "装置型号")
|
||||
private String devType;
|
||||
@ApiModelProperty(value = "装置型号")
|
||||
private String devTypeName;
|
||||
@ApiModelProperty(value = "装置类型")
|
||||
private String type;
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,9 @@ public class CsDevModelPO extends BaseEntity {
|
||||
@TableField(value = "dev_type")
|
||||
private String devType;
|
||||
|
||||
@TableField(value = "dev_type_name")
|
||||
private String devTypeName;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
|
||||
@@ -37,6 +37,10 @@ public class CsEdDataPO extends BaseEntity {
|
||||
*/
|
||||
@TableField(value = "dev_type")
|
||||
private String devType;
|
||||
|
||||
@TableField(value = "dev_type_name")
|
||||
private String devTypeName;
|
||||
|
||||
/**
|
||||
* 装置类型(直连设备、网关设备)
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ public class AppProjectVO {
|
||||
/**
|
||||
* 拓扑图路径
|
||||
*/
|
||||
private List<String> topologyDiagramPaths;
|
||||
private List<AppTopologyDiagramVO> topologyDiagramPaths;
|
||||
|
||||
/**
|
||||
* 中心点经度
|
||||
|
||||
@@ -32,8 +32,8 @@ public class CsDevModelPageVO extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "设备模板型号id")
|
||||
private String devType;
|
||||
@ApiModelProperty(value = "设备模板型号id名称")
|
||||
private String devName;
|
||||
private String devTypeName;
|
||||
|
||||
@ApiModelProperty(value = "模板名称")
|
||||
private String name;
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ public class CsEdDataVO extends BaseEntity {
|
||||
*/
|
||||
@ApiModelProperty(value = "装置型号")
|
||||
private String devType;
|
||||
@ApiModelProperty(value = "装置名称")
|
||||
private String devName;
|
||||
private String devTypeName;
|
||||
|
||||
@ApiModelProperty(value = "装置类型")
|
||||
private String type;
|
||||
|
||||
|
||||
@@ -20,10 +20,8 @@
|
||||
id, dev_type, version_no, version_date, file_path, create_by, create_time, update_by,
|
||||
update_time, `status`
|
||||
</sql><select id="getPage" resultType="com.njcn.csdevice.pojo.vo.CsDevModelPageVO">
|
||||
SELECT a.*,
|
||||
b.code as devName
|
||||
SELECT a.*
|
||||
FROM cs_dev_model a
|
||||
LEFT JOIN sys_dict_data b ON a.dev_type = b.id
|
||||
WHERE
|
||||
1 = 1 And a.`status`='1'
|
||||
<if test="csDevModelQueryParm.versionStartDate != null and csDevModelQueryParm.versionStartDate != ''">
|
||||
@@ -34,7 +32,7 @@
|
||||
</if>
|
||||
|
||||
<if test="csDevModelQueryParm.devName != null and csDevModelQueryParm.devName != ''">
|
||||
AND b.CODE LIKE concat('%',#{csDevModelQueryParm.devName},'%')
|
||||
AND a.dev_type_name LIKE concat('%',#{csDevModelQueryParm.devName},'%')
|
||||
</if>
|
||||
<if test="csDevModelQueryParm.devType != null and csDevModelQueryParm.devType != ''">
|
||||
AND a.dev_type = #{csDevModelQueryParm.devType}
|
||||
@@ -43,10 +41,8 @@
|
||||
AND a.name = #{csDevModelQueryParm.name}
|
||||
</if>
|
||||
</select><select id="queryOne" resultType="com.njcn.csdevice.pojo.vo.CsDevModelPageVO">
|
||||
SELECT a.*,
|
||||
b.code as devName
|
||||
SELECT a.*
|
||||
FROM cs_dev_model a
|
||||
LEFT JOIN sys_dict_data b ON a.dev_type = b.id
|
||||
WHERE
|
||||
1 = 1 And a.`status`='1'
|
||||
<!-- <if test="csDevModelQueryListParm.versionStartDate != null and csDevModelQueryListParm.versionStartDate != ''">-->
|
||||
@@ -67,7 +63,7 @@
|
||||
AND a.dev_type = #{csDevModelQueryListParm.devType}
|
||||
</if>
|
||||
<if test="csDevModelQueryListParm.devName != null and csDevModelQueryListParm.devName != ''">
|
||||
AND b.code = #{csDevModelQueryListParm.devName}
|
||||
AND a.dev_type_name = #{csDevModelQueryListParm.devName}
|
||||
</if>
|
||||
<if test="csDevModelQueryListParm.name != null and csDevModelQueryListParm.name != ''">
|
||||
AND a.name = #{csDevModelQueryListParm.name}
|
||||
|
||||
@@ -24,10 +24,7 @@
|
||||
`status`, file_path, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
<select id="getPage" resultType="com.njcn.csdevice.pojo.vo.CsEdDataVO">
|
||||
SELECT a.*,
|
||||
b.code as devName
|
||||
FROM cs_ed_data a
|
||||
LEFT JOIN sys_dict_data b ON a.dev_type = b.id
|
||||
SELECT a.* FROM cs_ed_data a
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="csEdDataQueryParm.versionStartDate != null and csEdDataQueryParm.versionStartDate != ''">
|
||||
@@ -38,7 +35,7 @@
|
||||
</if>
|
||||
|
||||
<if test="csEdDataQueryParm.devName != null and csEdDataQueryParm.devName != ''">
|
||||
AND b.CODE LIKE concat('%',#{csEdDataQueryParm.devName},'%')
|
||||
AND a.dev_type_name LIKE concat('%',#{csEdDataQueryParm.devName},'%')
|
||||
</if>
|
||||
<if test="csEdDataQueryParm.devType != null and csEdDataQueryParm.devType != ''">
|
||||
AND a.dev_type = #{csEdDataQueryParm.devType}
|
||||
|
||||
@@ -6,12 +6,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.mapper.AppProjectMapper;
|
||||
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
|
||||
import com.njcn.csdevice.pojo.param.AppProjectAuditParm;
|
||||
import com.njcn.csdevice.pojo.param.AppProjectQueryParm;
|
||||
import com.njcn.csdevice.pojo.param.AppTopologyDiagramAddParm;
|
||||
import com.njcn.csdevice.pojo.param.*;
|
||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||
import com.njcn.csdevice.pojo.vo.AppProjectVO;
|
||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||
import com.njcn.csdevice.service.AppProjectService;
|
||||
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
@@ -21,6 +19,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
@@ -32,7 +31,7 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO> implements AppProjectService {
|
||||
class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO> implements AppProjectService {
|
||||
|
||||
private final AppProjectMapper appProjectMapper;
|
||||
private final AppTopologyDiagramService appTopologyDiagramService;
|
||||
@@ -104,6 +103,15 @@ public class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProj
|
||||
|
||||
Page<AppProjectVO> returnpage = new Page<> (appProjectQueryParm.getCurrentPage ( ), appProjectQueryParm.getPageSize ( ));
|
||||
returnpage = appProjectMapper.getPageVo (returnpage, appProjectQueryParm);
|
||||
List<AppProjectVO> collect = returnpage.getRecords().stream().map(temp -> {
|
||||
AppTopologyDiagramQueryParm appTopologyDiagramQueryParm = new AppTopologyDiagramQueryParm();
|
||||
appTopologyDiagramQueryParm.setProjectId(temp.getId());
|
||||
List<AppTopologyDiagramVO> appTopologyDiagramVOList = appTopologyDiagramService.queryAppTopologyDiagram(appTopologyDiagramQueryParm);
|
||||
temp.setTopologyDiagramPaths(appTopologyDiagramVOList);
|
||||
return temp;
|
||||
}).collect(Collectors.toList());
|
||||
returnpage.setRecords(collect);
|
||||
|
||||
// Page<AppProjectPO> appProjectPOPage = new Page<> (appProjectQueryParm.getCurrentPage ( ), appProjectQueryParm.getPageSize ( ));
|
||||
// QueryWrapper<AppProjectPO> queryWrapper = new QueryWrapper ( );
|
||||
// queryWrapper.eq ("status", "1").
|
||||
|
||||
Reference in New Issue
Block a user