设备注册功能优化
This commit is contained in:
@@ -6,7 +6,6 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.po.CsDevCapacityPO;
|
||||
import com.njcn.csdevice.pojo.po.CsDevModelPO;
|
||||
import com.njcn.csdevice.service.CsDevCapacityPOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -16,6 +15,8 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
@@ -44,4 +45,14 @@ public class CsDevCapacityController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, limit, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("批量新增")
|
||||
@ApiImplicitParam(name = "id", value = "设备id", required = true)
|
||||
public HttpResult<String> addList(@RequestBody List<CsDevCapacityPO> list){
|
||||
String methodDescribe = getMethodDescribe("addList");
|
||||
csDevCapacityPOService.addList(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
@@ -177,6 +178,7 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
@ApiImplicitParam(name = "id", value = "软件信息id", required = true),
|
||||
@ApiImplicitParam(name = "module", value = "模块个数", required = true)
|
||||
})
|
||||
@Deprecated
|
||||
public HttpResult<Boolean> updateSoftInfoBynDid(@RequestParam("nDId") String nDid,@RequestParam("id") String id,@RequestParam("module") Integer module){
|
||||
String methodDescribe = getMethodDescribe("updateSoftInfoBynDid");
|
||||
csEquipmentDeliveryService.updateSoftInfoBynDid(nDid,id,module);
|
||||
@@ -237,5 +239,33 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateSoftInfo")
|
||||
@ApiOperation("更新设备软件信息")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "nDid", value = "网络设备码", required = true),
|
||||
@ApiImplicitParam(name = "id", value = "软件信息id", required = true)
|
||||
})
|
||||
@ApiIgnore
|
||||
public HttpResult<String> updateSoftInfo(@RequestParam("nDid") String nDid,@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("updateSoftInfo");
|
||||
csEquipmentDeliveryService.updateSoftInfo(nDid,id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateModuleNumber")
|
||||
@ApiOperation("更新设备模块个数")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "nDid", value = "网络设备码", required = true),
|
||||
@ApiImplicitParam(name = "number", value = "模块个数", required = true)
|
||||
})
|
||||
@ApiIgnore
|
||||
public HttpResult<String> updateModuleNumber(@RequestParam("nDid") String nDid,@RequestParam("number") Integer number){
|
||||
String methodDescribe = getMethodDescribe("updateModuleNumber");
|
||||
csEquipmentDeliveryService.updateModuleNumber(nDid,number);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ 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.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -13,6 +14,7 @@ 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 springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@@ -95,4 +97,15 @@ public class CslineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineList, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/updateLine")
|
||||
@ApiOperation("修改监测点信息")
|
||||
@ApiImplicitParam(name = "csLineParam", value = "监测点信息", required = true)
|
||||
@ApiIgnore
|
||||
public HttpResult<Boolean> updateLine(@RequestBody @Validated CsLineParam csLineParam) {
|
||||
String methodDescribe = getMethodDescribe("updateLine");
|
||||
csLinePOService.updateLine(csLineParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.njcn.csdevice.pojo.po.CsDevCapacityPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
import com.njcn.csdevice.pojo.po.CsDevCapacityPO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/9/27 10:29【需求编号】
|
||||
@@ -12,6 +15,14 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface CsDevCapacityPOService extends IService<CsDevCapacityPO>{
|
||||
|
||||
/**
|
||||
* 批量新增数据
|
||||
* @param list
|
||||
*/
|
||||
void addList(List<CsDevCapacityPO> list);
|
||||
|
||||
|
||||
Double getDevCapacity(String id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -100,4 +100,18 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
||||
void testCompletion(String deviceId,Integer type,String remark);
|
||||
|
||||
void deleteTest(String deviceId, Integer type,String remark);
|
||||
|
||||
/**
|
||||
* 更新设备软件信息
|
||||
* @param nDid
|
||||
* @param id
|
||||
*/
|
||||
void updateSoftInfo(String nDid, String id);
|
||||
|
||||
/**
|
||||
* 更新设备模块个数
|
||||
* @param nDid
|
||||
* @param number
|
||||
*/
|
||||
void updateModuleNumber(String nDid, Integer number);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -33,4 +34,10 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
||||
*/
|
||||
List<CsLinePO> findByNdid(String id);
|
||||
|
||||
/**
|
||||
* 更新监测点信息
|
||||
* @param csLineParam
|
||||
*/
|
||||
void updateLine(CsLineParam csLineParam);
|
||||
|
||||
}
|
||||
|
||||
@@ -36,6 +36,11 @@ public class CsDevCapacityPOServiceImpl extends ServiceImpl<CsDevCapacityPOMappe
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final DecimalFormat df = new DecimalFormat("#0.000");
|
||||
|
||||
@Override
|
||||
public void addList(List<CsDevCapacityPO> list) {
|
||||
this.saveOrUpdateBatch(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getDevCapacity(String id) {
|
||||
List<CsLinePO> csLinePOS = csLinePOService.queryByDevId(id);
|
||||
|
||||
@@ -518,6 +518,24 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSoftInfo(String nDid, String id) {
|
||||
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(CsEquipmentDeliveryPO::getNdid,nDid)
|
||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||
.set(CsEquipmentDeliveryPO::getSoftinfoId,id);
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateModuleNumber(String nDid, Integer number) {
|
||||
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(CsEquipmentDeliveryPO::getNdid,nDid)
|
||||
.ne(CsEquipmentDeliveryPO::getRunStatus,0)
|
||||
.set(CsEquipmentDeliveryPO::getModuleNumber,number);
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ndid生成二维码
|
||||
* @param ndid
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.njcn.csdevice.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||
import com.njcn.csdevice.pojo.param.CsLineParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
@@ -57,6 +59,18 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
||||
return this.baseMapper.findByNdid(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLine(CsLineParam csLineParam) {
|
||||
LambdaUpdateWrapper<CsLinePO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
lambdaUpdateWrapper.eq(CsLinePO::getLineId,csLineParam.getLineId())
|
||||
.eq(CsLinePO::getStatus,1)
|
||||
.set(CsLinePO::getVolGrade,csLineParam.getVolGrade())
|
||||
.set(CsLinePO::getPtRatio,csLineParam.getPtRatio())
|
||||
.set(CsLinePO::getCtRatio,csLineParam.getCtRatio())
|
||||
.set(CsLinePO::getConType,csLineParam.getConType());
|
||||
this.update(lambdaUpdateWrapper);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
||||
// *
|
||||
|
||||
Reference in New Issue
Block a user