From 38427cfc0d8a6481d27f7727e4efe6383628aaaf Mon Sep 17 00:00:00 2001 From: huangzj <826100833@qq.com> Date: Mon, 3 Apr 2023 18:11:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=AE=BE=E5=A4=87=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=AD=97=E5=85=B8=E8=A1=A8?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../enums/AlgorithmResponseEnum.java | 1 + .../algorithm/pojo/param/CsDictAddParm.java | 46 +++++++ .../param/CsEquipmentDeliveryQueryParm.java | 109 ++++++++++++++++ .../pojo/param/ProjectEquipmentQueryParm.java | 34 +++++ .../com/njcn/algorithm/pojo/po/CsDictPO.java | 60 +++++++++ .../pojo/po/CsProjectEquipmentPO.java | 46 +++++++ .../com/njcn/algorithm/pojo/vo/CsDictVO.java | 58 +++++++++ .../pojo/vo/CsEquipmentDeliveryVO.java | 120 ++++++++++++++++++ .../algorithm/pojo/vo/ProjectEquipmentVO.java | 36 ++++++ .../EquipmentDeliveryController.java | 37 ++++++ .../controller/dict/DictDataController.java | 57 +++++++++ .../njcn/algorithm/mapper/CsDictMapper.java | 16 +++ .../mapper/CsEquipmentDeliveryMapper.java | 5 + .../mapper/CsProjectEquipmentMapper.java | 16 +++ .../algorithm/mapper/mapping/CsDictMapper.xml | 23 ++++ .../mapping/CsEquipmentDeliveryMapper.xml | 77 ++++++----- .../mapping/CsProject EquipmentMapper.xml | 20 +++ .../njcn/algorithm/service/CsDictService.java | 25 ++++ .../service/CsEquipmentDeliveryService.java | 29 ++++- .../service/CsProjectEquipmentService.java | 19 +++ .../service/impl/CsDictServiceImpl.java | 86 +++++++++++++ .../impl/CsEquipmentDeliveryServiceImpl.java | 29 ++++- .../impl/CsProjectEquipmentServiceImpl.java | 22 ++++ 23 files changed, 937 insertions(+), 34 deletions(-) create mode 100644 pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/CsDictAddParm.java create mode 100644 pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/CsEquipmentDeliveryQueryParm.java create mode 100644 pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/ProjectEquipmentQueryParm.java create mode 100644 pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/po/CsDictPO.java create mode 100644 pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/po/CsProjectEquipmentPO.java create mode 100644 pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/CsDictVO.java create mode 100644 pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/CsEquipmentDeliveryVO.java create mode 100644 pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/ProjectEquipmentVO.java create mode 100644 pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/controller/dict/DictDataController.java create mode 100644 pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsDictMapper.java create mode 100644 pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsProjectEquipmentMapper.java create mode 100644 pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsDictMapper.xml create mode 100644 pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsProject EquipmentMapper.xml create mode 100644 pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsDictService.java create mode 100644 pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsProjectEquipmentService.java create mode 100644 pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsDictServiceImpl.java create mode 100644 pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsProjectEquipmentServiceImpl.java diff --git a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/enums/AlgorithmResponseEnum.java b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/enums/AlgorithmResponseEnum.java index e3ebb1cd4..8edbc64c4 100644 --- a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/enums/AlgorithmResponseEnum.java +++ b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/enums/AlgorithmResponseEnum.java @@ -15,6 +15,7 @@ public enum AlgorithmResponseEnum { * A00500 ~ A01550 用于终端模块的枚举 */ PROJECT_COMMON_ERROR("A00500","同一用户下项目名不能相同"), + DICT_DATA_ERROR("A00501","暂无此字典表类型"), ; diff --git a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/CsDictAddParm.java b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/CsDictAddParm.java new file mode 100644 index 000000000..72929a530 --- /dev/null +++ b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/CsDictAddParm.java @@ -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; + +} \ No newline at end of file diff --git a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/CsEquipmentDeliveryQueryParm.java b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/CsEquipmentDeliveryQueryParm.java new file mode 100644 index 000000000..d5e6eff52 --- /dev/null +++ b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/CsEquipmentDeliveryQueryParm.java @@ -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; + + + +} \ No newline at end of file diff --git a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/ProjectEquipmentQueryParm.java b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/ProjectEquipmentQueryParm.java new file mode 100644 index 000000000..ab89661fc --- /dev/null +++ b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/param/ProjectEquipmentQueryParm.java @@ -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; +} diff --git a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/po/CsDictPO.java b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/po/CsDictPO.java new file mode 100644 index 000000000..a5bccb3a6 --- /dev/null +++ b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/po/CsDictPO.java @@ -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; + +} \ No newline at end of file diff --git a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/po/CsProjectEquipmentPO.java b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/po/CsProjectEquipmentPO.java new file mode 100644 index 000000000..f2d007c12 --- /dev/null +++ b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/po/CsProjectEquipmentPO.java @@ -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; + + +} \ No newline at end of file diff --git a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/CsDictVO.java b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/CsDictVO.java new file mode 100644 index 000000000..bc22e9030 --- /dev/null +++ b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/CsDictVO.java @@ -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; + +} \ No newline at end of file diff --git a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/CsEquipmentDeliveryVO.java b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/CsEquipmentDeliveryVO.java new file mode 100644 index 000000000..40b83ea8a --- /dev/null +++ b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/CsEquipmentDeliveryVO.java @@ -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; + + +} \ No newline at end of file diff --git a/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/ProjectEquipmentVO.java b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/ProjectEquipmentVO.java new file mode 100644 index 000000000..cfa439bd0 --- /dev/null +++ b/pqs-algorithm/algorithm-api/main/java/com/njcn/algorithm/pojo/vo/ProjectEquipmentVO.java @@ -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; + + +} \ No newline at end of file diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/controller/Equipment/EquipmentDeliveryController.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/controller/Equipment/EquipmentDeliveryController.java index 6ded751f2..0ffc69d30 100644 --- a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/controller/Equipment/EquipmentDeliveryController.java +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/controller/Equipment/EquipmentDeliveryController.java @@ -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> queryEquipment(@Validated @RequestBody AppProjectQueryParm appProjectQueryParm){ +// String methodDescribe = getMethodDescribe("queryEquipment"); +// +// List 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 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> queryEquipmentByProject(@RequestBody ProjectEquipmentQueryParm projectEquipmentQueryParm){ + String methodDescribe = getMethodDescribe("queryEquipmentByProject"); + + IPage projectEquipmentVOS = csEquipmentDeliveryService.queryEquipmentByProject(projectEquipmentQueryParm); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, projectEquipmentVOS, methodDescribe); + } + } diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/controller/dict/DictDataController.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/controller/dict/DictDataController.java new file mode 100644 index 000000000..c91df009c --- /dev/null +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/controller/dict/DictDataController.java @@ -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 addDict(@RequestBody @Validated List 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> queryDictData(@RequestParam("dictType")String dictType ){ + String methodDescribe = getMethodDescribe("queryDictData"); + List csDictVOList = csDictService.queryDictData(dictType); + + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csDictVOList, methodDescribe); + } +} diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsDictMapper.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsDictMapper.java new file mode 100644 index 000000000..5faf90ae1 --- /dev/null +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsDictMapper.java @@ -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 { +} \ No newline at end of file diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsEquipmentDeliveryMapper.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsEquipmentDeliveryMapper.java index 427de4676..d339d1541 100644 --- a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsEquipmentDeliveryMapper.java +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsEquipmentDeliveryMapper.java @@ -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 { + Page queryProjectEquipmentVO(Page returnpage,@Param("projectEquipmentQueryParm")ProjectEquipmentQueryParm projectEquipmentQueryParm); } \ No newline at end of file diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsProjectEquipmentMapper.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsProjectEquipmentMapper.java new file mode 100644 index 000000000..650cfab76 --- /dev/null +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/CsProjectEquipmentMapper.java @@ -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 { +} \ No newline at end of file diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsDictMapper.xml b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsDictMapper.xml new file mode 100644 index 000000000..2513ad962 --- /dev/null +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsDictMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + id, pid, `name`, another_name, `state`, sort, create_by, create_time, update_by, + update_time + + \ No newline at end of file diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsEquipmentDeliveryMapper.xml b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsEquipmentDeliveryMapper.xml index 803ea227d..4649f5c03 100644 --- a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsEquipmentDeliveryMapper.xml +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsEquipmentDeliveryMapper.xml @@ -1,33 +1,52 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + \ No newline at end of file diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsProject EquipmentMapper.xml b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsProject EquipmentMapper.xml new file mode 100644 index 000000000..95553b262 --- /dev/null +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/mapper/mapping/CsProject EquipmentMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + id, project_id, equipment_id, `status`, create_by, create_time, update_by, update_time + + \ No newline at end of file diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsDictService.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsDictService.java new file mode 100644 index 000000000..338a75be3 --- /dev/null +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsDictService.java @@ -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{ + + + Boolean addDict(List csDictAddParms); + + List queryDictData(String dictType); +} diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsEquipmentDeliveryService.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsEquipmentDeliveryService.java index 0b9734ea9..a5b817b65 100644 --- a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsEquipmentDeliveryService.java +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsEquipmentDeliveryService.java @@ -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 queryEquipmentByProject(ProjectEquipmentQueryParm projectEquipmentQueryParm); +} diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsProjectEquipmentService.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsProjectEquipmentService.java new file mode 100644 index 000000000..285d2ceb7 --- /dev/null +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/CsProjectEquipmentService.java @@ -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{ + + +} diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsDictServiceImpl.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsDictServiceImpl.java new file mode 100644 index 000000000..3eadb4133 --- /dev/null +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsDictServiceImpl.java @@ -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 implements CsDictService { + + @Override + @Transactional(rollbackFor = {Exception.class}) + public Boolean addDict(List csDictAddParms) { + + QueryWrapper 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 queryDictData(String dictType) { + QueryWrapper 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 csDictPOS = this.getBaseMapper ( ).selectList (wrapper); + + return csDictPOS.stream ().map (temp->{ + CsDictVO csDictVO = new CsDictVO(); + BeanUtils.copyProperties (temp, csDictVO); + return csDictVO; + }).collect(Collectors.toList()); + } +} diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsEquipmentDeliveryServiceImpl.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsEquipmentDeliveryServiceImpl.java index 73a155fad..729cc46ee 100644 --- a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsEquipmentDeliveryServiceImpl.java +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsEquipmentDeliveryServiceImpl.java @@ -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 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 wrapper = new QueryWrapper(); + wrapper.eq ("ndid", ndid); + CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.baseMapper.selectOne (wrapper); + BeanUtils.copyProperties (csEquipmentDeliveryPO,result); + return result; + } + + @Override + public IPage queryEquipmentByProject(ProjectEquipmentQueryParm projectEquipmentQueryParm) { + Page returnpage = new Page<> (projectEquipmentQueryParm.getCurrentPage ( ), projectEquipmentQueryParm.getPageSize ( )); + + + Page list = this.baseMapper.queryProjectEquipmentVO(returnpage,projectEquipmentQueryParm); + return list; + } } diff --git a/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsProjectEquipmentServiceImpl.java b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsProjectEquipmentServiceImpl.java new file mode 100644 index 000000000..f5866bd47 --- /dev/null +++ b/pqs-algorithm/algorithm-boot/src/main/java/com/njcn/algorithm/service/impl/CsProjectEquipmentServiceImpl.java @@ -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 implements CsProjectEquipmentService { + +}