提交
This commit is contained in:
@@ -0,0 +1,46 @@
|
|||||||
|
package com.njcn.csdevice.pojo.param;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/3/27 10:18【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目拓扑图关系表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AppLineTopologyDiagramParm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 拓扑图Id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点ID
|
||||||
|
*/
|
||||||
|
private String lineId;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 0:删除 1:正常
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
private Double lng;
|
||||||
|
|
||||||
|
private Double lat;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -16,5 +16,5 @@ import java.util.List;
|
|||||||
public class LinePostionParam {
|
public class LinePostionParam {
|
||||||
/*拓扑图id*/
|
/*拓扑图id*/
|
||||||
private String id;
|
private String id;
|
||||||
private List<AppLineTopologyDiagramPO> pointList;
|
private List<AppLineTopologyDiagramParm> pointList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public class AppLineTopologyDiagramPO extends BaseEntity {
|
|||||||
@TableField(value = "id")
|
@TableField(value = "id")
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点ID
|
* 监测点ID
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -30,6 +30,8 @@ public class AppLineTopologyDiagramVO {
|
|||||||
*/
|
*/
|
||||||
private String lineId;
|
private String lineId;
|
||||||
|
|
||||||
|
private String name ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0:删除 1:正常
|
* 0:删除 1:正常
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -88,10 +88,10 @@ public class DeviceUserController extends BaseController {
|
|||||||
@ApiOperation("设备转移(直接扫码不用申请)")
|
@ApiOperation("设备转移(直接扫码不用申请)")
|
||||||
@ApiImplicitParam(name = "ids", value = "设备Id集合", required = true)
|
@ApiImplicitParam(name = "ids", value = "设备Id集合", required = true)
|
||||||
@DeviceLog(operateType = DeviceOperate.TRANSFER)
|
@DeviceLog(operateType = DeviceOperate.TRANSFER)
|
||||||
public HttpResult<Boolean> transfer(@RequestParam("ids") List<String> ids){
|
public HttpResult<Boolean> transfer(@RequestParam("ids") List<String> ids,@RequestParam("useId") String useId){
|
||||||
String methodDescribe = getMethodDescribe("transfer");
|
String methodDescribe = getMethodDescribe("transfer");
|
||||||
|
|
||||||
Boolean flag = csDeviceUserPOService.transfer (ids);
|
Boolean flag = csDeviceUserPOService.transfer (ids,useId);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryByLineIds" resultType="com.njcn.csdevice.pojo.vo.AppLineTopologyDiagramVO">
|
<select id="queryByLineIds" resultType="com.njcn.csdevice.pojo.vo.AppLineTopologyDiagramVO">
|
||||||
select a.*,b.position linePostion from cs_line_topology_diagram a LEFT JOIN cs_line b on a.line_id=b.line_id where a.line_id in
|
select a.*,b.position linePostion,b.name name from cs_line_topology_diagram a LEFT JOIN cs_line b on a.line_id=b.line_id where a.line_id in
|
||||||
<foreach collection='lineIds' item='item' index="index" open='(' separator=',' close=')'>
|
<foreach collection='lineIds' item='item' index="index" open='(' separator=',' close=')'>
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public interface CsDeviceUserPOService extends IService<CsDeviceUserPO>{
|
|||||||
|
|
||||||
String isPrimaryUser(String deviceId);
|
String isPrimaryUser(String deviceId);
|
||||||
|
|
||||||
Boolean transfer( List<String> ids);
|
Boolean transfer( List<String> ids,String useId);
|
||||||
|
|
||||||
Boolean delete(String eid);
|
Boolean delete(String eid);
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public class AppLineTopologyDiagramServiceImpl extends ServiceImpl<AppLineTopolo
|
|||||||
|
|
||||||
|
|
||||||
linePostionParam.getPointList().forEach(temp->{
|
linePostionParam.getPointList().forEach(temp->{
|
||||||
|
csLinePOService.lambdaUpdate().eq(CsLinePO::getLineId,temp.getLineId()).set(CsLinePO::getName,temp.getName()).update();
|
||||||
this.lambdaUpdate().eq(AppLineTopologyDiagramPO::getId,temp.getId()).
|
this.lambdaUpdate().eq(AppLineTopologyDiagramPO::getId,temp.getId()).
|
||||||
eq(AppLineTopologyDiagramPO::getLineId,temp.getLineId()).set(AppLineTopologyDiagramPO::getLat,temp.getLat()).
|
eq(AppLineTopologyDiagramPO::getLineId,temp.getLineId()).set(AppLineTopologyDiagramPO::getLat,temp.getLat()).
|
||||||
set(AppLineTopologyDiagramPO::getLng,temp.getLng()).set(AppLineTopologyDiagramPO::getId,linePostionParam.getId()).update();
|
set(AppLineTopologyDiagramPO::getLng,temp.getLng()).set(AppLineTopologyDiagramPO::getId,linePostionParam.getId()).update();
|
||||||
|
|||||||
@@ -209,8 +209,8 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public Boolean transfer(List<String> ids) {
|
public Boolean transfer(List<String> ids,String useId) {
|
||||||
String userIndex = RequestUtil.getUserIndex();
|
String userIndex = useId;
|
||||||
ids.forEach(eid->{
|
ids.forEach(eid->{
|
||||||
List<CsDeviceUserPO> list = this.lambdaQuery().eq(CsDeviceUserPO::getDeviceId, eid).eq(CsDeviceUserPO::getStatus,"1" ).list();
|
List<CsDeviceUserPO> list = this.lambdaQuery().eq(CsDeviceUserPO::getDeviceId, eid).eq(CsDeviceUserPO::getStatus,"1" ).list();
|
||||||
if(CollectionUtils.isEmpty(list)){
|
if(CollectionUtils.isEmpty(list)){
|
||||||
|
|||||||
Reference in New Issue
Block a user