移动代码
This commit is contained in:
@@ -43,5 +43,8 @@ public class ProjectEquipmentVO {
|
|||||||
@ApiModelProperty(value = "设备名称")
|
@ApiModelProperty(value = "设备名称")
|
||||||
private String equipmentName;
|
private String equipmentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -48,8 +48,8 @@ public class CslineController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryLineByDevId")
|
@PostMapping("/queryLineByDevId")
|
||||||
@ApiOperation("项目查询通过id获取")
|
@ApiOperation("项目查询通过设备id获取")
|
||||||
@ApiImplicitParam(name = "id", value = "项目id集合", required = true)
|
@ApiImplicitParam(name = "id", value = "设备id集合", required = true)
|
||||||
public HttpResult<List<CsLinePO>> queryLineByDevId(@RequestParam String id){
|
public HttpResult<List<CsLinePO>> queryLineByDevId(@RequestParam String id){
|
||||||
String methodDescribe = getMethodDescribe("queryLineByDevId");
|
String methodDescribe = getMethodDescribe("queryLineByDevId");
|
||||||
List<CsLinePO> csLinePOS = csLinePOService.queryByDevId(id);
|
List<CsLinePO> csLinePOS = csLinePOService.queryByDevId(id);
|
||||||
|
|||||||
@@ -47,11 +47,11 @@ public class AppTopologyController extends BaseController {
|
|||||||
@PostMapping("/addAppTopologyDiagram")
|
@PostMapping("/addAppTopologyDiagram")
|
||||||
@ApiOperation("新增拓扑图")
|
@ApiOperation("新增拓扑图")
|
||||||
// @ApiImplicitParam(name = "appTopologyDiagramAddParm", value = "新增项目参数", required = true)
|
// @ApiImplicitParam(name = "appTopologyDiagramAddParm", value = "新增项目参数", required = true)
|
||||||
public HttpResult<Boolean> addAppTopologyDiagram(@Validated AppTopologyDiagramAddParm appTopologyDiagramAddParm){
|
public HttpResult<AppTopologyDiagramVO> addAppTopologyDiagram(@Validated AppTopologyDiagramAddParm appTopologyDiagramAddParm){
|
||||||
String methodDescribe = getMethodDescribe("addAppTopologyDiagram");
|
String methodDescribe = getMethodDescribe("addAppTopologyDiagram");
|
||||||
|
|
||||||
Boolean flag = appTopologyDiagramService.addAppTopologyDiagram(appTopologyDiagramAddParm);
|
AppTopologyDiagramVO vo = appTopologyDiagramService.addAppTopologyDiagram(appTopologyDiagramAddParm);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
a.id projectId,
|
a.id projectId,
|
||||||
a.name projectName,
|
a.name projectName,
|
||||||
b.id equipmentId,
|
b.id equipmentId,
|
||||||
b.name equipmentName
|
b.name equipmentName,
|
||||||
|
c.create_time createTime
|
||||||
FROM cs_project a,
|
FROM cs_project a,
|
||||||
cs_equipment_delivery b,
|
cs_equipment_delivery b,
|
||||||
cs_project_equipment c,
|
cs_project_equipment c,
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ public interface AppTopologyDiagramService extends IService<AppTopologyDiagramPO
|
|||||||
* @Author: clam
|
* @Author: clam
|
||||||
* @Date: 2023/3/27
|
* @Date: 2023/3/27
|
||||||
*/
|
*/
|
||||||
Boolean addAppTopologyDiagram(AppTopologyDiagramAddParm appTopologyDiagramAddParm);
|
AppTopologyDiagramVO addAppTopologyDiagram(AppTopologyDiagramAddParm appTopologyDiagramAddParm);
|
||||||
/**
|
/**
|
||||||
* @Description: AuditAppTopologyDiagram
|
* @Description: AuditAppTopologyDiagram
|
||||||
* @Param: [appTopologyDiagramAuditParm]
|
* @Param: [appTopologyDiagramAuditParm]
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
private final AppTopologyDiagramMapper appTopologyDiagramMapper;
|
private final AppTopologyDiagramMapper appTopologyDiagramMapper;
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public Boolean addAppTopologyDiagram(AppTopologyDiagramAddParm appTopologyDiagramAddParm) {
|
public AppTopologyDiagramVO addAppTopologyDiagram(AppTopologyDiagramAddParm appTopologyDiagramAddParm) {
|
||||||
AppTopologyDiagramPO appTopologyDiagramPO = new AppTopologyDiagramPO();
|
AppTopologyDiagramPO appTopologyDiagramPO = new AppTopologyDiagramPO();
|
||||||
|
|
||||||
MultipartFile file = appTopologyDiagramAddParm.getFile ( );
|
MultipartFile file = appTopologyDiagramAddParm.getFile ( );
|
||||||
@@ -58,7 +58,9 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
appTopologyDiagramPO.setName (appTopologyDiagramAddParm.getTopologyDiagramName ());
|
appTopologyDiagramPO.setName (appTopologyDiagramAddParm.getTopologyDiagramName ());
|
||||||
appTopologyDiagramPO.setStatus ("1");
|
appTopologyDiagramPO.setStatus ("1");
|
||||||
boolean save = this.save (appTopologyDiagramPO);
|
boolean save = this.save (appTopologyDiagramPO);
|
||||||
return save;
|
AppTopologyDiagramVO vo = new AppTopologyDiagramVO();
|
||||||
|
BeanUtils.copyProperties(appTopologyDiagramPO, vo);
|
||||||
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -92,7 +94,9 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
queryWrapper.eq ("status","1").
|
queryWrapper.eq ("status","1").
|
||||||
eq (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getId ()),"id",appTopologyDiagramAuditParm.getId ()).
|
eq (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getId ()),"id",appTopologyDiagramAuditParm.getId ()).
|
||||||
eq (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getProjectId ()),"project_id",appTopologyDiagramAuditParm.getProjectId ()).
|
eq (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getProjectId ()),"project_id",appTopologyDiagramAuditParm.getProjectId ()).
|
||||||
like (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getName ()),"name", appTopologyDiagramAuditParm.getName ());
|
like (StringUtils.isNotBlank (appTopologyDiagramAuditParm.getName ()),"name", appTopologyDiagramAuditParm.getName ()).
|
||||||
|
orderByDesc("create_time");
|
||||||
|
|
||||||
List<AppTopologyDiagramPO> list = this.list (queryWrapper);
|
List<AppTopologyDiagramPO> list = this.list (queryWrapper);
|
||||||
|
|
||||||
List<AppTopologyDiagramVO> collect = list.stream ( ).map (temp -> {
|
List<AppTopologyDiagramVO> collect = list.stream ( ).map (temp -> {
|
||||||
@@ -105,6 +109,7 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
return vo;
|
return vo;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect (Collectors.toList ( ));
|
||||||
return collect;
|
return collect;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -116,7 +121,9 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
QueryWrapper<AppTopologyDiagramPO> queryWrapper = new QueryWrapper<> ();
|
QueryWrapper<AppTopologyDiagramPO> queryWrapper = new QueryWrapper<> ();
|
||||||
queryWrapper.eq ("status","1").
|
queryWrapper.eq ("status","1").
|
||||||
eq (StringUtils.isNotBlank (appTopologyDiagramQueryPageParm.getProjectId ()),"project_id",appTopologyDiagramQueryPageParm.getProjectId ()).
|
eq (StringUtils.isNotBlank (appTopologyDiagramQueryPageParm.getProjectId ()),"project_id",appTopologyDiagramQueryPageParm.getProjectId ()).
|
||||||
like (StringUtils.isNotBlank (appTopologyDiagramQueryPageParm.getSearchValue ()),"name", appTopologyDiagramQueryPageParm.getSearchValue ());
|
like (StringUtils.isNotBlank (appTopologyDiagramQueryPageParm.getSearchValue ()),"name", appTopologyDiagramQueryPageParm.getSearchValue ()).
|
||||||
|
orderByDesc("create_time");
|
||||||
|
|
||||||
tempPage = appTopologyDiagramMapper.selectPage (tempPage, queryWrapper);
|
tempPage = appTopologyDiagramMapper.selectPage (tempPage, queryWrapper);
|
||||||
List<AppTopologyDiagramVO> collect = tempPage.getRecords ( ).stream ( ).map (temp -> {
|
List<AppTopologyDiagramVO> collect = tempPage.getRecords ( ).stream ( ).map (temp -> {
|
||||||
AppTopologyDiagramVO vo = new AppTopologyDiagramVO ( );
|
AppTopologyDiagramVO vo = new AppTopologyDiagramVO ( );
|
||||||
@@ -128,6 +135,7 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
return vo;
|
return vo;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect (Collectors.toList ( ));
|
||||||
returnpage.setRecords (collect);
|
returnpage.setRecords (collect);
|
||||||
|
returnpage.setTotal(tempPage.getTotal());
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
vo.setCityName (this.getAreaById (vo.getCity ()));
|
vo.setCityName (this.getAreaById (vo.getCity ()));
|
||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
return csEngineeringVOList;
|
return csEngineeringVOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,6 +103,8 @@ public class CsEngineeringServiceImpl extends ServiceImpl<CsEngineeringMapper, C
|
|||||||
return vo;
|
return vo;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect (Collectors.toList ( ));
|
||||||
returnPage.setRecords (collect);
|
returnPage.setRecords (collect);
|
||||||
|
returnPage.setTotal(tempPage.getTotal());
|
||||||
|
|
||||||
return returnPage;
|
return returnPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,8 @@ public class CsEquipmentAlarmPOServiceImpl extends ServiceImpl<CsEquipmentAlarmP
|
|||||||
return csEquipmentAlarmVO;
|
return csEquipmentAlarmVO;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
returnpage.setRecords(collect);
|
returnpage.setRecords(collect);
|
||||||
|
returnpage.setTotal(queryPage.getTotal());
|
||||||
|
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.csdevice.mapper.CsEquipmentTransferPOMapper;
|
import com.njcn.csdevice.mapper.CsEquipmentTransferPOMapper;
|
||||||
@@ -11,6 +12,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import springfox.documentation.spring.web.json.Json;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -34,7 +36,8 @@ public class CsEquipmentTransferPOServiceImpl extends ServiceImpl<CsEquipmentTra
|
|||||||
BeanUtils.copyProperties(csEquipmentTransferAddParm, csEquipmentTransferPO);
|
BeanUtils.copyProperties(csEquipmentTransferAddParm, csEquipmentTransferPO);
|
||||||
csEquipmentTransferPO.setStatus(DataStateEnum.ENABLE.getCode());
|
csEquipmentTransferPO.setStatus(DataStateEnum.ENABLE.getCode());
|
||||||
boolean save = this.save(csEquipmentTransferPO);
|
boolean save = this.save(csEquipmentTransferPO);
|
||||||
log.info("插入成功");
|
|
||||||
|
log.info("插入成功"+JSON.toJSONString(csEquipmentTransferPO));
|
||||||
|
|
||||||
return save;
|
return save;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.njcn.haronic.pojo.constant;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常量类
|
||||||
|
* @author qijian
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2022年11月11日 09:56
|
||||||
|
*/
|
||||||
|
public interface HarmonicConstant {
|
||||||
|
/***
|
||||||
|
* 组态Json文件oss路径
|
||||||
|
*/
|
||||||
|
String CONFIGURATIONPATH = "configuration/";
|
||||||
|
/***
|
||||||
|
* 组态Json文件oss文件名
|
||||||
|
*/
|
||||||
|
String CONFIGURATIONNAME = "configuration.json";
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
package com.njcn.haronic.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 10:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CsConfigurationParm {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态项目名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "组态项目名称")
|
||||||
|
@NotBlank(message="组态项目名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class CsConfigurationAuditParam extends CsConfigurationParm {
|
||||||
|
@ApiModelProperty("Id")
|
||||||
|
@NotBlank(message = "id不为空")
|
||||||
|
private String id;
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询实体
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class CsConfigurationQueryParam extends BaseParam {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.njcn.haronic.pojo.param;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:31【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CsPageParm {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态项目id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="组态项目id")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态页面名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="组态页面名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态页面文件路径
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "组态页面json文件")
|
||||||
|
private String jsonFile;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class CsPageParmAuditParam extends CsPageParm {
|
||||||
|
@ApiModelProperty("Id")
|
||||||
|
@NotBlank(message = "id不为空")
|
||||||
|
private String id;
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private String status;
|
||||||
|
}
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public static class CsPageParmQueryParam extends BaseParam {
|
||||||
|
@ApiModelProperty("pid")
|
||||||
|
private String pid;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package pojo.param;
|
package com.njcn.haronic.pojo.param;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.njcn.haronic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 10:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "cs_configuration")
|
||||||
|
public class CsConfigurationPO extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态项目名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "`name`")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 0:删除 1:正常
|
||||||
|
*/
|
||||||
|
@TableField(value = "`status`")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static final String COL_ID = "id";
|
||||||
|
|
||||||
|
public static final String COL_NAME = "name";
|
||||||
|
|
||||||
|
public static final String COL_STATUS = "status";
|
||||||
|
|
||||||
|
public static final String COL_CREATE_BY = "create_by";
|
||||||
|
|
||||||
|
public static final String COL_CREATE_TIME = "create_time";
|
||||||
|
|
||||||
|
public static final String COL_UPDATE_BY = "update_by";
|
||||||
|
|
||||||
|
public static final String COL_UPDATE_TIME = "update_time";
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.njcn.haronic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:13【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@ApiModel(description = "")
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "cs_net_dev")
|
||||||
|
public class CsNetDevPO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.INPUT)
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 装置型号
|
||||||
|
*/
|
||||||
|
@TableField(value = "dev_type")
|
||||||
|
@ApiModelProperty(value = "装置型号")
|
||||||
|
private String devType;
|
||||||
|
|
||||||
|
@TableField(value = "`time`")
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
private Date time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本号
|
||||||
|
*/
|
||||||
|
@TableField(value = "version")
|
||||||
|
@ApiModelProperty(value = "版本号")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统软件表Id
|
||||||
|
*/
|
||||||
|
@TableField(value = "soft_info_id")
|
||||||
|
@ApiModelProperty(value = "系统软件表Id")
|
||||||
|
private String softInfoId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程配置表Id
|
||||||
|
*/
|
||||||
|
@TableField(value = "prj_info_id")
|
||||||
|
@ApiModelProperty(value = "工程配置表Id")
|
||||||
|
private String prjInfoId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
@TableField(value = "`status`")
|
||||||
|
@ApiModelProperty(value = "状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@TableField(value = "create_by")
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@TableField(value = "create_time")
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@TableField(value = "update_by")
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
@TableField(value = "update_time")
|
||||||
|
@ApiModelProperty(value = "")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
public static final String COL_ID = "id";
|
||||||
|
|
||||||
|
public static final String COL_DEV_TYPE = "dev_type";
|
||||||
|
|
||||||
|
public static final String COL_TIME = "time";
|
||||||
|
|
||||||
|
public static final String COL_VERSION = "version";
|
||||||
|
|
||||||
|
public static final String COL_SOFT_INFO_ID = "soft_info_id";
|
||||||
|
|
||||||
|
public static final String COL_PRJ_INFO_ID = "prj_info_id";
|
||||||
|
|
||||||
|
public static final String COL_STATUS = "status";
|
||||||
|
|
||||||
|
public static final String COL_CREATE_BY = "create_by";
|
||||||
|
|
||||||
|
public static final String COL_CREATE_TIME = "create_time";
|
||||||
|
|
||||||
|
public static final String COL_UPDATE_BY = "update_by";
|
||||||
|
|
||||||
|
public static final String COL_UPDATE_TIME = "update_time";
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package com.njcn.haronic.pojo.po;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.util.Date;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:31【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "cs_page")
|
||||||
|
public class CsPagePO extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态项目id
|
||||||
|
*/
|
||||||
|
@TableField(value = "pid")
|
||||||
|
private String pid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态页面名称
|
||||||
|
*/
|
||||||
|
@TableField(value = "`name`")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态页面文件路径
|
||||||
|
*/
|
||||||
|
@TableField(value = "`path`")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态页面状态
|
||||||
|
*/
|
||||||
|
@TableField(value = "`status`")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static final String COL_ID = "id";
|
||||||
|
|
||||||
|
public static final String COL_PID = "pid";
|
||||||
|
|
||||||
|
public static final String COL_NAME = "name";
|
||||||
|
|
||||||
|
public static final String COL_PATH = "path";
|
||||||
|
|
||||||
|
public static final String COL_STATUS = "status";
|
||||||
|
|
||||||
|
public static final String COL_CREATE_BY = "create_by";
|
||||||
|
|
||||||
|
public static final String COL_CREATE_TIME = "create_time";
|
||||||
|
|
||||||
|
public static final String COL_UPDATE_BY = "update_by";
|
||||||
|
|
||||||
|
public static final String COL_UPDATE_TIME = "update_time";
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.njcn.haronic.pojo.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 10:35【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class CsConfigurationVO extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态项目名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "组态项目名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 0:删除 1:正常
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "组态项目状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.njcn.haronic.pojo.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:31【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class CsPageVO {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="id")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态项目id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="组态项目id")
|
||||||
|
private String pid;
|
||||||
|
@ApiModelProperty(value="组态项目名称")
|
||||||
|
private String configurationName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态页面名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="组态页面名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组态页面文件路径
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="组态页面文件路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
@JsonFormat(
|
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||||
|
)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
@JsonFormat(
|
||||||
|
pattern = "yyyy-MM-dd HH:mm:ss"
|
||||||
|
)
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package pojo.vo;
|
package com.njcn.haronic.pojo.vo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -68,6 +68,12 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-oss</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -0,0 +1,80 @@
|
|||||||
|
package com.njcn.harmonic.controller;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.harmonic.service.CsConfigurationService;
|
||||||
|
import com.njcn.minioss.bo.MinIoUploadResDTO;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.njcn.haronic.pojo.param.CsConfigurationParm;
|
||||||
|
import com.njcn.haronic.pojo.vo.CsConfigurationVO;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (cs_configuration)表控制层
|
||||||
|
*
|
||||||
|
* @author xxxxx
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/csconfiguration")
|
||||||
|
@Api(tags = "组态项目")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CsConfigurationController extends BaseController {
|
||||||
|
private final CsConfigurationService csConfigurationService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增组态项目")
|
||||||
|
@ApiImplicitParam(name = "csConfigurationParm", value = "新增组态项目参数", required = true)
|
||||||
|
public HttpResult<Boolean> add(@RequestBody @Validated CsConfigurationParm csConfigurationParm){
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
|
||||||
|
boolean save = csConfigurationService.add (csConfigurationParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/audit")
|
||||||
|
@ApiOperation("修改组态项目")
|
||||||
|
@ApiImplicitParam(name = "auditParm", value = "修改组态项目参数", required = true)
|
||||||
|
public HttpResult<Boolean> audit(@RequestBody @Validated CsConfigurationParm.CsConfigurationAuditParam auditParm){
|
||||||
|
String methodDescribe = getMethodDescribe("audit");
|
||||||
|
|
||||||
|
boolean save = csConfigurationService.audit (auditParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/queryPage")
|
||||||
|
@ApiOperation("组态项目分页查询")
|
||||||
|
@ApiImplicitParam(name = "csConfigurationQueryParam", value = "组态项目查询参数", required = true)
|
||||||
|
public HttpResult<IPage<CsConfigurationVO>> queryPage(@RequestBody @Validated CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam ){
|
||||||
|
String methodDescribe = getMethodDescribe("queryPage");
|
||||||
|
|
||||||
|
IPage<CsConfigurationVO> page = csConfigurationService.queryPage (csConfigurationQueryParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPLOAD)
|
||||||
|
@PostMapping("/uploadImage")
|
||||||
|
@ApiOperation("上传底图")
|
||||||
|
@ApiImplicitParam(name = "file", value = "底图文件", required = true)
|
||||||
|
public HttpResult<MinIoUploadResDTO> uploadImage(@RequestParam("file") MultipartFile issuesFile){
|
||||||
|
String methodDescribe = getMethodDescribe("uploadImage");
|
||||||
|
String filePath = csConfigurationService.uploadImage(issuesFile);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,new MinIoUploadResDTO(issuesFile.getOriginalFilename(),filePath), methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.njcn.harmonic.controller;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (cs_net_dev)表控制层
|
||||||
|
*
|
||||||
|
* @author xxxxx
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/csnetdev")
|
||||||
|
@Api(tags = "组态页面")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CsNetDevPOController extends BaseController {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.njcn.harmonic.controller;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.harmonic.service.CsPagePOService;
|
||||||
|
import com.njcn.haronic.pojo.vo.CsPageVO;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import com.njcn.haronic.pojo.param.CsConfigurationParm;
|
||||||
|
import com.njcn.haronic.pojo.param.CsPageParm;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import com.njcn.haronic.pojo.vo.CsConfigurationVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (cs_page)表控制层
|
||||||
|
*
|
||||||
|
* @author xxxxx
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cspage")
|
||||||
|
@Api(tags = "组态项目页面")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CsPagePOController extends BaseController {
|
||||||
|
private final CsPagePOService csPagePOService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增组态页面")
|
||||||
|
@ApiImplicitParam(name = "csPageParm", value = "新增组态项目参数", required = true)
|
||||||
|
public HttpResult<CsPageVO> add(@RequestBody @Validated CsPageParm csPageParm){
|
||||||
|
String methodDescribe = getMethodDescribe("add");
|
||||||
|
|
||||||
|
CsPageVO csPageVO = csPagePOService.add (csPageParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csPageVO, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/audit")
|
||||||
|
@ApiOperation("修改组态页面")
|
||||||
|
@ApiImplicitParam(name = "auditParm", value = "修改组态项目参数", required = true)
|
||||||
|
public HttpResult<Boolean> audit(@RequestBody @Validated CsPageParm.CsPageParmAuditParam auditParm){
|
||||||
|
String methodDescribe = getMethodDescribe("audit");
|
||||||
|
|
||||||
|
boolean save = csPagePOService.audit (auditParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/queryPage")
|
||||||
|
@ApiOperation("组态页面分页查询")
|
||||||
|
@ApiImplicitParam(name = "csPageParam", value = "组态项目查询参数", required = true)
|
||||||
|
public HttpResult<IPage<CsPageVO>> queryPage(@RequestBody @Validated CsPageParm.CsPageParmQueryParam csPageParam ){
|
||||||
|
String methodDescribe = getMethodDescribe("queryPage");
|
||||||
|
|
||||||
|
IPage<CsPageVO> page = csPagePOService.queryPage (csPageParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,8 +15,8 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import pojo.param.ThdDataQueryParm;
|
import com.njcn.haronic.pojo.param.ThdDataQueryParm;
|
||||||
import pojo.vo.ThdDataVO;
|
import com.njcn.haronic.pojo.vo.ThdDataVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.njcn.harmonic.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.haronic.pojo.po.CsConfigurationPO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 10:53【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface CsConfigurationMapper extends BaseMapper<CsConfigurationPO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.njcn.harmonic.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.haronic.pojo.po.CsNetDevPO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:13【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface CsNetDevPOMapper extends BaseMapper<CsNetDevPO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.njcn.harmonic.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.haronic.pojo.po.CsPagePO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:31【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface CsPagePOMapper extends BaseMapper<CsPagePO> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.harmonic.mapper.CsConfigurationMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.haronic.pojo.po.CsConfigurationPO">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table cs_configuration-->
|
||||||
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, `name`, `status`, create_by, create_time, update_by, update_time
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.harmonic.mapper.CsNetDevPOMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.haronic.pojo.po.CsNetDevPO">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table cs_net_dev-->
|
||||||
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
|
<result column="dev_type" jdbcType="VARCHAR" property="devType" />
|
||||||
|
<result column="time" jdbcType="TIMESTAMP" property="time" />
|
||||||
|
<result column="version" jdbcType="VARCHAR" property="version" />
|
||||||
|
<result column="soft_info_id" jdbcType="VARCHAR" property="softInfoId" />
|
||||||
|
<result column="prj_info_id" jdbcType="VARCHAR" property="prjInfoId" />
|
||||||
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, dev_type, `time`, version, soft_info_id, prj_info_id, `status`, create_by, create_time,
|
||||||
|
update_by, update_time
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.harmonic.mapper.CsPagePOMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.haronic.pojo.po.CsPagePO">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table cs_page-->
|
||||||
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
|
<result column="pid" jdbcType="VARCHAR" property="pid" />
|
||||||
|
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||||
|
<result column="path" jdbcType="VARCHAR" property="path" />
|
||||||
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, pid, `name`, `path`, `status`, create_by, create_time, update_by, update_time
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.njcn.harmonic.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.njcn.haronic.pojo.param.CsConfigurationParm;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.haronic.pojo.po.CsConfigurationPO;
|
||||||
|
import com.njcn.haronic.pojo.vo.CsConfigurationVO;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 10:53【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface CsConfigurationService extends IService<CsConfigurationPO>{
|
||||||
|
|
||||||
|
|
||||||
|
boolean add(CsConfigurationParm csConfigurationParm);
|
||||||
|
|
||||||
|
boolean audit(CsConfigurationParm.CsConfigurationAuditParam auditParm);
|
||||||
|
|
||||||
|
IPage<CsConfigurationVO> queryPage(CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam);
|
||||||
|
|
||||||
|
String uploadImage(MultipartFile issuesFile);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.harmonic.service;
|
||||||
|
|
||||||
|
import com.njcn.haronic.pojo.po.CsNetDevPO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:12【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface CsNetDevPOService extends IService<CsNetDevPO>{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.njcn.harmonic.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.njcn.haronic.pojo.param.CsPageParm;
|
||||||
|
import com.njcn.haronic.pojo.po.CsPagePO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.haronic.pojo.vo.CsPageVO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:31【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface CsPagePOService extends IService<CsPagePO>{
|
||||||
|
|
||||||
|
|
||||||
|
CsPageVO add(CsPageParm csPageParm);
|
||||||
|
|
||||||
|
boolean audit(CsPageParm.CsPageParmAuditParam auditParm);
|
||||||
|
|
||||||
|
IPage<CsPageVO> queryPage(CsPageParm.CsPageParmQueryParam csPageParam);
|
||||||
|
}
|
||||||
@@ -2,8 +2,8 @@ package com.njcn.harmonic.service;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
import pojo.param.ThdDataQueryParm;
|
import com.njcn.haronic.pojo.param.ThdDataQueryParm;
|
||||||
import pojo.vo.ThdDataVO;
|
import com.njcn.haronic.pojo.vo.ThdDataVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.njcn.harmonic.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.common.utils.NjcnBeanUtil;
|
||||||
|
import com.njcn.haronic.pojo.constant.HarmonicConstant;
|
||||||
|
import com.njcn.oss.constant.OssPath;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.harmonic.mapper.CsConfigurationMapper;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import com.njcn.haronic.pojo.param.CsConfigurationParm;
|
||||||
|
import com.njcn.harmonic.service.CsConfigurationService;
|
||||||
|
import com.njcn.haronic.pojo.po.CsConfigurationPO;
|
||||||
|
import com.njcn.haronic.pojo.vo.CsConfigurationVO;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 10:53【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMapper, CsConfigurationPO> implements CsConfigurationService{
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
public boolean add(CsConfigurationParm csConfigurationParm) {
|
||||||
|
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
||||||
|
BeanUtils.copyProperties(csConfigurationParm,csConfigurationPO);
|
||||||
|
csConfigurationPO.setStatus("1");
|
||||||
|
boolean save = this.save(csConfigurationPO);
|
||||||
|
return save;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean audit(CsConfigurationParm.CsConfigurationAuditParam auditParm) {
|
||||||
|
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
||||||
|
NjcnBeanUtil.copyPropertiesIgnoreCase(auditParm,csConfigurationPO);
|
||||||
|
boolean b = this.updateById(csConfigurationPO);
|
||||||
|
|
||||||
|
return b;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<CsConfigurationVO> queryPage(CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam) {
|
||||||
|
Page<CsConfigurationVO> returnpage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
||||||
|
Page<CsConfigurationPO> temppage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
||||||
|
|
||||||
|
QueryWrapper<CsConfigurationPO> query = new QueryWrapper<>();
|
||||||
|
query.like(StringUtils.isNotBlank(csConfigurationQueryParam.getSearchValue()),CsConfigurationPO.COL_NAME,csConfigurationQueryParam.getSearchValue()).
|
||||||
|
le (StringUtils.isNotBlank (csConfigurationQueryParam.getSearchEndTime()), CsConfigurationPO.COL_CREATE_TIME, csConfigurationQueryParam.getSearchEndTime ( )).
|
||||||
|
ge (StringUtils.isNotBlank (csConfigurationQueryParam.getSearchBeginTime()), CsConfigurationPO.COL_CREATE_TIME, csConfigurationQueryParam.getSearchBeginTime ( )).
|
||||||
|
eq ("status",1).orderByDesc(CsConfigurationPO.COL_CREATE_TIME);
|
||||||
|
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().selectPage(temppage, query);
|
||||||
|
List<CsConfigurationVO> collect = csConfigurationPOPage.getRecords().stream().map(page -> {
|
||||||
|
CsConfigurationVO csDevModelPageVO = new CsConfigurationVO();
|
||||||
|
BeanUtils.copyProperties(page, csDevModelPageVO);
|
||||||
|
return csDevModelPageVO;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
returnpage.setRecords(collect);
|
||||||
|
returnpage.setTotal(csConfigurationPOPage.getTotal());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return returnpage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String uploadImage(MultipartFile issuesFile) {
|
||||||
|
return fileStorageUtil.getFileUrl( fileStorageUtil.uploadMultipart(issuesFile, HarmonicConstant.CONFIGURATIONPATH));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.njcn.harmonic.service.impl;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.haronic.pojo.po.CsNetDevPO;
|
||||||
|
import com.njcn.harmonic.mapper.CsNetDevPOMapper;
|
||||||
|
import com.njcn.harmonic.service.CsNetDevPOService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:12【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CsNetDevPOServiceImpl extends ServiceImpl<CsNetDevPOMapper, CsNetDevPO> implements CsNetDevPOService{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,124 @@
|
|||||||
|
package com.njcn.harmonic.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.harmonic.mapper.CsConfigurationMapper;
|
||||||
|
import com.njcn.haronic.pojo.constant.HarmonicConstant;
|
||||||
|
import com.njcn.haronic.pojo.po.CsConfigurationPO;
|
||||||
|
import com.njcn.haronic.pojo.vo.CsConfigurationVO;
|
||||||
|
import com.njcn.haronic.pojo.vo.CsPageVO;
|
||||||
|
import com.njcn.oss.utils.FileStorageUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.harmonic.mapper.CsPagePOMapper;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import com.njcn.haronic.pojo.param.CsPageParm;
|
||||||
|
import com.njcn.haronic.pojo.po.CsPagePO;
|
||||||
|
import com.njcn.harmonic.service.CsPagePOService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/31 14:31【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> implements CsPagePOService{
|
||||||
|
private final FileStorageUtil fileStorageUtil;
|
||||||
|
private final CsConfigurationMapper csConfigurationMapper;
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
public CsPageVO add(CsPageParm csPageParm) {
|
||||||
|
CsPagePO csPagePO = new CsPagePO();
|
||||||
|
CsPageVO csPageVO = new CsPageVO();
|
||||||
|
csPagePO.setPid(csPageParm.getPid());
|
||||||
|
csPagePO.setStatus("1");
|
||||||
|
csPagePO.setName(csPageParm.getName());
|
||||||
|
InputStream inputStream = this.writeJsonStringToInputStream(csPageParm.getJsonFile());
|
||||||
|
String s = fileStorageUtil.uploadStream(inputStream, HarmonicConstant.CONFIGURATIONPATH, HarmonicConstant.CONFIGURATIONNAME);
|
||||||
|
csPagePO.setPath(s);
|
||||||
|
boolean save = this.save(csPagePO);
|
||||||
|
BeanUtils.copyProperties(csPagePO, csPageVO);
|
||||||
|
|
||||||
|
InputStream fileStream = fileStorageUtil.getFileStream(csPagePO.getPath());
|
||||||
|
String text = new BufferedReader(
|
||||||
|
new InputStreamReader(fileStream, StandardCharsets.UTF_8))
|
||||||
|
.lines()
|
||||||
|
.collect(Collectors.joining("\n"));
|
||||||
|
csPageVO.setPath(text);
|
||||||
|
return csPageVO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
public boolean audit(CsPageParm.CsPageParmAuditParam auditParm) {
|
||||||
|
CsPagePO csPagePO = new CsPagePO();
|
||||||
|
CsPagePO byId = this.getById(auditParm.getId());
|
||||||
|
fileStorageUtil.deleteFile(byId.getPath());
|
||||||
|
BeanUtils.copyProperties(auditParm, csPagePO);
|
||||||
|
if(StringUtils.isNotBlank(auditParm.getJsonFile())){
|
||||||
|
InputStream inputStream = this.writeJsonStringToInputStream(auditParm.getJsonFile());
|
||||||
|
|
||||||
|
String s = fileStorageUtil.uploadStream(inputStream, HarmonicConstant.CONFIGURATIONPATH, HarmonicConstant.CONFIGURATIONNAME);
|
||||||
|
csPagePO.setPath(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return this.updateById(csPagePO);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<CsPageVO> queryPage(CsPageParm.CsPageParmQueryParam csPageParam) {
|
||||||
|
Page<CsPageVO> returnpage = new Page<> (csPageParam.getPageNum(), csPageParam.getPageSize ( ));
|
||||||
|
QueryWrapper<CsPagePO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank (csPageParam.getPid()),CsPagePO.COL_PID,csPageParam.getPid()).
|
||||||
|
like(StringUtils.isNotBlank (csPageParam.getSearchValue()),CsPagePO.COL_NAME,csPageParam.getSearchValue()).
|
||||||
|
eq ("status",1).
|
||||||
|
orderByDesc(CsPagePO.COL_CREATE_TIME);
|
||||||
|
|
||||||
|
IPage<CsPagePO> pageData = this.page(new Page<>(csPageParam.getPageNum(), csPageParam.getPageSize()), queryWrapper);
|
||||||
|
List<CsPageVO> collect = pageData.getRecords().stream().map(temp -> {
|
||||||
|
CsPageVO csPageVO = new CsPageVO();
|
||||||
|
CsConfigurationPO csConfigurationPO = csConfigurationMapper.selectById(temp.getPid());
|
||||||
|
BeanUtils.copyProperties(temp, csPageVO);
|
||||||
|
csPageVO.setConfigurationName(csConfigurationPO.getName());
|
||||||
|
InputStream fileStream = fileStorageUtil.getFileStream(temp.getPath());
|
||||||
|
String text = new BufferedReader(
|
||||||
|
new InputStreamReader(fileStream, StandardCharsets.UTF_8))
|
||||||
|
.lines()
|
||||||
|
.collect(Collectors.joining("\n"));
|
||||||
|
csPageVO.setPath(text);
|
||||||
|
return csPageVO;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
returnpage.setRecords(collect);
|
||||||
|
returnpage.setTotal(pageData.getTotal());
|
||||||
|
|
||||||
|
return returnpage;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*将strin写入Json文件,返回一个InputStream*/
|
||||||
|
public InputStream writeJsonStringToInputStream(String jsonString) {
|
||||||
|
// 转换为输入流
|
||||||
|
ByteArrayInputStream inputStream = new ByteArrayInputStream(jsonString.getBytes(StandardCharsets.UTF_8));
|
||||||
|
return inputStream;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -13,8 +13,8 @@ import com.njcn.harmonic.service.StableDataService;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import pojo.param.ThdDataQueryParm;
|
import com.njcn.haronic.pojo.param.ThdDataQueryParm;
|
||||||
import pojo.vo.ThdDataVO;
|
import com.njcn.haronic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.influx.pojo.po.HarmonicRatioData;
|
import com.njcn.influx.pojo.po.HarmonicRatioData;
|
||||||
import com.njcn.influx.pojo.po.PowerQualityData;
|
import com.njcn.influx.pojo.po.PowerQualityData;
|
||||||
import com.njcn.influx.service.HaronicRatioService;
|
import com.njcn.influx.service.HaronicRatioService;
|
||||||
@@ -49,26 +49,18 @@ public class StableDataServiceImpl implements StableDataService {
|
|||||||
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||||
List<PowerQualityData> firstPowerQuality = powerQualityService.getFirstPowerQuality(collect, statisticalName);
|
List<PowerQualityData> firstPowerQuality = powerQualityService.getFirstPowerQuality(collect, statisticalName);
|
||||||
|
|
||||||
csLinePOList.forEach(temp->{
|
firstPowerQuality.forEach(temp->{
|
||||||
DataParam.phases.forEach(phase->{
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
DataParam.statMethods.forEach(method -> {
|
BeanUtils.copyProperties(temp,thdDataVO);
|
||||||
ThdDataVO thdDataVO = new ThdDataVO();
|
thdDataVO.setStatisticalName(statisticalName);
|
||||||
thdDataVO.setLineId(temp.getLineId());
|
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
||||||
thdDataVO.setPosition(temp.getPosition());
|
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||||
thdDataVO.setStatisticalName(statisticalName);
|
thdDataVO.setPosition(position);
|
||||||
thdDataVO.setPhase(phase);
|
Double statisticalValue = 0.00;
|
||||||
thdDataVO.setStatMethod(method);
|
statisticalValue= (Double) ReflectUtils.getValue(temp, statisticalName);
|
||||||
Double statisticalValue = 0.00;
|
thdDataVO.setStatisticalData(statisticalValue);
|
||||||
List<PowerQualityData> collect1 = firstPowerQuality.stream().filter(powerQualityData -> Objects.equals(powerQualityData.getPhase(), phase) &&
|
|
||||||
Objects.equals(powerQualityData.getStatMethod(), method)
|
thdDataVOList.add(thdDataVO);
|
||||||
).collect(Collectors.toList());
|
|
||||||
if(!CollectionUtils.isEmpty(collect1)){
|
|
||||||
statisticalValue= (Double) ReflectUtils.getValue(collect1.get(0), statisticalName);
|
|
||||||
}
|
|
||||||
thdDataVO.setStatisticalData(statisticalValue);
|
|
||||||
thdDataVOList.add(thdDataVO);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -83,26 +75,18 @@ public class StableDataServiceImpl implements StableDataService {
|
|||||||
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
List<String> collect = csLinePOList.stream().map(CsLinePO::getLineId).collect(Collectors.toList());
|
||||||
List<PowerQualityData> firstPowerQuality = powerQualityService.getPowerQuality(collect, thdDataQueryParm.getStatisticalName(), thdDataQueryParm.getStartTime(), thdDataQueryParm.getEndTime());
|
List<PowerQualityData> firstPowerQuality = powerQualityService.getPowerQuality(collect, thdDataQueryParm.getStatisticalName(), thdDataQueryParm.getStartTime(), thdDataQueryParm.getEndTime());
|
||||||
|
|
||||||
csLinePOList.forEach(temp->{
|
firstPowerQuality.forEach(temp->{
|
||||||
DataParam.phases.forEach(phase->{
|
ThdDataVO thdDataVO = new ThdDataVO();
|
||||||
DataParam.statMethods.forEach(method -> {
|
BeanUtils.copyProperties(temp,thdDataVO);
|
||||||
ThdDataVO thdDataVO = new ThdDataVO();
|
thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName());
|
||||||
thdDataVO.setLineId(temp.getLineId());
|
thdDataVO.setTime(temp.getTime().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
||||||
thdDataVO.setPosition(temp.getPosition());
|
String position = csLinePOList.stream().filter(csLinePO -> Objects.equals(csLinePO.getLineId(), thdDataVO.getLineId())).collect(Collectors.toList()).get(0).getPosition();
|
||||||
thdDataVO.setStatisticalName(thdDataQueryParm.getStatisticalName());
|
thdDataVO.setPosition(position);
|
||||||
thdDataVO.setPhase(phase);
|
Double statisticalValue = 0.00;
|
||||||
thdDataVO.setStatMethod(method);
|
statisticalValue= (Double) ReflectUtils.getValue(temp, thdDataQueryParm.getStatisticalName());
|
||||||
Double statisticalValue = 0.00;
|
thdDataVO.setStatisticalData(statisticalValue);
|
||||||
List<PowerQualityData> collect1 = firstPowerQuality.stream().filter(powerQualityData -> Objects.equals(powerQualityData.getPhase(), phase) &&
|
|
||||||
Objects.equals(powerQualityData.getStatMethod(), method)
|
thdDataVOList.add(thdDataVO);
|
||||||
).collect(Collectors.toList());
|
|
||||||
if(!CollectionUtils.isEmpty(collect1)){
|
|
||||||
statisticalValue= (Double) ReflectUtils.getValue(collect1.get(0), thdDataQueryParm.getStatisticalName());
|
|
||||||
}
|
|
||||||
thdDataVO.setStatisticalData(statisticalValue);
|
|
||||||
thdDataVOList.add(thdDataVO);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -158,4 +142,5 @@ public class StableDataServiceImpl implements StableDataService {
|
|||||||
|
|
||||||
return thdDataVOList;
|
return thdDataVOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user