app直连设备接入接口支持
This commit is contained in:
@@ -6,6 +6,7 @@ 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.CsEquipmentTransferAddParm;
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import com.njcn.csdevice.service.CsDeviceUserPOService;
|
||||
import com.njcn.csdevice.service.CsEquipmentTransferPOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -54,4 +55,14 @@ public class DeviceUserController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("批量新增用户设备关系")
|
||||
@ApiImplicitParam(name = "list", value = "集合", required = true)
|
||||
public HttpResult<Boolean> add(@RequestBody List<CsDeviceUserPO> list){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
csDeviceUserPOService.saveBatch(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.mapper.AppProjectMapper;
|
||||
import com.njcn.csdevice.pojo.param.CsLedgerParam;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.CsLedgerVO;
|
||||
import com.njcn.csdevice.service.CsLinePOService;
|
||||
@@ -72,10 +73,10 @@ public class CsLedgerController extends BaseController {
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增台账信息")
|
||||
@ApiImplicitParam(name = "csLedgerParam", value = "新增台账实体", required = true)
|
||||
public HttpResult<String> add(@RequestBody @Validated CsLedgerParam csLedgerParam){
|
||||
public HttpResult<CsLedger> add(@RequestBody @Validated CsLedgerParam csLedgerParam){
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
csLedgerService.addLedgerTree(csLedgerParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
CsLedger csLedger = csLedgerService.addLedgerTree(csLedgerParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csLedger, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
|
||||
@@ -13,10 +13,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -55,4 +52,14 @@ public class CslineController extends BaseController {
|
||||
List<CsLinePO> csLinePOS = csLinePOService.queryByDevId(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csLinePOS, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("批量新增监测点")
|
||||
@ApiImplicitParam(name = "list", value = "监测点数据集", required = true)
|
||||
public HttpResult<String> addLineList(@RequestBody List<CsLinePO> list){
|
||||
String methodDescribe = getMethodDescribe("addLineList");
|
||||
csLinePOService.saveBatch(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.csdevice.controller.project;
|
||||
import com.njcn.csdevice.pojo.param.AppLineTopologyDiagramAddParm;
|
||||
import com.njcn.csdevice.pojo.param.AppLineTopologyDiagramAuditParm;
|
||||
import com.njcn.csdevice.pojo.po.AppLineTopologyDiagramPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||
import com.njcn.csdevice.service.AppLineTopologyDiagramService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
@@ -20,6 +21,8 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
@@ -71,4 +74,14 @@ public class LineTopologyDiagramController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appTopologyDiagramVO, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addList")
|
||||
@ApiOperation("批量新增监测点拓扑图关系")
|
||||
@ApiImplicitParam(name = "list", value = "监测点拓扑图数据集", required = true)
|
||||
public HttpResult<String> addList(@RequestBody List<AppLineTopologyDiagramPO> list){
|
||||
String methodDescribe = getMethodDescribe("addList");
|
||||
appLineTopologyDiagramService.saveBatch(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public interface ICsLedgerService {
|
||||
* 新增台账数据
|
||||
* @param csLedgerParam
|
||||
*/
|
||||
void addLedgerTree(CsLedgerParam csLedgerParam);
|
||||
CsLedger addLedgerTree(CsLedgerParam csLedgerParam);
|
||||
|
||||
/**
|
||||
* 删除台账数据
|
||||
|
||||
@@ -120,7 +120,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLedgerTree(CsLedgerParam csLedgerParam) {
|
||||
public CsLedger addLedgerTree(CsLedgerParam csLedgerParam) {
|
||||
CsLedger fatherCsLedger = this.lambdaQuery().eq(CsLedger::getId,csLedgerParam.getPid()).one();
|
||||
CsLedger csLedger = new CsLedger();
|
||||
BeanUtils.copyProperties(csLedgerParam,csLedger);
|
||||
@@ -132,6 +132,7 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
|
||||
csLedger.setPids(fatherCsLedger.getPids() + "," + csLedgerParam.getPid());
|
||||
}
|
||||
this.save(csLedger);
|
||||
return csLedger;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user