数据有效性接口
This commit is contained in:
@@ -17,7 +17,7 @@ public enum AlgorithmResponseEnum {
|
|||||||
PROJECT_COMMON_ERROR("A00500","同一用户下项目名不能相同"),
|
PROJECT_COMMON_ERROR("A00500","同一用户下项目名不能相同"),
|
||||||
DICT_DATA_ERROR("A00501","暂无此字典表类型"),
|
DICT_DATA_ERROR("A00501","暂无此字典表类型"),
|
||||||
NDID_ERROR("A00502","存在相同的ndid"),
|
NDID_ERROR("A00502","存在相同的ndid"),
|
||||||
|
DATA_ERROR("A00503","存在相同的数据"),
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.njcn.algorithm.pojo.param;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/18 9:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModel(value="装置数据有效性新增model")
|
||||||
|
@Data
|
||||||
|
public class CsDataEffectiveAddParm {
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="项目id")
|
||||||
|
@NotBlank(message="项目id不能为空!")
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="设备id")
|
||||||
|
@NotBlank(message="设备id不能为空!")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="注册时间")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date registerTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退役时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="退役时间")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date retireeTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.njcn.algorithm.pojo.param;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/18 9:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModel(value="装置数据有效性修改model")
|
||||||
|
@Data
|
||||||
|
public class CsDataEffectiveAuditParm {
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
@NotBlank(message="id不能为空!")
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="项目id")
|
||||||
|
@NotBlank(message="项目id不能为空!")
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="设备id")
|
||||||
|
@NotBlank(message="设备id不能为空!")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="注册时间")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date registerTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退役时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="退役时间")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date retireeTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.njcn.algorithm.pojo.param;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/18 9:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModel(value="装置数据查询有效性model")
|
||||||
|
@Data
|
||||||
|
public class CsDataEffectiveQueryParm {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="项目id")
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="设备id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.njcn.algorithm.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.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/18 9:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 装置数据有效性表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName(value = "cs_data_effective")
|
||||||
|
public class CsDataEffectivePO extends BaseEntity {
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
@TableField(value = "project_id")
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
@TableField(value = "dev_id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "register_time")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date registerTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退役时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "retiree_time")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date retireeTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.njcn.algorithm.pojo.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.njcn.db.bo.BaseEntity;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/18 9:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModel(value="装置数据Modle")
|
||||||
|
@Data
|
||||||
|
public class CsDataEffectiveVO extends BaseEntity {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "id")
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="项目id")
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="设备id")
|
||||||
|
private String devId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="注册时间")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date registerTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退役时间
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value="退役时间")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
|
private Date retireeTime;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package com.njcn.algorithm.controller.data;
|
||||||
|
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDataEffectiveAddParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDataEffectiveAuditParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDataEffectiveQueryParm;
|
||||||
|
import com.njcn.algorithm.pojo.vo.AppBaseInformationVO;
|
||||||
|
import com.njcn.algorithm.pojo.vo.CsDataEffectiveVO;
|
||||||
|
import com.njcn.algorithm.service.CsDataEffectiveService;
|
||||||
|
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.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/4 9:02【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/dataEffective")
|
||||||
|
@Api(tags = "数据有效性")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DataEffectiveController extends BaseController {
|
||||||
|
|
||||||
|
private final CsDataEffectiveService csDataEffectiveService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/addDataEffective")
|
||||||
|
@ApiOperation("新增app数据有效性表")
|
||||||
|
@ApiImplicitParam(name = "csDataEffectiveAddParm", value = "新增app数据有效性表参数", required = true)
|
||||||
|
public HttpResult<Boolean> addDataEffective(@RequestBody @Validated CsDataEffectiveAddParm csDataEffectiveAddParm){
|
||||||
|
String methodDescribe = getMethodDescribe("addDataEffective");
|
||||||
|
|
||||||
|
boolean save = csDataEffectiveService.add (csDataEffectiveAddParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/auditDataEffective")
|
||||||
|
@ApiOperation("修改app数据有效性表")
|
||||||
|
@ApiImplicitParam(name = "auditParm", value = "修改app数据有效性表参数", required = true)
|
||||||
|
public HttpResult<Boolean> auditDataEffective(@RequestBody @Validated CsDataEffectiveAuditParm auditParm){
|
||||||
|
String methodDescribe = getMethodDescribe("auditDataEffective");
|
||||||
|
|
||||||
|
boolean save = csDataEffectiveService.auditDataEffective (auditParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, save, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/queryDataEffective")
|
||||||
|
@ApiOperation("查询app数据有效性表")
|
||||||
|
@ApiImplicitParam(name = "csDataEffectiveQueryParm", value = "查询app数据有效性表参数", required = true)
|
||||||
|
public HttpResult<List<CsDataEffectiveVO>> queryDataEffective(@RequestBody @Validated CsDataEffectiveQueryParm csDataEffectiveQueryParm ){
|
||||||
|
String methodDescribe = getMethodDescribe("queryDataEffective");
|
||||||
|
AppBaseInformationVO appBaseInformationVO = new AppBaseInformationVO();
|
||||||
|
List<CsDataEffectiveVO> list = csDataEffectiveService.queryDataEffective(csDataEffectiveQueryParm);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,23 +1,11 @@
|
|||||||
package com.njcn.algorithm.controller.dict;
|
package com.njcn.algorithm.controller.dict;
|
||||||
|
|
||||||
import com.njcn.algorithm.pojo.param.CsDictAddParm;
|
|
||||||
import com.njcn.algorithm.pojo.vo.CsDictVO;
|
|
||||||
import com.njcn.algorithm.service.CsDictService;
|
|
||||||
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 com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
@@ -30,28 +18,28 @@ import java.util.List;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/dict")
|
@RequestMapping("/dict")
|
||||||
@Api(tags = "字典表")
|
@Api(tags = "字典表/表结构更改弃用")
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class DictDataController extends BaseController {
|
public class DictDataController extends BaseController {
|
||||||
private final CsDictService csDictService;
|
// private final CsDictService csDictService;
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/addDict")
|
// @PostMapping("/addDict")
|
||||||
@ApiOperation("新增字典")
|
// @ApiOperation("新增字典")
|
||||||
@ApiImplicitParam(name = "csDictAddParms", value = "新增项目参数", required = true)
|
// @ApiImplicitParam(name = "csDictAddParms", value = "新增项目参数", required = true)
|
||||||
public HttpResult<Boolean> addDict(@RequestBody @Validated List<CsDictAddParm> csDictAddParms){
|
// public HttpResult<Boolean> addDict(@RequestBody @Validated List<CsDictAddParm> csDictAddParms){
|
||||||
String methodDescribe = getMethodDescribe("addDictType");
|
// String methodDescribe = getMethodDescribe("addDictType");
|
||||||
Boolean flag = csDictService.addDict(csDictAddParms);
|
// Boolean flag = csDictService.addDict(csDictAddParms);
|
||||||
|
//
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||||
}
|
// }
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryDictData")
|
// @PostMapping("/queryDictData")
|
||||||
@ApiOperation("查询字典")
|
// @ApiOperation("查询字典")
|
||||||
@ApiImplicitParam(name = "dictType", value = "字典类型", required = true)
|
// @ApiImplicitParam(name = "dictType", value = "字典类型", required = true)
|
||||||
public HttpResult<List<CsDictVO>> queryDictData(@RequestParam("dictType")String dictType ){
|
// public HttpResult<List<CsDictVO>> queryDictData(@RequestParam("dictType")String dictType ){
|
||||||
String methodDescribe = getMethodDescribe("queryDictData");
|
// String methodDescribe = getMethodDescribe("queryDictData");
|
||||||
List<CsDictVO> csDictVOList = csDictService.queryDictData(dictType);
|
// List<CsDictVO> csDictVOList = csDictService.queryDictData(dictType);
|
||||||
|
//
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csDictVOList, methodDescribe);
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csDictVOList, methodDescribe);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.algorithm.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njcn.algorithm.pojo.po.CsDataEffectivePO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/18 9:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface CsDataEffectiveMapper extends BaseMapper<CsDataEffectivePO> {
|
||||||
|
}
|
||||||
@@ -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.algorithm.mapper.CsDataEffectiveMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsDataEffectivePO">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table cs_data_effective-->
|
||||||
|
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||||
|
<result column="dev_id" jdbcType="VARCHAR" property="devId" />
|
||||||
|
<result column="register_time" jdbcType="TIMESTAMP" property="registerTime" />
|
||||||
|
<result column="retiree_time" jdbcType="TIMESTAMP" property="retireeTime" />
|
||||||
|
<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-->
|
||||||
|
project_id, dev_id, register_time, retiree_time, create_by, create_time, update_by,
|
||||||
|
update_time
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.njcn.algorithm.service;
|
||||||
|
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDataEffectiveAddParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDataEffectiveAuditParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDataEffectiveQueryParm;
|
||||||
|
import com.njcn.algorithm.pojo.po.CsDataEffectivePO;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.algorithm.pojo.vo.CsDataEffectiveVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/18 9:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface CsDataEffectiveService extends IService<CsDataEffectivePO>{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: add
|
||||||
|
* @Param: [csDataEffectiveAddParm]
|
||||||
|
* @return: boolean
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/4/18
|
||||||
|
*/
|
||||||
|
boolean add(CsDataEffectiveAddParm csDataEffectiveAddParm);
|
||||||
|
/**
|
||||||
|
* @Description: queryDataEffective
|
||||||
|
* @Param: [csDataEffectiveQueryParm]
|
||||||
|
* @return: java.util.List<com.njcn.algorithm.pojo.vo.CsDataEffectiveVO>
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/4/18
|
||||||
|
*/
|
||||||
|
List<CsDataEffectiveVO> queryDataEffective(CsDataEffectiveQueryParm csDataEffectiveQueryParm);
|
||||||
|
/**
|
||||||
|
* @Description: auditDataEffective
|
||||||
|
* @Param: [auditParm]
|
||||||
|
* @return: boolean
|
||||||
|
* @Author: clam
|
||||||
|
* @Date: 2023/4/18
|
||||||
|
*/
|
||||||
|
boolean auditDataEffective(CsDataEffectiveAuditParm auditParm);
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.njcn.algorithm.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.algorithm.enums.AlgorithmResponseEnum;
|
||||||
|
import com.njcn.algorithm.mapper.CsDataEffectiveMapper;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDataEffectiveAddParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDataEffectiveAuditParm;
|
||||||
|
import com.njcn.algorithm.pojo.param.CsDataEffectiveQueryParm;
|
||||||
|
import com.njcn.algorithm.pojo.po.CsDataEffectivePO;
|
||||||
|
import com.njcn.algorithm.pojo.vo.CsDataEffectiveVO;
|
||||||
|
import com.njcn.algorithm.service.CsDataEffectiveService;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||||
|
* Date: 2023/4/18 9:49【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CsDataEffectiveServiceImpl extends ServiceImpl<CsDataEffectiveMapper, CsDataEffectivePO> implements CsDataEffectiveService{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
public boolean add(CsDataEffectiveAddParm csDataEffectiveAddParm) {
|
||||||
|
|
||||||
|
CsDataEffectiveQueryParm csDataEffectiveQueryParm = new CsDataEffectiveQueryParm();
|
||||||
|
csDataEffectiveQueryParm.setDevId (csDataEffectiveAddParm.getDevId ());
|
||||||
|
csDataEffectiveQueryParm.setProjectId (csDataEffectiveAddParm.getProjectId ());
|
||||||
|
List<CsDataEffectiveVO> list = this.queryDataEffective (csDataEffectiveQueryParm);
|
||||||
|
if(list.size ()>0){
|
||||||
|
throw new BusinessException (AlgorithmResponseEnum.DATA_ERROR);
|
||||||
|
}
|
||||||
|
CsDataEffectivePO csDataEffectivePO = new CsDataEffectivePO ();
|
||||||
|
|
||||||
|
BeanUtils.copyProperties (csDataEffectiveAddParm, csDataEffectivePO);
|
||||||
|
boolean save = this.save (csDataEffectivePO);
|
||||||
|
return save;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CsDataEffectiveVO> queryDataEffective(CsDataEffectiveQueryParm csDataEffectiveQueryParm) {
|
||||||
|
QueryWrapper<CsDataEffectivePO> queryWrapper = new QueryWrapper<> ();
|
||||||
|
queryWrapper.eq (StringUtils.isNotBlank (csDataEffectiveQueryParm.getId ()),"id",csDataEffectiveQueryParm.getId ()).
|
||||||
|
eq (StringUtils.isNotBlank (csDataEffectiveQueryParm.getProjectId ()),"project_id",csDataEffectiveQueryParm.getProjectId ()).
|
||||||
|
eq (StringUtils.isNotBlank (csDataEffectiveQueryParm.getDevId ()),"dev_id",csDataEffectiveQueryParm.getDevId ());
|
||||||
|
List<CsDataEffectivePO> csDataEffectivePOS = this.getBaseMapper ( ).selectList (queryWrapper);
|
||||||
|
List<CsDataEffectiveVO> collect = csDataEffectivePOS.stream ( ).map (temp -> {
|
||||||
|
CsDataEffectiveVO vo = new CsDataEffectiveVO ( );
|
||||||
|
BeanUtils.copyProperties (temp, vo);
|
||||||
|
return vo;
|
||||||
|
}).collect (Collectors.toList ( ));
|
||||||
|
return collect;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean auditDataEffective(CsDataEffectiveAuditParm auditParm) {
|
||||||
|
CsDataEffectiveQueryParm csDataEffectiveQueryParm = new CsDataEffectiveQueryParm();
|
||||||
|
csDataEffectiveQueryParm.setDevId (auditParm.getDevId ());
|
||||||
|
csDataEffectiveQueryParm.setProjectId (auditParm.getProjectId ());
|
||||||
|
List<CsDataEffectiveVO> list = this.queryDataEffective (csDataEffectiveQueryParm);
|
||||||
|
if(list.size ()>0){
|
||||||
|
throw new BusinessException (AlgorithmResponseEnum.DATA_ERROR);
|
||||||
|
}
|
||||||
|
CsDataEffectivePO csDataEffectivePO = new CsDataEffectivePO ();
|
||||||
|
|
||||||
|
BeanUtils.copyProperties (auditParm, csDataEffectivePO);
|
||||||
|
boolean flag = this.updateById (csDataEffectivePO);
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user