设备相关接口

This commit is contained in:
huangzj
2023-03-31 10:22:08 +08:00
parent 45417cbecf
commit c0629a6d14
11 changed files with 544 additions and 2 deletions

View File

@@ -0,0 +1,60 @@
package com.njcn.algorithm.controller.Equipment;
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
import com.njcn.algorithm.service.CsEquipmentDeliveryService;
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.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.*;
/**
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/3/27 15:31【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Slf4j
@RestController
@RequestMapping("/EquipmentDelivery")
@Api(tags = " 出厂设备")
@AllArgsConstructor
public class EquipmentDeliveryController extends BaseController {
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/addEquipmentDelivery")
@ApiOperation("新增出厂设备")
@ApiImplicitParam(name = "csEquipmentDeliveryAddParm", value = "新增项目参数", required = true)
public HttpResult<Boolean> addEquipmentDelivery(@RequestBody @Validated CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm){
String methodDescribe = getMethodDescribe("addEquipmentDelivery");
Boolean flag = csEquipmentDeliveryService.save (csEquipmentDeliveryAddParm);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/AuditEquipmentDelivery")
@ApiOperation("删除出厂设备")
public HttpResult<Boolean> AuditEquipmentDelivery(@RequestParam("id")String id ){
String methodDescribe = getMethodDescribe("AuditEquipmentDelivery");
Boolean flag = csEquipmentDeliveryService.AuditEquipmentDelivery(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
}
}

View File

@@ -1,9 +1,24 @@
package com.njcn.algorithm.controller.project;
import com.njcn.algorithm.pojo.param.AppLineTopologyDiagramAddParm;
import com.njcn.algorithm.pojo.param.AppLineTopologyDiagramAuditParm;
import com.njcn.algorithm.pojo.po.AppLineTopologyDiagramPO;
import com.njcn.algorithm.service.AppLineTopologyDiagramService;
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.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.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -22,5 +37,31 @@ import org.springframework.web.bind.annotation.RestController;
@AllArgsConstructor
public class LineTopologyDiagramController extends BaseController {
private AppLineTopologyDiagramService appLineTopologyDiagramService;
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/addLineDiagram")
@ApiOperation("新增拓扑图-监测点绑定")
@ApiImplicitParam(name = "appLineTopologyDiagramAddParm", value = "新增拓扑图参数", required = true)
public HttpResult<Boolean> addLineDiagram(@RequestBody @Validated AppLineTopologyDiagramAddParm appLineTopologyDiagramAddParm){
String methodDescribe = getMethodDescribe("addLineDiagram");
AppLineTopologyDiagramPO appLineTopologyDiagramPO = new AppLineTopologyDiagramPO();
BeanUtils.copyProperties (appLineTopologyDiagramAddParm,appLineTopologyDiagramPO);
appLineTopologyDiagramPO.setStatus ("1");
Boolean flag = appLineTopologyDiagramService.save (appLineTopologyDiagramPO);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/auditLineDiagram")
@ApiOperation("修改/删除拓扑图-监测点绑定")
@ApiImplicitParam(name = "appLineTopologyDiagramAuditParm", value = "修改/删除拓扑图参数", required = true)
public HttpResult<Boolean> auditLineDiagram(@RequestBody@Validated AppLineTopologyDiagramAuditParm appLineTopologyDiagramAuditParm){
String methodDescribe = getMethodDescribe("auditLineDiagram");
AppLineTopologyDiagramPO appLineTopologyDiagramPO = new AppLineTopologyDiagramPO();
BeanUtils.copyProperties (appLineTopologyDiagramAuditParm,appLineTopologyDiagramPO);
Boolean flag = appLineTopologyDiagramService.update (appLineTopologyDiagramPO,null);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
}
}

View File

@@ -0,0 +1,16 @@
package com.njcn.algorithm.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/3/30 16:23【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEquipmentDeliveryMapper extends BaseMapper<CsEquipmentDeliveryPO> {
}

View File

@@ -0,0 +1,33 @@
<?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.algorithm.mapper.CsEquipmentDeliveryMapper">
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO">
<!--@mbg.generated-->
<!--@Table cs_equipment_delivery-->
<result column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="ndid" jdbcType="VARCHAR" property="ndid" />
<result column="mac" jdbcType="VARCHAR" property="mac" />
<result column="dev_use" jdbcType="VARCHAR" property="devUse" />
<result column="dev_type" jdbcType="VARCHAR" property="devType" />
<result column="dev_model" jdbcType="VARCHAR" property="devModel" />
<result column="program_version" jdbcType="VARCHAR" property="programVersion" />
<result column="debug_person" jdbcType="VARCHAR" property="debugPerson" />
<result column="producte_time" jdbcType="TIMESTAMP" property="producteTime" />
<result column="check_time" jdbcType="TIMESTAMP" property="checkTime" />
<result column="debug_time" jdbcType="TIMESTAMP" property="debugTime" />
<result column="cntract_no" jdbcType="VARCHAR" property="cntractNo" />
<result column="sales_manager" jdbcType="VARCHAR" property="salesManager" />
<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`, ndid, mac, dev_use, dev_type, dev_model, program_version, debug_person,
producte_time, check_time, debug_time, cntract_no, sales_manager, `status`, create_by,
create_time, update_by, update_time
</sql>
</mapper>

View File

@@ -0,0 +1,33 @@
package com.njcn.algorithm.service;
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/3/30 16:23【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface CsEquipmentDeliveryService extends IService<CsEquipmentDeliveryPO>{
/**
* @Description: save
* @Param: [csEquipmentDeliveryAddParm]
* @return: java.lang.Boolean
* @Author: clam
* @Date: 2023/3/31
*/
Boolean save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm);
/**
* @Description: AuditEquipmentDelivery
* @Param: [id]
* @return: java.lang.Boolean
* @Author: clam
* @Date: 2023/3/31
*/
Boolean AuditEquipmentDelivery(String id);
}

View File

@@ -0,0 +1,41 @@
package com.njcn.algorithm.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.algorithm.mapper.CsEquipmentDeliveryMapper;
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
import com.njcn.algorithm.service.CsEquipmentDeliveryService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
/**
*
* Description:
* 接口文档访问地址http://serverIP:port/swagger-ui.html
* Date: 2023/3/30 16:23【需求编号】
*
* @author clam
* @version V1.0.0
*/
@Service
public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliveryMapper, CsEquipmentDeliveryPO> implements CsEquipmentDeliveryService{
@Override
public Boolean save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm) {
CsEquipmentDeliveryPO csEquipmentDeliveryPO = new CsEquipmentDeliveryPO();
BeanUtils.copyProperties (csEquipmentDeliveryAddParm,csEquipmentDeliveryPO);
csEquipmentDeliveryPO.setStatus (1);
boolean save = this.save (csEquipmentDeliveryPO);
return save;
}
@Override
public Boolean AuditEquipmentDelivery(String id) {
UpdateWrapper<CsEquipmentDeliveryPO> wrapper = new UpdateWrapper();
wrapper.eq ("id", id);
wrapper.set ("status", "1");
boolean update = this.update (wrapper);
return update;
}
}