项目设备查询接口,字典表接口
This commit is contained in:
@@ -15,6 +15,7 @@ public enum AlgorithmResponseEnum {
|
||||
* A00500 ~ A01550 用于终端模块的枚举
|
||||
*/
|
||||
PROJECT_COMMON_ERROR("A00500","同一用户下项目名不能相同"),
|
||||
DICT_DATA_ERROR("A00501","暂无此字典表类型"),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.algorithm.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 14:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 数据字典表
|
||||
*/
|
||||
@Data
|
||||
public class CsDictAddParm {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "type_name")
|
||||
private String typeName;
|
||||
|
||||
@ApiModelProperty(value = "type_another_name")
|
||||
private String typeAnotherName;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 别名
|
||||
*/
|
||||
@ApiModelProperty(value = "another_name")
|
||||
private String anotherName;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ApiModelProperty(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.njcn.algorithm.pojo.param;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/3/30 16:23【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 设备出厂表
|
||||
*/
|
||||
@Data
|
||||
public class CsEquipmentDeliveryQueryParm {
|
||||
|
||||
|
||||
/**
|
||||
* 装置名称
|
||||
*/
|
||||
@ApiModelProperty(value="装置名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 网关识别码
|
||||
*/
|
||||
@ApiModelProperty(value="网关识别码")
|
||||
private String ndid;
|
||||
|
||||
/**
|
||||
* 装置mac地址
|
||||
*/
|
||||
@ApiModelProperty(value="装置mac地址")
|
||||
private String mac;
|
||||
|
||||
/**
|
||||
* 装置用途(治理、监测...)
|
||||
*/
|
||||
@ApiModelProperty(value="装置用途")
|
||||
private String devUse;
|
||||
|
||||
/**
|
||||
* 装置类型(直连设备、网关设备)
|
||||
*/
|
||||
@ApiModelProperty(value="装置类型")
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 装置型号(pqs588、pqs680...)
|
||||
*/
|
||||
@ApiModelProperty(value="装置型号")
|
||||
private String devModel;
|
||||
|
||||
/**
|
||||
* 装置程序版本
|
||||
*/
|
||||
@ApiModelProperty(value="装置程序版本")
|
||||
private String programVersion;
|
||||
|
||||
/**
|
||||
* 调试人员
|
||||
*/
|
||||
@ApiModelProperty(value="调试人员")
|
||||
private String debugPerson;
|
||||
|
||||
/**
|
||||
* 出厂日期
|
||||
*/
|
||||
@ApiModelProperty(value="出厂日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date producteTime;
|
||||
|
||||
/**
|
||||
* 检修日期
|
||||
*/
|
||||
@ApiModelProperty(value="检修日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date checkTime;
|
||||
|
||||
/**
|
||||
* 调试日期
|
||||
*/
|
||||
@ApiModelProperty(value="调试日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date debugTime;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@ApiModelProperty(value="合同号")
|
||||
private String cntractNo;
|
||||
|
||||
/**
|
||||
* 营销经理
|
||||
*/
|
||||
@ApiModelProperty(value="营销经理")
|
||||
private String salesManager;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.algorithm.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 11:06【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class ProjectEquipmentQueryParm {
|
||||
|
||||
@NotNull(message="当前页不能为空!")
|
||||
@Min(value = 1, message = "当前页不能为0")
|
||||
@ApiModelProperty(value = "当前页",name = "currentPage",dataType ="Integer",required = true)
|
||||
private Integer currentPage;
|
||||
/**显示条数*/
|
||||
@NotNull(message="显示条数不能为空!")
|
||||
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
|
||||
private Integer pageSize;
|
||||
|
||||
@ApiModelProperty(value="项目")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty(value="项目类别")
|
||||
private String projectType;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.njcn.algorithm.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 14:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
/**
|
||||
* 数据字典表
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "cs_dict")
|
||||
public class CsDictPO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
@TableField(value = "pid")
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 别名
|
||||
*/
|
||||
@TableField(value = "another_name")
|
||||
private String anotherName;
|
||||
|
||||
/**
|
||||
* 状态(0:删除 1:正常)
|
||||
*/
|
||||
@TableField(value = "state")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.njcn.algorithm.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 10:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "cs_project_equipment")
|
||||
public class CsProjectEquipmentPO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@TableField(value = "project_id")
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@TableField(value = "equipment_id")
|
||||
private String equipmentId;
|
||||
|
||||
/**
|
||||
* 状态(0:删除 1:正常)
|
||||
*/
|
||||
@TableField(value = "status")
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.njcn.algorithm.pojo.vo;
|
||||
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 14:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 数据字典表
|
||||
*/
|
||||
@Data
|
||||
public class CsDictVO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
@ApiModelProperty(value = "父id")
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty(value = "name")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 别名
|
||||
*/
|
||||
@ApiModelProperty(value = "another_name")
|
||||
private String anotherName;
|
||||
|
||||
/**
|
||||
* 状态(0:删除 1:正常)
|
||||
*/
|
||||
@ApiModelProperty(value = "state")
|
||||
private String state;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@ApiModelProperty(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.njcn.algorithm.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/3/30 16:23【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* 设备出厂表
|
||||
*/
|
||||
@Data
|
||||
public class CsEquipmentDeliveryVO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 装置名称
|
||||
*/
|
||||
@ApiModelProperty(value="装置名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 网关识别码
|
||||
*/
|
||||
@ApiModelProperty(value="网关识别码")
|
||||
private String ndid;
|
||||
|
||||
/**
|
||||
* 装置mac地址
|
||||
*/
|
||||
@ApiModelProperty(value="装置mac地址")
|
||||
private String mac;
|
||||
|
||||
/**
|
||||
* 装置用途(治理、监测...)
|
||||
*/
|
||||
@ApiModelProperty(value="装置用途")
|
||||
private String devUse;
|
||||
|
||||
/**
|
||||
* 装置类型(直连设备、网关设备)
|
||||
*/
|
||||
@ApiModelProperty(value="装置类型")
|
||||
private String devType;
|
||||
|
||||
/**
|
||||
* 装置型号(pqs588、pqs680...)
|
||||
*/
|
||||
@ApiModelProperty(value="装置型号")
|
||||
private String devModel;
|
||||
|
||||
/**
|
||||
* 装置程序版本
|
||||
*/
|
||||
@ApiModelProperty(value="装置程序版本")
|
||||
private String programVersion;
|
||||
|
||||
/**
|
||||
* 调试人员
|
||||
*/
|
||||
@ApiModelProperty(value="调试人员")
|
||||
private String debugPerson;
|
||||
|
||||
/**
|
||||
* 出厂日期
|
||||
*/
|
||||
@ApiModelProperty(value="出厂日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date producteTime;
|
||||
|
||||
/**
|
||||
* 检修日期
|
||||
*/
|
||||
@ApiModelProperty(value="检修日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date checkTime;
|
||||
|
||||
/**
|
||||
* 调试日期
|
||||
*/
|
||||
@ApiModelProperty(value="调试日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
|
||||
private Date debugTime;
|
||||
|
||||
/**
|
||||
* 合同号
|
||||
*/
|
||||
@ApiModelProperty(value="合同号")
|
||||
private String cntractNo;
|
||||
|
||||
/**
|
||||
* 营销经理
|
||||
*/
|
||||
@ApiModelProperty(value="营销经理")
|
||||
private String salesManager;
|
||||
|
||||
/**
|
||||
* 状态(0:删除 1:正常)
|
||||
*/
|
||||
@TableField(value = "status")
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.algorithm.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/3/30 16:23【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
public class ProjectEquipmentVO {
|
||||
|
||||
@ApiModelProperty(value = "项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty(value = "项目类型")
|
||||
private String projectType;
|
||||
|
||||
@ApiModelProperty(value = "设备id")
|
||||
private String equipmentId;
|
||||
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.njcn.algorithm.controller.Equipment;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
|
||||
import com.njcn.algorithm.pojo.param.ProjectEquipmentQueryParm;
|
||||
import com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO;
|
||||
import com.njcn.algorithm.pojo.vo.ProjectEquipmentVO;
|
||||
import com.njcn.algorithm.service.CsEquipmentDeliveryService;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
@@ -55,6 +59,39 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
|
||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
// @PostMapping("/queryEquipment")
|
||||
// @ApiOperation("项目查询")
|
||||
// @ApiImplicitParam(name = "appProjectQueryParm", value = "项目查询参数", required = true)
|
||||
// public HttpResult<List<CsEquipmentDeliveryVO>> queryEquipment(@Validated @RequestBody AppProjectQueryParm appProjectQueryParm){
|
||||
// String methodDescribe = getMethodDescribe("queryEquipment");
|
||||
//
|
||||
// List<CsEquipmentDeliveryVO> appProjectVOIPage = csEquipmentDeliveryService.queryEquipment (appProjectQueryParm);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, appProjectVOIPage, methodDescribe);
|
||||
// }
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryEquipmentByndid")
|
||||
@ApiOperation("通过ndid查询出厂设备")
|
||||
@ApiImplicitParam(name = "ndid", value = "网关识别码", required = true)
|
||||
public HttpResult<CsEquipmentDeliveryVO> queryEquipmentByndid(@RequestParam("ndid")String ndid){
|
||||
String methodDescribe = getMethodDescribe("queryEquipmentByndid");
|
||||
|
||||
CsEquipmentDeliveryVO csEquipmentDeliveryVO = csEquipmentDeliveryService.queryEquipmentByndid (ndid);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csEquipmentDeliveryVO, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryEquipmentByProject")
|
||||
@ApiOperation("通过项目查询出厂设备")
|
||||
@ApiImplicitParam(name = "projectEquipmentQueryParm", value = "项目信息", required = true)
|
||||
public HttpResult<IPage<ProjectEquipmentVO>> queryEquipmentByProject(@RequestBody ProjectEquipmentQueryParm projectEquipmentQueryParm){
|
||||
String methodDescribe = getMethodDescribe("queryEquipmentByProject");
|
||||
|
||||
IPage<ProjectEquipmentVO> projectEquipmentVOS = csEquipmentDeliveryService.queryEquipmentByProject(projectEquipmentQueryParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, projectEquipmentVOS, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
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 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.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 15:29【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/dict")
|
||||
@Api(tags = "字典表")
|
||||
@AllArgsConstructor
|
||||
public class DictDataController extends BaseController {
|
||||
private final CsDictService csDictService;
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/addDict")
|
||||
@ApiOperation("新增字典")
|
||||
@ApiImplicitParam(name = "csDictAddParms", value = "新增项目参数", required = true)
|
||||
public HttpResult<Boolean> addDict(@RequestBody @Validated List<CsDictAddParm> csDictAddParms){
|
||||
String methodDescribe = getMethodDescribe("addDictType");
|
||||
Boolean flag = csDictService.addDict(csDictAddParms);
|
||||
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
|
||||
}
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryDictData")
|
||||
@ApiOperation("查询字典")
|
||||
@ApiImplicitParam(name = "dictType", value = "字典类型", required = true)
|
||||
public HttpResult<List<CsDictVO>> queryDictData(@RequestParam("dictType")String dictType ){
|
||||
String methodDescribe = getMethodDescribe("queryDictData");
|
||||
List<CsDictVO> csDictVOList = csDictService.queryDictData(dictType);
|
||||
|
||||
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.CsDictPO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 14:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsDictMapper extends BaseMapper<CsDictPO> {
|
||||
}
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.njcn.algorithm.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.algorithm.pojo.param.ProjectEquipmentQueryParm;
|
||||
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.algorithm.pojo.vo.ProjectEquipmentVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -13,4 +17,5 @@ import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsEquipmentDeliveryMapper extends BaseMapper<CsEquipmentDeliveryPO> {
|
||||
Page<ProjectEquipmentVO> queryProjectEquipmentVO(Page<ProjectEquipmentVO> returnpage,@Param("projectEquipmentQueryParm")ProjectEquipmentQueryParm projectEquipmentQueryParm);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.algorithm.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.algorithm.pojo.po.CsProjectEquipmentPO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 10:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsProjectEquipmentMapper extends BaseMapper<CsProjectEquipmentPO> {
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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.CsDictMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsDictPO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table cs_dict-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="pid" jdbcType="VARCHAR" property="pid" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="another_name" jdbcType="VARCHAR" property="anotherName" />
|
||||
<result column="state" jdbcType="BOOLEAN" property="state" />
|
||||
<result column="sort" jdbcType="TINYINT" property="sort" />
|
||||
<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, pid, `name`, another_name, `state`, sort, create_by, create_time, update_by,
|
||||
update_time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -4,25 +4,25 @@
|
||||
<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" />
|
||||
<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-->
|
||||
@@ -30,4 +30,23 @@
|
||||
producte_time, check_time, debug_time, cntract_no, sales_manager, `status`, create_by,
|
||||
create_time, update_by, update_time
|
||||
</sql>
|
||||
<select id="queryProjectEquipmentVO" resultType="com.njcn.algorithm.pojo.vo.ProjectEquipmentVO">
|
||||
SELECT
|
||||
a.id projectId,
|
||||
a.name projectName,
|
||||
a.project_type projectType,
|
||||
b.id equipmentId,
|
||||
b.name equipmentName
|
||||
FROM cs_project a,
|
||||
cs_equipment_delivery b,
|
||||
cs_project_equipment c
|
||||
WHERE a.id = c.project_id
|
||||
AND b.id = c.equipment_id
|
||||
<if test="projectEquipmentQueryParm!=null and projectEquipmentQueryParm.projectType != null and projectEquipmentQueryParm.projectType !=''">
|
||||
AND a.project_type = #{projectEquipmentQueryParm.projectType}
|
||||
</if>
|
||||
<if test="projectEquipmentQueryParm!=null and projectEquipmentQueryParm.projectId != null and projectEquipmentQueryParm.projectId !=''">
|
||||
AND a.id = #{projectEquipmentQueryParm.projectId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?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.CsProjectEquipmentMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.algorithm.pojo.po.CsProjectEquipmentPO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table `cs_project_equipment`-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||
<result column="equipment_id" jdbcType="VARCHAR" property="equipmentId" />
|
||||
<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, project_id, equipment_id, `status`, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.algorithm.service;
|
||||
|
||||
import com.njcn.algorithm.pojo.param.CsDictAddParm;
|
||||
import com.njcn.algorithm.pojo.po.CsDictPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.algorithm.pojo.vo.CsDictVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 14:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsDictService extends IService<CsDictPO>{
|
||||
|
||||
|
||||
Boolean addDict(List<CsDictAddParm> csDictAddParms);
|
||||
|
||||
List<CsDictVO> queryDictData(String dictType);
|
||||
}
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.njcn.algorithm.service;
|
||||
|
||||
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
|
||||
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
/**
|
||||
import com.njcn.algorithm.pojo.param.CsEquipmentDeliveryAddParm;
|
||||
import com.njcn.algorithm.pojo.param.ProjectEquipmentQueryParm;
|
||||
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO;
|
||||
import com.njcn.algorithm.pojo.vo.ProjectEquipmentVO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
@@ -30,4 +35,20 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
|
||||
* @Date: 2023/3/31
|
||||
*/
|
||||
Boolean AuditEquipmentDelivery(String id);
|
||||
}
|
||||
/**
|
||||
* @Description: queryEquipmentByndid
|
||||
* @Param: [ndid]
|
||||
* @return: com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO
|
||||
* @Author: clam
|
||||
* @Date: 2023/3/31
|
||||
*/
|
||||
CsEquipmentDeliveryVO queryEquipmentByndid(String ndid);
|
||||
/**
|
||||
* @Description: queryEquipmentByProject
|
||||
* @Param: [projectEquipmentQueryParm]
|
||||
* @return: com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO
|
||||
* @Author: clam
|
||||
* @Date: 2023/4/3
|
||||
*/
|
||||
IPage<ProjectEquipmentVO> queryEquipmentByProject(ProjectEquipmentQueryParm projectEquipmentQueryParm);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.algorithm.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.algorithm.pojo.po.CsProjectEquipmentPO;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 10:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsProjectEquipmentService extends IService<CsProjectEquipmentPO>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
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.CsDictMapper;
|
||||
import com.njcn.algorithm.pojo.param.CsDictAddParm;
|
||||
import com.njcn.algorithm.pojo.po.CsDictPO;
|
||||
import com.njcn.algorithm.pojo.vo.CsDictVO;
|
||||
import com.njcn.algorithm.service.CsDictService;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 14:53【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class CsDictServiceImpl extends ServiceImpl<CsDictMapper, CsDictPO> implements CsDictService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public Boolean addDict(List<CsDictAddParm> csDictAddParms) {
|
||||
|
||||
QueryWrapper<CsDictPO> wrapper = new QueryWrapper<> ( );
|
||||
csDictAddParms.stream ( ).forEach (temp -> {
|
||||
wrapper.clear ( );
|
||||
wrapper.eq ("name", temp.getTypeName ( ));
|
||||
CsDictPO csDictPO = this.getBaseMapper ( ).selectOne (wrapper);
|
||||
if (Objects.isNull (csDictPO)) {
|
||||
csDictPO = new CsDictPO ( );
|
||||
csDictPO.setPid ("0");
|
||||
csDictPO.setName (temp.getTypeName ( ));
|
||||
csDictPO.setAnotherName (temp.getTypeAnotherName ( ));
|
||||
csDictPO.setState ("1");
|
||||
csDictPO.setSort (0);
|
||||
this.save (csDictPO);
|
||||
}
|
||||
wrapper.clear ( );
|
||||
wrapper.eq ("name", temp.getName ( ));
|
||||
CsDictPO csDictPO1 = this.getBaseMapper ( ).selectOne (wrapper);
|
||||
if (Objects.isNull (csDictPO1)) {
|
||||
csDictPO1 = new CsDictPO ( );
|
||||
BeanUtils.copyProperties (temp, csDictPO1);
|
||||
csDictPO1.setPid (csDictPO.getId ( ));
|
||||
csDictPO1.setState ("1");
|
||||
csDictPO1.setSort (0);
|
||||
this.save (csDictPO1);
|
||||
}
|
||||
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsDictVO> queryDictData(String dictType) {
|
||||
QueryWrapper<CsDictPO> wrapper = new QueryWrapper<> ( );
|
||||
wrapper.eq ("name", dictType).
|
||||
eq ("pid", "0").
|
||||
eq ("state", "1");
|
||||
CsDictPO csDictPO = this.getBaseMapper ( ).selectOne (wrapper);
|
||||
if(Objects.isNull (csDictPO)){
|
||||
throw new BusinessException (AlgorithmResponseEnum.DICT_DATA_ERROR);
|
||||
}else{
|
||||
wrapper.clear ();
|
||||
wrapper.eq ("pid", csDictPO.getId ());
|
||||
}
|
||||
List<CsDictPO> csDictPOS = this.getBaseMapper ( ).selectList (wrapper);
|
||||
|
||||
return csDictPOS.stream ().map (temp->{
|
||||
CsDictVO csDictVO = new CsDictVO();
|
||||
BeanUtils.copyProperties (temp, csDictVO);
|
||||
return csDictVO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,21 @@
|
||||
package com.njcn.algorithm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.param.ProjectEquipmentQueryParm;
|
||||
import com.njcn.algorithm.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.algorithm.pojo.vo.AppProjectVO;
|
||||
import com.njcn.algorithm.pojo.vo.CsEquipmentDeliveryVO;
|
||||
import com.njcn.algorithm.pojo.vo.ProjectEquipmentVO;
|
||||
import com.njcn.algorithm.service.CsEquipmentDeliveryService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
@@ -34,8 +42,27 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
|
||||
public Boolean AuditEquipmentDelivery(String id) {
|
||||
UpdateWrapper<CsEquipmentDeliveryPO> wrapper = new UpdateWrapper();
|
||||
wrapper.eq ("id", id);
|
||||
wrapper.set ("status", "1");
|
||||
wrapper.set ("status", "0");
|
||||
boolean update = this.update (wrapper);
|
||||
return update;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CsEquipmentDeliveryVO queryEquipmentByndid(String ndid) {
|
||||
CsEquipmentDeliveryVO result = new CsEquipmentDeliveryVO();
|
||||
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
|
||||
wrapper.eq ("ndid", ndid);
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.baseMapper.selectOne (wrapper);
|
||||
BeanUtils.copyProperties (csEquipmentDeliveryPO,result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ProjectEquipmentVO> queryEquipmentByProject(ProjectEquipmentQueryParm projectEquipmentQueryParm) {
|
||||
Page<ProjectEquipmentVO> returnpage = new Page<> (projectEquipmentQueryParm.getCurrentPage ( ), projectEquipmentQueryParm.getPageSize ( ));
|
||||
|
||||
|
||||
Page<ProjectEquipmentVO> list = this.baseMapper.queryProjectEquipmentVO(returnpage,projectEquipmentQueryParm);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.algorithm.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.algorithm.mapper.CsProjectEquipmentMapper;
|
||||
import com.njcn.algorithm.pojo.po.CsProjectEquipmentPO;
|
||||
import com.njcn.algorithm.service.CsProjectEquipmentService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* 接口文档访问地址:http://serverIP:port/swagger-ui.html
|
||||
* Date: 2023/4/3 10:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class CsProjectEquipmentServiceImpl extends ServiceImpl<CsProjectEquipmentMapper, CsProjectEquipmentPO> implements CsProjectEquipmentService {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user