From daffb6e52213ce8661f9bc72571eb20627653332 Mon Sep 17 00:00:00 2001 From: zhaoxianglong Date: Fri, 5 Jan 2024 11:37:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AE=BE=E5=A4=87,?= =?UTF-8?q?=E4=BA=A7=E5=93=81,=E8=B7=AF=E7=BD=91=E8=AE=BE=E6=96=BD,?= =?UTF-8?q?=E9=81=93=E8=B7=AF=E4=BF=A1=E6=81=AF,=E6=A1=A9=E5=8F=B7?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcDeviceController.java | 116 ++++++++ .../controller/DcFacilityController.java | 115 ++++++++ .../controller/DcProductController.java | 115 ++++++++ .../business/controller/DcRoadController.java | 115 ++++++++ .../controller/DcStakeMarkController.java | 115 ++++++++ .../java/com/zc/business/domain/DcDevice.java | 50 ++++ .../com/zc/business/domain/DcFacility.java | 40 +++ .../com/zc/business/domain/DcProduct.java | 34 +++ .../java/com/zc/business/domain/DcRoad.java | 28 ++ .../com/zc/business/domain/DcStakeMark.java | 31 +++ .../zc/business/mapper/DcDeviceMapper.java | 14 + .../zc/business/mapper/DcFacilityMapper.java | 14 + .../zc/business/mapper/DcProductMapper.java | 14 + .../com/zc/business/mapper/DcRoadMapper.java | 14 + .../zc/business/mapper/DcStakeMarkMapper.java | 14 + .../zc/business/service/IDcDeviceService.java | 64 +++++ .../business/service/IDcFacilityService.java | 63 +++++ .../business/service/IDcProductService.java | 63 +++++ .../zc/business/service/IDcRoadService.java | 63 +++++ .../business/service/IDcStakeMarkService.java | 63 +++++ .../service/impl/DcDeviceServiceImpl.java | 258 ++++++++++++++++++ .../service/impl/DcFacilityServiceImpl.java | 144 ++++++++++ .../service/impl/DcProductServiceImpl.java | 144 ++++++++++ .../service/impl/DcRoadServiceImpl.java | 129 +++++++++ .../service/impl/DcStakeMarkServiceImpl.java | 129 +++++++++ 25 files changed, 1949 insertions(+) create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcFacilityController.java create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcProductController.java create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcRoadController.java create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcStakeMarkController.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcDevice.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcFacility.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcProduct.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcRoad.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcStakeMark.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcFacilityMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcProductMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcRoadMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcStakeMarkMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcFacilityService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcProductService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcRoadService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcStakeMarkService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcFacilityServiceImpl.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcProductServiceImpl.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcRoadServiceImpl.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java diff --git a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java new file mode 100644 index 00000000..ebc8c31c --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java @@ -0,0 +1,116 @@ +package com.zc.business.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcDevice; +import com.zc.business.service.IDcDeviceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * 设备Controller + * + * @author zhaoxianglong + */ +@Api("设备") +@RestController +@RequestMapping("/iot/device") +public class DcDeviceController extends BaseController { + // + @Resource + private IDcDeviceService dcDeviceService; + + //*********************************设备增删改查****************************************** + + /** + * 分页查询设备列表 + * + * @param dcDevice 请求参数 + * @return 分页查询结果 + */ + @ApiOperation("分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:device:list')") + @GetMapping("list") + public TableDataInfo listDevice(DcDevice dcDevice) { + return getDataTable(dcDeviceService.pageDevice(dcDevice)); + } + + /** + * 无分页查询设备列表 + * + * @param dcDevice 请求参数 + * @return 查询结果 + */ + @ApiOperation("无分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:device:query')") + @GetMapping("query") + public AjaxResult queryDevice(DcDevice dcDevice) { + return AjaxResult.success(dcDeviceService.listDevice(dcDevice)); + } + + /** + * 根据id查询设备信息 + * + * @param id id + * @return 查询结果 + */ + @ApiOperation("根据id查询设备信息") + @PreAuthorize("@ss.hasPermi('iot:device:query')") + @GetMapping("{id}") + public AjaxResult getDevice(@PathVariable String id) { + return AjaxResult.success(dcDeviceService.getDevice(id)); + } + + + /** + * 新增 + * + * @param dcDevice 新增参数 + * @return 新增操作结果 + */ + @ApiOperation("新增") + @PreAuthorize("@ss.hasPermi('iot:device:add')") + @Log(title = "新增设备", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addDevice(@Valid @RequestBody DcDevice dcDevice) { + return toAjax(dcDeviceService.addDevice(dcDevice)); + } + + /** + * 修改 + * + * @param dcDevice 修改参数 + * @return 修改操作结果 + */ + @ApiOperation("修改") + @PreAuthorize("@ss.hasPermi('iot:device:edit')") + @Log(title = "修改设备", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult editDevice(@Valid @RequestBody DcDevice dcDevice) { + return toAjax(dcDeviceService.editDevice(dcDevice)); + } + + /** + * 删除 + * + * @param ids id集 + * @return 删除操作结果 + */ + @ApiOperation("删除") + @PreAuthorize("@ss.hasPermi('iot:device:remove')") + @Log(title = "删除", businessType = BusinessType.DELETE) + @DeleteMapping("{ids}") + public AjaxResult removeDevice(@PathVariable List ids) { + return toAjax(dcDeviceService.removeDevice(ids)); + } + +} diff --git a/zc-business/src/main/java/com/zc/business/controller/DcFacilityController.java b/zc-business/src/main/java/com/zc/business/controller/DcFacilityController.java new file mode 100644 index 00000000..536ffc7b --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcFacilityController.java @@ -0,0 +1,115 @@ +package com.zc.business.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcFacility; +import com.zc.business.service.IDcFacilityService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * 路网设施Controller + * + * @author zhaoxianglong + */ +@Api("路网设施") +@RestController +@RequestMapping("/iot/facility") +public class DcFacilityController extends BaseController { + @Resource + private IDcFacilityService dcFacilityService; + + //*********************************设备增删改查****************************************** + + /** + * 分页查询设备列表 + * + * @param dcFacility 请求参数 + * @return 分页查询结果 + */ + @ApiOperation("分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:facility:list')") + @GetMapping("list") + public TableDataInfo listFacility(DcFacility dcFacility) { + return getDataTable(dcFacilityService.pageFacility(dcFacility)); + } + + /** + * 无分页查询设备列表 + * + * @param dcFacility 请求参数 + * @return 查询结果 + */ + @ApiOperation("无分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:facility:query')") + @GetMapping("query") + public AjaxResult queryFacility(DcFacility dcFacility) { + return AjaxResult.success(dcFacilityService.listFacility(dcFacility)); + } + + /** + * 根据id查询设备信息 + * + * @param id id + * @return 查询结果 + */ + @ApiOperation("根据id查询设备信息") + @PreAuthorize("@ss.hasPermi('iot:facility:query')") + @GetMapping("{id}") + public AjaxResult getFacility(@PathVariable String id) { + return AjaxResult.success(dcFacilityService.getFacility(id)); + } + + + /** + * 新增 + * + * @param dcFacility 新增参数 + * @return 新增操作结果 + */ + @ApiOperation("新增") + @PreAuthorize("@ss.hasPermi('iot:facility:add')") + @Log(title = "新增设备", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addFacility(@Valid @RequestBody DcFacility dcFacility) { + return toAjax(dcFacilityService.addFacility(dcFacility)); + } + + /** + * 修改 + * + * @param dcFacility 修改参数 + * @return 修改操作结果 + */ + @ApiOperation("修改") + @PreAuthorize("@ss.hasPermi('iot:facility:edit')") + @Log(title = "修改设备", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult editFacility(@Valid @RequestBody DcFacility dcFacility) { + return toAjax(dcFacilityService.editFacility(dcFacility)); + } + + /** + * 删除 + * + * @param ids id集 + * @return 删除操作结果 + */ + @ApiOperation("删除") + @PreAuthorize("@ss.hasPermi('iot:facility:remove')") + @Log(title = "删除", businessType = BusinessType.DELETE) + @DeleteMapping("{ids}") + public AjaxResult removeFacility(@PathVariable List ids) { + return toAjax(dcFacilityService.removeFacility(ids)); + } + +} diff --git a/zc-business/src/main/java/com/zc/business/controller/DcProductController.java b/zc-business/src/main/java/com/zc/business/controller/DcProductController.java new file mode 100644 index 00000000..b6f21eea --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcProductController.java @@ -0,0 +1,115 @@ +package com.zc.business.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcProduct; +import com.zc.business.service.IDcProductService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * 产品Controller + * + * @author zhaoxianglong + */ +@Api("产品") +@RestController +@RequestMapping("/iot/product") +public class DcProductController extends BaseController { + @Resource + private IDcProductService dcProdurtService; + + //*********************************设备增删改查****************************************** + + /** + * 分页查询设备列表 + * + * @param dcProduct 请求参数 + * @return 分页查询结果 + */ + @ApiOperation("分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:product:list')") + @GetMapping("list") + public TableDataInfo listProduct(DcProduct dcProduct) { + return getDataTable(dcProdurtService.pageProduct(dcProduct)); + } + + /** + * 无分页查询设备列表 + * + * @param dcProduct 请求参数 + * @return 查询结果 + */ + @ApiOperation("无分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:product:query')") + @GetMapping("query") + public AjaxResult queryProduct(DcProduct dcProduct) { + return AjaxResult.success(dcProdurtService.listProduct(dcProduct)); + } + + /** + * 根据id查询设备信息 + * + * @param id id + * @return 查询结果 + */ + @ApiOperation("根据id查询设备信息") + @PreAuthorize("@ss.hasPermi('iot:product:query')") + @GetMapping("{id}") + public AjaxResult getProduct(@PathVariable String id) { + return AjaxResult.success(dcProdurtService.getProduct(id)); + } + + + /** + * 新增 + * + * @param dcProduct 新增参数 + * @return 新增操作结果 + */ + @ApiOperation("新增") + @PreAuthorize("@ss.hasPermi('iot:product:add')") + @Log(title = "新增设备", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addProduct(@Valid @RequestBody DcProduct dcProduct) { + return toAjax(dcProdurtService.addProduct(dcProduct)); + } + + /** + * 修改 + * + * @param dcProduct 修改参数 + * @return 修改操作结果 + */ + @ApiOperation("修改") + @PreAuthorize("@ss.hasPermi('iot:product:edit')") + @Log(title = "修改设备", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult editProduct(@Valid @RequestBody DcProduct dcProduct) { + return toAjax(dcProdurtService.editProduct(dcProduct)); + } + + /** + * 删除 + * + * @param ids id集 + * @return 删除操作结果 + */ + @ApiOperation("删除") + @PreAuthorize("@ss.hasPermi('iot:product:remove')") + @Log(title = "删除", businessType = BusinessType.DELETE) + @DeleteMapping("{ids}") + public AjaxResult removeProduct(@PathVariable List ids) { + return toAjax(dcProdurtService.removeProduct(ids)); + } + +} diff --git a/zc-business/src/main/java/com/zc/business/controller/DcRoadController.java b/zc-business/src/main/java/com/zc/business/controller/DcRoadController.java new file mode 100644 index 00000000..344dc8bd --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcRoadController.java @@ -0,0 +1,115 @@ +package com.zc.business.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcRoad; +import com.zc.business.service.IDcRoadService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * 道路信息Controller + * + * @author zhaoxianglong + */ +@Api("道路信息") +@RestController +@RequestMapping("/iot/road") +public class DcRoadController extends BaseController { + @Resource + private IDcRoadService dcRoadService; + + //*********************************设备增删改查****************************************** + + /** + * 分页查询设备列表 + * + * @param dcRoad 请求参数 + * @return 分页查询结果 + */ + @ApiOperation("分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:road:list')") + @GetMapping("list") + public TableDataInfo listRoad(DcRoad dcRoad) { + return getDataTable(dcRoadService.pageRoad(dcRoad)); + } + + /** + * 无分页查询设备列表 + * + * @param dcRoad 请求参数 + * @return 查询结果 + */ + @ApiOperation("无分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:road:query')") + @GetMapping("query") + public AjaxResult queryRoad(DcRoad dcRoad) { + return AjaxResult.success(dcRoadService.listRoad(dcRoad)); + } + + /** + * 根据id查询设备信息 + * + * @param id id + * @return 查询结果 + */ + @ApiOperation("根据id查询设备信息") + @PreAuthorize("@ss.hasPermi('iot:road:query')") + @GetMapping("{id}") + public AjaxResult getRoad(@PathVariable String id) { + return AjaxResult.success(dcRoadService.getRoad(id)); + } + + + /** + * 新增 + * + * @param dcRoad 新增参数 + * @return 新增操作结果 + */ + @ApiOperation("新增") + @PreAuthorize("@ss.hasPermi('iot:road:add')") + @Log(title = "新增设备", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addRoad(@Valid @RequestBody DcRoad dcRoad) { + return toAjax(dcRoadService.addRoad(dcRoad)); + } + + /** + * 修改 + * + * @param dcRoad 修改参数 + * @return 修改操作结果 + */ + @ApiOperation("修改") + @PreAuthorize("@ss.hasPermi('iot:road:edit')") + @Log(title = "修改设备", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult editRoad(@Valid @RequestBody DcRoad dcRoad) { + return toAjax(dcRoadService.editRoad(dcRoad)); + } + + /** + * 删除 + * + * @param ids id集 + * @return 删除操作结果 + */ + @ApiOperation("删除") + @PreAuthorize("@ss.hasPermi('iot:road:remove')") + @Log(title = "删除", businessType = BusinessType.DELETE) + @DeleteMapping("{ids}") + public AjaxResult removeRoad(@PathVariable List ids) { + return toAjax(dcRoadService.removeRoad(ids)); + } + +} diff --git a/zc-business/src/main/java/com/zc/business/controller/DcStakeMarkController.java b/zc-business/src/main/java/com/zc/business/controller/DcStakeMarkController.java new file mode 100644 index 00000000..0c4ba362 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcStakeMarkController.java @@ -0,0 +1,115 @@ +package com.zc.business.controller; + +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.zc.business.domain.DcStakeMark; +import com.zc.business.service.IDcStakeMarkService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; +import java.util.List; + +/** + * 桩号Controller + * + * @author zhaoxianglong + */ +@Api("桩号") +@RestController +@RequestMapping("/iot/stakeMark") +public class DcStakeMarkController extends BaseController { + @Resource + private IDcStakeMarkService dcStakeMarkService; + + //*********************************设备增删改查****************************************** + + /** + * 分页查询设备列表 + * + * @param dcStakeMark 请求参数 + * @return 分页查询结果 + */ + @ApiOperation("分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:stakeMark:list')") + @GetMapping("list") + public TableDataInfo listStakeMark(DcStakeMark dcStakeMark) { + return getDataTable(dcStakeMarkService.pageStakeMark(dcStakeMark)); + } + + /** + * 无分页查询设备列表 + * + * @param dcStakeMark 请求参数 + * @return 查询结果 + */ + @ApiOperation("无分页查询设备列表") + @PreAuthorize("@ss.hasPermi('iot:stakeMark:query')") + @GetMapping("query") + public AjaxResult queryStakeMark(DcStakeMark dcStakeMark) { + return AjaxResult.success(dcStakeMarkService.listStakeMark(dcStakeMark)); + } + + /** + * 根据id查询设备信息 + * + * @param id id + * @return 查询结果 + */ + @ApiOperation("根据id查询设备信息") + @PreAuthorize("@ss.hasPermi('iot:stakeMark:query')") + @GetMapping("{id}") + public AjaxResult getStakeMark(@PathVariable String id) { + return AjaxResult.success(dcStakeMarkService.getStakeMark(id)); + } + + + /** + * 新增 + * + * @param dcStakeMark 新增参数 + * @return 新增操作结果 + */ + @ApiOperation("新增") + @PreAuthorize("@ss.hasPermi('iot:stakeMark:add')") + @Log(title = "新增设备", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult addStakeMark(@Valid @RequestBody DcStakeMark dcStakeMark) { + return toAjax(dcStakeMarkService.addStakeMark(dcStakeMark)); + } + + /** + * 修改 + * + * @param dcStakeMark 修改参数 + * @return 修改操作结果 + */ + @ApiOperation("修改") + @PreAuthorize("@ss.hasPermi('iot:stakeMark:edit')") + @Log(title = "修改设备", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult editStakeMark(@Valid @RequestBody DcStakeMark dcStakeMark) { + return toAjax(dcStakeMarkService.editStakeMark(dcStakeMark)); + } + + /** + * 删除 + * + * @param ids id集 + * @return 删除操作结果 + */ + @ApiOperation("删除") + @PreAuthorize("@ss.hasPermi('iot:stakeMark:remove')") + @Log(title = "删除", businessType = BusinessType.DELETE) + @DeleteMapping("{ids}") + public AjaxResult removeStakeMark(@PathVariable List ids) { + return toAjax(dcStakeMarkService.removeStakeMark(ids)); + } + +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcDevice.java b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java new file mode 100644 index 00000000..e9e6364b --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcDevice.java @@ -0,0 +1,50 @@ +package com.zc.business.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "DcDevice", description = "设备实体") +public class DcDevice { + + public static final Integer UNUSEDSTATE = 0; + public static final Integer USEOFSTATE = 1; + @ApiModelProperty("ID") + private Long id; + @ApiModelProperty("物联设备ID") + private String iotDeviceId; + @ApiModelProperty("组ID") + private Long groupId; + @ApiModelProperty("产品ID") + private Long productId; + @ApiModelProperty("桩号") + private String stakeMarkId; + @ApiModelProperty("道路标识") + private Long roadId; + @ApiModelProperty("设备名称") + private String deviceName; + @ApiModelProperty("设备类型") + private Integer deviceType; + @ApiModelProperty("安装日期") + private Date installationDate; + @ApiModelProperty("生产日期") + private Date productionDate; + @ApiModelProperty("使用年限") + private String durableYears; + @ApiModelProperty("安装位置") + private String installationSite; + @ApiModelProperty("使用状态") + private Integer useState; + @ApiModelProperty("其他配置") + private String otherConfig; + @ApiModelProperty("备注") + private String remark; + @ApiModelProperty("创建时间") + private Date createTime; + @ApiModelProperty("修改时间") + private Date updateTime; + +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcFacility.java b/zc-business/src/main/java/com/zc/business/domain/DcFacility.java new file mode 100644 index 00000000..33a8ea15 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcFacility.java @@ -0,0 +1,40 @@ +package com.zc.business.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "DcFacility", description = "路网设施实体") +public class DcFacility { + + public static final String UP = "1"; + public static final String CENTRE = "2"; + public static final String DOWN = "3"; + public static final String TOLLSTATION = "1"; + public static final String BRIDGE = "2"; + public static final String INTERCHANGE = "3"; + @ApiModelProperty("ID") + private Long id; + @ApiModelProperty("桩号") + private String stakeMarkId; + @ApiModelProperty("方向") + private String direction; + @ApiModelProperty("道路标识") + private String roadId; + @ApiModelProperty("设备类型") + private Integer facilityType; + @ApiModelProperty("设备名称") + private String facilityName; + @ApiModelProperty("备注") + private String remark; + @ApiModelProperty("其他配置") + private String otherConfig; + @ApiModelProperty("创建时间") + private Date createTime; + @ApiModelProperty("修改时间") + private Date updateTime; + +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcProduct.java b/zc-business/src/main/java/com/zc/business/domain/DcProduct.java new file mode 100644 index 00000000..98a51acd --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcProduct.java @@ -0,0 +1,34 @@ +package com.zc.business.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "DcProduct", description = "产品实体") +public class DcProduct { + + @ApiModelProperty("ID") + private Long id; + @ApiModelProperty("产品名称") + private String productName; + @ApiModelProperty("制造商") + private String manufacturer; + @ApiModelProperty("品牌") + private String brand; + @ApiModelProperty("模型") + private String model; + @ApiModelProperty("生产地") + private String productionPlace; + @ApiModelProperty("备注") + private String remark; + @ApiModelProperty("其他配置") + private String otherConfig; + @ApiModelProperty("创建时间") + private Date createTime; + @ApiModelProperty("修改时间") + private Date updateTime; + +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcRoad.java b/zc-business/src/main/java/com/zc/business/domain/DcRoad.java new file mode 100644 index 00000000..a5872cc5 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcRoad.java @@ -0,0 +1,28 @@ +package com.zc.business.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "DcRoad", description = "道路信息实体") +public class DcRoad { + + @ApiModelProperty("ID") + private Long id; + @ApiModelProperty("道路名称") + private String roadName; + @ApiModelProperty("道路方向") + private String roadDirection; + @ApiModelProperty("道路编号") + private String roadCode; + @ApiModelProperty("单位") + private String organization; + @ApiModelProperty("创建时间") + private Date createTime; + @ApiModelProperty("修改时间") + private Date updateTime; + +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcStakeMark.java b/zc-business/src/main/java/com/zc/business/domain/DcStakeMark.java new file mode 100644 index 00000000..4ad7c187 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcStakeMark.java @@ -0,0 +1,31 @@ +package com.zc.business.domain; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; + +@Data +@ApiModel(value = "DcStakeMark", description = "桩号实体") +public class DcStakeMark { + + public static final String UP = "1"; + public static final String CENTRE = "2"; + public static final String DOWN = "3"; + @ApiModelProperty("ID") + private String id; + @ApiModelProperty("经度") + private String longitude; + @ApiModelProperty("纬度") + private String latitude; + @ApiModelProperty("方向") + private String direction; + @ApiModelProperty("位置") + private String location; + @ApiModelProperty("创建时间") + private Date createTime; + @ApiModelProperty("修改时间") + private Date updateTime; + +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java new file mode 100644 index 00000000..40d4dcc7 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java @@ -0,0 +1,14 @@ +package com.zc.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zc.business.domain.DcDevice; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备Mapper接口 + * + * @author zhaoxianglong + */ +@Mapper +public interface DcDeviceMapper extends BaseMapper { +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcFacilityMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcFacilityMapper.java new file mode 100644 index 00000000..94b55783 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcFacilityMapper.java @@ -0,0 +1,14 @@ +package com.zc.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zc.business.domain.DcFacility; +import org.apache.ibatis.annotations.Mapper; + +/** + * 路网设施Mapper接口 + * + * @author zhaoxianglong + */ +@Mapper +public interface DcFacilityMapper extends BaseMapper { +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcProductMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcProductMapper.java new file mode 100644 index 00000000..ee2d7b38 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcProductMapper.java @@ -0,0 +1,14 @@ +package com.zc.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zc.business.domain.DcProduct; +import org.apache.ibatis.annotations.Mapper; + +/** + * 产品Mapper接口 + * + * @author zhaoxianglong + */ +@Mapper +public interface DcProductMapper extends BaseMapper { +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcRoadMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcRoadMapper.java new file mode 100644 index 00000000..23a0be1d --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcRoadMapper.java @@ -0,0 +1,14 @@ +package com.zc.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zc.business.domain.DcRoad; +import org.apache.ibatis.annotations.Mapper; + +/** + * 道路信息Mapper接口 + * + * @author zhaoxianglong + */ +@Mapper +public interface DcRoadMapper extends BaseMapper { +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcStakeMarkMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcStakeMarkMapper.java new file mode 100644 index 00000000..448050c3 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcStakeMarkMapper.java @@ -0,0 +1,14 @@ +package com.zc.business.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zc.business.domain.DcStakeMark; +import org.apache.ibatis.annotations.Mapper; + +/** + * 桩号Mapper接口 + * + * @author zhaoxianglong + */ +@Mapper +public interface DcStakeMarkMapper extends BaseMapper { +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java b/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java new file mode 100644 index 00000000..8500cb57 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java @@ -0,0 +1,64 @@ +package com.zc.business.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zc.business.domain.DcDevice; + +import java.util.List; + +/** + * 设备Service接口 + * + * @author zhaoxianglong + */ +public interface IDcDeviceService extends IService { + + /** + * 添加设备信息 + * + * @param dcDevice 设备信息 + * @return 操作结果 + */ + boolean addDevice(DcDevice dcDevice); + + /** + * 修改设备信息 + * + * @param dcDevice 设备信息 + * @return 操作结果 + */ + boolean editDevice(DcDevice dcDevice); + + /** + * 删除设备 + * + * @param ids 设备ID + * @return 操作结果 + */ + boolean removeDevice(List ids); + + /** + * 获取设备列表 + * + * @param dcDevice 参数 + * @return 结果 + */ + List pageDevice(DcDevice dcDevice); + + /** + * 获取设备列表 + * + * @param dcDevice 参数 + * @return 结果 + */ + List listDevice(DcDevice dcDevice); + + + /** + * 根据id查询设备信息 + * + * @param id 设备ID + * @return 设备信息 + */ + DcDevice getDevice(String id); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcFacilityService.java b/zc-business/src/main/java/com/zc/business/service/IDcFacilityService.java new file mode 100644 index 00000000..0f145de3 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcFacilityService.java @@ -0,0 +1,63 @@ +package com.zc.business.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zc.business.domain.DcFacility; + +import java.util.List; + +/** + * 路网设施Service接口 + * + * @author zhaoxianglong + */ +public interface IDcFacilityService extends IService { + /** + * 添加设备信息 + * + * @param dcFacility 设备信息 + * @return 操作结果 + */ + boolean addFacility(DcFacility dcFacility); + + /** + * 修改设备信息 + * + * @param dcFacility 设备信息 + * @return 操作结果 + */ + boolean editFacility(DcFacility dcFacility); + + /** + * 删除设备 + * + * @param ids 设备ID + * @return 操作结果 + */ + boolean removeFacility(List ids); + + /** + * 获取设备列表 + * + * @param dcFacility 参数 + * @return 结果 + */ + List pageFacility(DcFacility dcFacility); + + /** + * 获取设备列表 + * + * @param dcFacility 参数 + * @return 结果 + */ + List listFacility(DcFacility dcFacility); + + + /** + * 根据id查询设备信息 + * + * @param id 设备ID + * @return 设备信息 + */ + DcFacility getFacility(String id); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcProductService.java b/zc-business/src/main/java/com/zc/business/service/IDcProductService.java new file mode 100644 index 00000000..6b1cc350 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcProductService.java @@ -0,0 +1,63 @@ +package com.zc.business.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zc.business.domain.DcProduct; + +import java.util.List; + +/** + * 产品Service接口 + * + * @author zhaoxianglong + */ +public interface IDcProductService extends IService { + /** + * 添加设备信息 + * + * @param dcProduct 设备信息 + * @return 操作结果 + */ + boolean addProduct(DcProduct dcProduct); + + /** + * 修改设备信息 + * + * @param dcProduct 设备信息 + * @return 操作结果 + */ + boolean editProduct(DcProduct dcProduct); + + /** + * 删除设备 + * + * @param ids 设备ID + * @return 操作结果 + */ + boolean removeProduct(List ids); + + /** + * 获取设备列表 + * + * @param dcProduct 参数 + * @return 结果 + */ + List pageProduct(DcProduct dcProduct); + + /** + * 获取设备列表 + * + * @param dcProduct 参数 + * @return 结果 + */ + List listProduct(DcProduct dcProduct); + + + /** + * 根据id查询设备信息 + * + * @param id 设备ID + * @return 设备信息 + */ + DcProduct getProduct(String id); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcRoadService.java b/zc-business/src/main/java/com/zc/business/service/IDcRoadService.java new file mode 100644 index 00000000..064b3c15 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcRoadService.java @@ -0,0 +1,63 @@ +package com.zc.business.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zc.business.domain.DcRoad; + +import java.util.List; + +/** + * 道路信息Service接口 + * + * @author zhaoxianglong + */ +public interface IDcRoadService extends IService { + /** + * 添加设备信息 + * + * @param dcRoad 设备信息 + * @return 操作结果 + */ + boolean addRoad(DcRoad dcRoad); + + /** + * 修改设备信息 + * + * @param dcRoad 设备信息 + * @return 操作结果 + */ + boolean editRoad(DcRoad dcRoad); + + /** + * 删除设备 + * + * @param ids 设备ID + * @return 操作结果 + */ + boolean removeRoad(List ids); + + /** + * 获取设备列表 + * + * @param dcRoad 参数 + * @return 结果 + */ + List pageRoad(DcRoad dcRoad); + + /** + * 获取设备列表 + * + * @param dcRoad 参数 + * @return 结果 + */ + List listRoad(DcRoad dcRoad); + + + /** + * 根据id查询设备信息 + * + * @param id 设备ID + * @return 设备信息 + */ + DcRoad getRoad(String id); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcStakeMarkService.java b/zc-business/src/main/java/com/zc/business/service/IDcStakeMarkService.java new file mode 100644 index 00000000..8390bd34 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcStakeMarkService.java @@ -0,0 +1,63 @@ +package com.zc.business.service; + + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zc.business.domain.DcStakeMark; + +import java.util.List; + +/** + * 桩号Service接口 + * + * @author zhaoxianglong + */ +public interface IDcStakeMarkService extends IService { + /** + * 添加设备信息 + * + * @param dcStakeMark 设备信息 + * @return 操作结果 + */ + boolean addStakeMark(DcStakeMark dcStakeMark); + + /** + * 修改设备信息 + * + * @param dcStakeMark 设备信息 + * @return 操作结果 + */ + boolean editStakeMark(DcStakeMark dcStakeMark); + + /** + * 删除设备 + * + * @param ids 设备ID + * @return 操作结果 + */ + boolean removeStakeMark(List ids); + + /** + * 获取设备列表 + * + * @param dcStakeMark 参数 + * @return 结果 + */ + List pageStakeMark(DcStakeMark dcStakeMark); + + /** + * 获取设备列表 + * + * @param dcStakeMark 参数 + * @return 结果 + */ + List listStakeMark(DcStakeMark dcStakeMark); + + + /** + * 根据id查询设备信息 + * + * @param id 设备ID + * @return 设备信息 + */ + DcStakeMark getStakeMark(String id); +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java new file mode 100644 index 00000000..d75648de --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java @@ -0,0 +1,258 @@ +package com.zc.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.PageUtils; +import com.zc.business.domain.DcDevice; +import com.zc.business.domain.DcProduct; +import com.zc.business.mapper.DcDeviceMapper; +import com.zc.business.service.IDcDeviceService; +import com.zc.business.service.IDcProductService; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 设备Service业务层处理 + * + * @author zhaoxianglong + */ +@Service +public class DcDeviceServiceImpl extends ServiceImpl implements IDcDeviceService { + + @Resource + private IDcProductService dcProdurtService; + + public LambdaQueryWrapper deviceQueryWrapper(DcDevice dcDevice) { + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + // 设备ID + if (Objects.nonNull(dcDevice.getId())) { + queryWrapper.eq(DcDevice::getId, dcDevice.getId()); + } + + // 物联设备ID + if (StringUtils.hasText(dcDevice.getIotDeviceId())) { + queryWrapper.eq(DcDevice::getIotDeviceId, dcDevice.getIotDeviceId()); + } + + // 组ID + if (Objects.nonNull(dcDevice.getGroupId())) { + queryWrapper.eq(DcDevice::getGroupId, dcDevice.getGroupId()); + } + + // 设备ID + if (Objects.nonNull(dcDevice.getProductId())) { + queryWrapper.eq(DcDevice::getProductId, dcDevice.getProductId()); + } + + // 木桩 + if (StringUtils.hasText(dcDevice.getStakeMarkId())) { + queryWrapper.eq(DcDevice::getStakeMarkId, dcDevice.getStakeMarkId()); + } + + // 道路标识 + if (Objects.nonNull(dcDevice.getRoadId())) { + queryWrapper.eq(DcDevice::getRoadId, dcDevice.getRoadId()); + } + + // 设备名称 + if (StringUtils.hasText(dcDevice.getDeviceName())) { + queryWrapper.like(DcDevice::getDeviceName, dcDevice.getDeviceName()); + } + + + // 设备类型 + if (Objects.nonNull(dcDevice.getDeviceType())) { + queryWrapper.eq(DcDevice::getDeviceType, dcDevice.getDeviceType()); + } + + // 安装日期 + if (Objects.nonNull(dcDevice.getInstallationDate())) { + queryWrapper.eq(DcDevice::getInstallationDate, dcDevice.getInstallationDate()); + } + + + // 生产日期 + if (Objects.nonNull(dcDevice.getProductionDate())) { + queryWrapper.eq(DcDevice::getProductionDate, dcDevice.getProductionDate()); + } + + // 使用年限 + if (StringUtils.hasText(dcDevice.getDurableYears())) { + queryWrapper.eq(DcDevice::getDurableYears, dcDevice.getDurableYears()); + } + + + // 安装位置 + if (StringUtils.hasText(dcDevice.getInstallationSite())) { + queryWrapper.like(DcDevice::getInstallationSite, dcDevice.getInstallationSite()); + } + + // 使用状态 + if (Objects.nonNull(dcDevice.getUseState())) { + queryWrapper.eq(DcDevice::getUseState, dcDevice.getUseState()); + } + + + // 备注 + if (StringUtils.hasText(dcDevice.getRemark())) { + queryWrapper.like(DcDevice::getRemark, dcDevice.getRemark()); + } + + + // 创建时间 + if (Objects.nonNull(dcDevice.getCreateTime())) { + queryWrapper.eq(DcDevice::getCreateTime, dcDevice.getCreateTime()); + } + + + // 更新时间 + if (Objects.nonNull(dcDevice.getUpdateTime())) { + queryWrapper.eq(DcDevice::getUpdateTime, dcDevice.getUpdateTime()); + } + + + return queryWrapper; + } + + /** + * 新增 + * + * @param dcDevice 新整参数 + * @return 新增操作结果 + */ + @Override + public boolean addDevice(DcDevice dcDevice) { + + + Long id = dcDevice.getId(); + if (Objects.nonNull(id)) { + // 检查设备id是否重复 + DcDevice device = getById(id); + + if (Objects.nonNull(device)) { + throw new ServiceException("设备ID[" + id + "]已存在", HttpStatus.BAD_REQUEST); + } + } + + + String iotDeviceId = dcDevice.getIotDeviceId(); + if (Objects.nonNull(iotDeviceId)) { + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(DcDevice::getIotDeviceId, iotDeviceId); + // 检查设备id是否重复 + DcDevice device = getOne(lambdaQueryWrapper); + + if (Objects.nonNull(device)) { + throw new ServiceException("物联设备ID[" + id + "]已存在", HttpStatus.BAD_REQUEST); + } + } + + + Long productId = dcDevice.getProductId(); + if (Objects.nonNull(productId)) { + DcProduct dcProduct = dcProdurtService.getById(productId); + // 产品不存在 + if (Objects.isNull(dcProduct)) { + throw new ServiceException("所属产品[" + productId + "]不存在", HttpStatus.BAD_REQUEST); + } + } + + dcDevice.setCreateTime(new Date()); + dcDevice.setUseState(DcDevice.UNUSEDSTATE); + return save(dcDevice); + } + + /** + * 修改 + * + * @param dcDevice 修改参数 + * @return 修改操作结果 + */ + @Override + public boolean editDevice(DcDevice dcDevice) { + + Long id = dcDevice.getId(); + + // 检查设备id是否重复 + DcDevice device = getById(id); + + if (Objects.isNull(device)) { + throw new ServiceException("设备ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + dcDevice.setUpdateTime(new Date()); + return updateById(dcDevice); + } + + /** + * 删除 + * + * @param ids 设备id集 + * @return 删除操作结果 + */ + @Override + public boolean removeDevice(List ids) { + // 根据 ids 批量查询设备信息 + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.in(DcDevice::getId, ids); + List list = list(queryWrapper); + list.forEach(item -> { + if (Objects.equals(item.getUseState(), DcDevice.USEOFSTATE)) { + throw new ServiceException("设备正在使用", HttpStatus.MOVED_PERM); + } + }); + return removeByIds(ids); + } + + /** + * 分页查询设备列表 + * + * @param dcDevice 请求参数 + * @return 分页查询结果 + */ + @Override + public List pageDevice(DcDevice dcDevice) { + // 分页 + PageUtils.startPage(); + return list(deviceQueryWrapper(dcDevice)); + } + + /** + * 无分页查询设备列表 + * + * @param dcDevice 请求参数 + * @return 查询结果 + */ + @Override + public List listDevice(DcDevice dcDevice) { + return list(deviceQueryWrapper(dcDevice)); + } + + /** + * 根据id查询设备信息 + * + * @param id 设备id + * @return 查询结果 + */ + @Override + public DcDevice getDevice(String id) { + // 检查设备id是否重复 + DcDevice device = getById(id); + + if (Objects.isNull(device)) { + throw new ServiceException("设备ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + return getById(id); + } +} + diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcFacilityServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcFacilityServiceImpl.java new file mode 100644 index 00000000..1c746baf --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcFacilityServiceImpl.java @@ -0,0 +1,144 @@ +package com.zc.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.PageUtils; +import com.zc.business.domain.DcFacility; +import com.zc.business.mapper.DcFacilityMapper; +import com.zc.business.service.IDcFacilityService; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 路网设施Service业务层处理 + * + * @author zhaoxianglong + */ +@Service +public class DcFacilityServiceImpl extends ServiceImpl implements IDcFacilityService { + + + public LambdaQueryWrapper facilityQueryWrapper(DcFacility dcFacility) { + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + // 设备ID + if (Objects.nonNull(dcFacility.getId())) { + queryWrapper.eq(DcFacility::getId, dcFacility.getId()); + } + + // 木桩 + if (StringUtils.hasText(dcFacility.getStakeMarkId())) { + queryWrapper.eq(DcFacility::getStakeMarkId, dcFacility.getStakeMarkId()); + } + + // 方向 + if (StringUtils.hasText(dcFacility.getDirection())) { + queryWrapper.eq(DcFacility::getDirection, dcFacility.getDirection()); + } + + // 道路标识 + if (StringUtils.hasText(dcFacility.getRoadId())) { + queryWrapper.like(DcFacility::getRoadId, dcFacility.getRoadId()); + } + + // 设备类型 + if (Objects.nonNull(dcFacility.getFacilityType())) { + queryWrapper.like(DcFacility::getFacilityType, dcFacility.getFacilityType()); + } + + // 名称 + if (StringUtils.hasText(dcFacility.getFacilityName())) { + queryWrapper.like(DcFacility::getFacilityName, dcFacility.getFacilityName()); + } + + // 备注 + if (StringUtils.hasText(dcFacility.getRemark())) { + queryWrapper.like(DcFacility::getRemark, dcFacility.getRemark()); + } + + // 其他配置 + if (StringUtils.hasText(dcFacility.getOtherConfig())) { + queryWrapper.like(DcFacility::getOtherConfig, dcFacility.getOtherConfig()); + } + + // 创建时间 + if (Objects.nonNull(dcFacility.getCreateTime())) { + queryWrapper.eq(DcFacility::getCreateTime, dcFacility.getCreateTime()); + } + + // 更新时间 + if (Objects.nonNull(dcFacility.getUpdateTime())) { + queryWrapper.eq(DcFacility::getUpdateTime, dcFacility.getUpdateTime()); + } + + return queryWrapper; + } + + @Override + public boolean addFacility(DcFacility dcFacility) { + + Long id = dcFacility.getId(); + if (Objects.nonNull(id)) { + DcFacility device = getById(id); + if (device != null) { + throw new ServiceException("路网设施ID[" + id + "]已存在", HttpStatus.BAD_REQUEST); + } + } + + dcFacility.setCreateTime(new Date()); + return save(dcFacility); + } + + @Override + public boolean editFacility(DcFacility dcFacility) { + + Long id = dcFacility.getId(); + + // 检查设备id是否重复 + DcFacility facility = getById(id); + + if (Objects.isNull(facility)) { + throw new ServiceException("路网设施ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + dcFacility.setUpdateTime(new Date()); + return updateById(dcFacility); + } + + @Override + public boolean removeFacility(List ids) { + return removeByIds(ids); + } + + @Override + public List pageFacility(DcFacility dcFacility) { + // 分页 + PageUtils.startPage(); + return list(facilityQueryWrapper(dcFacility)); + } + + @Override + public List listFacility(DcFacility dcFacility) { + return list(facilityQueryWrapper(dcFacility)); + } + + @Override + public DcFacility getFacility(String id) { + // 检查设备id是否重复 + DcFacility facility = getById(id); + + if (Objects.isNull(facility)) { + throw new ServiceException("路网设施ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + return getById(id); + } +} + diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcProductServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcProductServiceImpl.java new file mode 100644 index 00000000..8ca4786d --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcProductServiceImpl.java @@ -0,0 +1,144 @@ +package com.zc.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.PageUtils; +import com.zc.business.domain.DcProduct; +import com.zc.business.mapper.DcProductMapper; +import com.zc.business.service.IDcProductService; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 产品Service业务层处理 + * + * @author zhaoxianglong + */ +@Service +public class DcProductServiceImpl extends ServiceImpl implements IDcProductService { + + + public LambdaQueryWrapper productQueryWrapper(DcProduct dcProduct) { + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + // 设备ID + if (Objects.nonNull(dcProduct.getId())) { + queryWrapper.eq(DcProduct::getId, dcProduct.getId()); + } + + // 名称 + if (StringUtils.hasText(dcProduct.getProductName())) { + queryWrapper.like(DcProduct::getProductName, dcProduct.getProductName()); + } + + // 生产商 + if (StringUtils.hasText(dcProduct.getManufacturer())) { + queryWrapper.eq(DcProduct::getManufacturer, dcProduct.getManufacturer()); + } + + // 品牌 + if (StringUtils.hasText(dcProduct.getBrand())) { + queryWrapper.like(DcProduct::getBrand, dcProduct.getBrand()); + } + + // 模型 + if (StringUtils.hasText(dcProduct.getModel())) { + queryWrapper.like(DcProduct::getModel, dcProduct.getModel()); + } + + // 生产地 + if (StringUtils.hasText(dcProduct.getProductionPlace())) { + queryWrapper.like(DcProduct::getProductionPlace, dcProduct.getProductionPlace()); + } + + // 备注 + if (StringUtils.hasText(dcProduct.getRemark())) { + queryWrapper.like(DcProduct::getRemark, dcProduct.getRemark()); + } + + // 其他配置 + if (StringUtils.hasText(dcProduct.getOtherConfig())) { + queryWrapper.like(DcProduct::getOtherConfig, dcProduct.getOtherConfig()); + } + + // 创建时间 + if (Objects.nonNull(dcProduct.getCreateTime())) { + queryWrapper.eq(DcProduct::getCreateTime, dcProduct.getCreateTime()); + } + + // 更新时间 + if (Objects.nonNull(dcProduct.getUpdateTime())) { + queryWrapper.eq(DcProduct::getUpdateTime, dcProduct.getUpdateTime()); + } + + return queryWrapper; + } + + @Override + public boolean addProduct(DcProduct dcProduct) { + + Long id = dcProduct.getId(); + if (Objects.nonNull(id)) { + DcProduct device = getById(id); + if (Objects.nonNull(device)) { + throw new ServiceException("产品ID[" + id + "]已存在", HttpStatus.BAD_REQUEST); + } + } + + dcProduct.setCreateTime(new Date()); + return save(dcProduct); + } + + @Override + public boolean editProduct(DcProduct dcProduct) { + + Long id = dcProduct.getId(); + + // 检查设备id是否重复 + DcProduct product = getById(id); + + if (Objects.isNull(product)) { + throw new ServiceException("产品ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + dcProduct.setUpdateTime(new Date()); + return updateById(dcProduct); + } + + @Override + public boolean removeProduct(List ids) { + return removeByIds(ids); + } + + @Override + public List pageProduct(DcProduct dcProduct) { + // 分页 + PageUtils.startPage(); + return list(productQueryWrapper(dcProduct)); + } + + @Override + public List listProduct(DcProduct dcProduct) { + return list(productQueryWrapper(dcProduct)); + } + + @Override + public DcProduct getProduct(String id) { + // 检查设备id是否重复 + DcProduct product = getById(id); + + if (Objects.isNull(product)) { + throw new ServiceException("产品ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + return getById(id); + } +} + diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcRoadServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadServiceImpl.java new file mode 100644 index 00000000..1c42f3df --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadServiceImpl.java @@ -0,0 +1,129 @@ +package com.zc.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.PageUtils; +import com.zc.business.domain.DcRoad; +import com.zc.business.mapper.DcRoadMapper; +import com.zc.business.service.IDcRoadService; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 道路信息Service业务层处理 + * + * @author zhaoxianglong + */ +@Service +public class DcRoadServiceImpl extends ServiceImpl implements IDcRoadService { + + + public LambdaQueryWrapper roadQueryWrapper(DcRoad dcRoad) { + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + // 设备ID + if (Objects.nonNull(dcRoad.getId())) { + queryWrapper.eq(DcRoad::getId, dcRoad.getId()); + } + + // 名称 + if (StringUtils.hasText(dcRoad.getRoadName())) { + queryWrapper.like(DcRoad::getRoadName, dcRoad.getRoadName()); + } + + // 路的方向 + if (StringUtils.hasText(dcRoad.getRoadDirection())) { + queryWrapper.eq(DcRoad::getRoadDirection, dcRoad.getRoadDirection()); + } + + // 道路代码 + if (StringUtils.hasText(dcRoad.getRoadCode())) { + queryWrapper.like(DcRoad::getRoadCode, dcRoad.getRoadCode()); + } + + // 配置 + if (StringUtils.hasText(dcRoad.getOrganization())) { + queryWrapper.like(DcRoad::getOrganization, dcRoad.getOrganization()); + } + + // 创建时间 + if (Objects.nonNull(dcRoad.getCreateTime())) { + queryWrapper.eq(DcRoad::getCreateTime, dcRoad.getCreateTime()); + } + + // 更新时间 + if (Objects.nonNull(dcRoad.getUpdateTime())) { + queryWrapper.eq(DcRoad::getUpdateTime, dcRoad.getUpdateTime()); + } + + return queryWrapper; + } + + @Override + public boolean addRoad(DcRoad dcRoad) { + + Long id = dcRoad.getId(); + if (Objects.nonNull(id)) { + DcRoad device = getById(id); + if (Objects.nonNull(device)) { + throw new ServiceException("道路信息ID[" + id + "]已存在", HttpStatus.BAD_REQUEST); + } + } + + dcRoad.setCreateTime(new Date()); + return save(dcRoad); + } + + @Override + public boolean editRoad(DcRoad dcRoad) { + + Long id = dcRoad.getId(); + + // 检查设备id是否重复 + DcRoad road = getById(id); + + if (Objects.isNull(road)) { + throw new ServiceException("道路信息ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + dcRoad.setUpdateTime(new Date()); + return updateById(dcRoad); + } + + @Override + public boolean removeRoad(List ids) { + return removeByIds(ids); + } + + @Override + public List pageRoad(DcRoad dcRoad) { + // 分页 + PageUtils.startPage(); + return list(roadQueryWrapper(dcRoad)); + } + + @Override + public List listRoad(DcRoad dcRoad) { + return list(roadQueryWrapper(dcRoad)); + } + + @Override + public DcRoad getRoad(String id) { + // 检查设备id是否重复 + DcRoad road = getById(id); + + if (Objects.isNull(road)) { + throw new ServiceException("道路信息ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + return getById(id); + } +} + diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java new file mode 100644 index 00000000..ecaec4dd --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java @@ -0,0 +1,129 @@ +package com.zc.business.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.constant.HttpStatus; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.PageUtils; +import com.zc.business.domain.DcStakeMark; +import com.zc.business.mapper.DcStakeMarkMapper; +import com.zc.business.service.IDcStakeMarkService; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.Date; +import java.util.List; +import java.util.Objects; + +/** + * 桩号Service业务层处理 + * + * @author zhaoxianglong + */ +@Service +public class DcStakeMarkServiceImpl extends ServiceImpl implements IDcStakeMarkService { + + + public LambdaQueryWrapper stakeMarkQueryWrapper(DcStakeMark dcStakeMark) { + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + + // 设备ID + if (StringUtils.hasText(dcStakeMark.getId())) { + queryWrapper.eq(DcStakeMark::getId, dcStakeMark.getId()); + } + + // 经度 + if (StringUtils.hasText(dcStakeMark.getLongitude())) { + queryWrapper.like(DcStakeMark::getLongitude, dcStakeMark.getLongitude()); + } + + // 纬度 + if (StringUtils.hasText(dcStakeMark.getLatitude())) { + queryWrapper.eq(DcStakeMark::getLatitude, dcStakeMark.getLatitude()); + } + + // 方向 + if (StringUtils.hasText(dcStakeMark.getDirection())) { + queryWrapper.like(DcStakeMark::getDirection, dcStakeMark.getDirection()); + } + + // 地点 + if (StringUtils.hasText(dcStakeMark.getLocation())) { + queryWrapper.like(DcStakeMark::getLocation, dcStakeMark.getLocation()); + } + + // 创建时间 + if (Objects.nonNull(dcStakeMark.getCreateTime())) { + queryWrapper.eq(DcStakeMark::getCreateTime, dcStakeMark.getCreateTime()); + } + + // 更新时间 + if (Objects.nonNull(dcStakeMark.getUpdateTime())) { + queryWrapper.eq(DcStakeMark::getUpdateTime, dcStakeMark.getUpdateTime()); + } + + return queryWrapper; + } + + @Override + public boolean addStakeMark(DcStakeMark dcStakeMark) { + + String id = dcStakeMark.getId(); + if (Objects.nonNull(id)) { + DcStakeMark device = getById(id); + if (Objects.nonNull(device)) { + throw new ServiceException("桩号ID[" + id + "]已存在", HttpStatus.BAD_REQUEST); + } + } + + dcStakeMark.setCreateTime(new Date()); + return save(dcStakeMark); + } + + @Override + public boolean editStakeMark(DcStakeMark dcStakeMark) { + + String id = dcStakeMark.getId(); + + // 检查设备id是否重复 + DcStakeMark product = getById(id); + + if (Objects.isNull(product)) { + throw new ServiceException("桩号ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + dcStakeMark.setUpdateTime(new Date()); + return updateById(dcStakeMark); + } + + @Override + public boolean removeStakeMark(List ids) { + return removeByIds(ids); + } + + @Override + public List pageStakeMark(DcStakeMark dcStakeMark) { + // 分页 + PageUtils.startPage(); + return list(stakeMarkQueryWrapper(dcStakeMark)); + } + + @Override + public List listStakeMark(DcStakeMark dcStakeMark) { + return list(stakeMarkQueryWrapper(dcStakeMark)); + } + + @Override + public DcStakeMark getStakeMark(String id) { + // 检查设备id是否重复 + DcStakeMark product = getById(id); + + if (Objects.isNull(product)) { + throw new ServiceException("桩号ID[" + id + "]不存在", HttpStatus.BAD_REQUEST); + } + + return getById(id); + } +} + From e5bbe7a53ed18464f5c21297d7c252ac2f55ed9e Mon Sep 17 00:00:00 2001 From: mengff <1198151809@qq.com> Date: Fri, 5 Jan 2024 11:56:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?--=E5=A4=84=E7=90=86=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8A=A0=E5=85=A5=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=E6=8E=A5=E6=94=B6?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DcEventProcessController.java | 13 +++++++++++-- .../java/com/zc/business/domain/DcEventProcess.java | 12 ++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java index f332ebfc..142c5a39 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventProcessController.java @@ -1,8 +1,13 @@ package com.zc.business.controller; +import java.io.IOException; import java.util.List; import javax.servlet.http.HttpServletResponse; +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.exception.file.InvalidExtensionException; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.MimeTypeUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; @@ -85,8 +90,12 @@ public class DcEventProcessController extends BaseController @PreAuthorize("@ss.hasPermi('system:process:add')") @Log(title = "事件处理流程", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody DcEventProcess dcEventProcess) - { + public AjaxResult add(@RequestBody DcEventProcess dcEventProcess) throws IOException, InvalidExtensionException { + //如果有文件传入 + if(!dcEventProcess.getFile().isEmpty()){ + String address =FileUploadUtils.upload(RuoYiConfig.getAvatarPath(), dcEventProcess.getFile(), MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION); + dcEventProcess.setContext(address); + } return toAjax(dcEventProcessService.insertDcEventProcess(dcEventProcess)); } diff --git a/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java b/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java index 751b51d9..02514610 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcEventProcess.java @@ -7,6 +7,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.NotBlank; @@ -73,6 +74,17 @@ public class DcEventProcess @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private String processName; + public MultipartFile getFile() { + return file; + } + + public void setFile(MultipartFile file) { + this.file = file; + } + + @ApiModelProperty("上传文件") + private MultipartFile file; + public void setId(Long id) { this.id = id; From 2b8e0aae5931374dd2dff93664a1c6e7fb8506a7 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Fri, 5 Jan 2024 16:49:19 +0800 Subject: [PATCH 3/3] =?UTF-8?q?1.=E6=83=85=E6=8A=A5=E6=9D=BF=E5=8F=91?= =?UTF-8?q?=E9=80=81=E8=AE=B0=E5=BD=95=202.=E6=83=85=E6=8A=A5=E6=9D=BF?= =?UTF-8?q?=E6=8E=A7=E5=88=B6\=E5=9B=9E=E8=AF=BB=203.=E6=83=85=E6=8A=A5?= =?UTF-8?q?=E6=9D=BF=E6=95=8F=E6=84=9F=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/entity/SysUser.java | 12 + .../resources/mapper/system/SysUserMapper.xml | 12 +- .../controller/DcBoardController.java | 53 +++++ .../DcBoardReleaseLogController.java | 104 +++++++++ .../controller/DcEventTypeController.java | 4 +- .../DcInfoBoardTemplateController.java | 5 +- .../DcInfoBoardVocabularyController.java | 124 +++++++++++ .../controller/DcProcessConfigController.java | 16 +- .../zc/business/domain/DcBoardPublish.java | 47 ++++ .../zc/business/domain/DcBoardReleaseLog.java | 208 ++++++++++++++++++ .../domain/DcInfoBoardVocabulary.java | 70 ++++++ .../com/zc/business/domain/DcPublishInfo.java | 8 +- .../mapper/DcBoardReleaseLogMapper.java | 61 +++++ .../mapper/DcInfoBoardVocabularyMapper.java | 61 +++++ .../service/IDcBoardReleaseLogService.java | 61 +++++ .../zc/business/service/IDcBoardService.java | 27 +++ .../IDcInfoBoardVocabularyService.java | 71 ++++++ .../impl/DcBoardReleaseLogServiceImpl.java | 93 ++++++++ .../service/impl/DcBoardServiceImpl.java | 104 +++++++++ .../DcInfoBoardVocabularyServiceImpl.java | 127 +++++++++++ .../business/DcBoardReleaseLogMapper.xml | 105 +++++++++ .../business/DcInfoBoardVocabularyMapper.xml | 60 +++++ 22 files changed, 1412 insertions(+), 21 deletions(-) create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcBoardController.java create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcBoardReleaseLogController.java create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcInfoBoardVocabularyController.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcBoardPublish.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcBoardReleaseLog.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcInfoBoardVocabulary.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcBoardReleaseLogMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcInfoBoardVocabularyMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcBoardReleaseLogService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcBoardService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcInfoBoardVocabularyService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcBoardReleaseLogServiceImpl.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcBoardServiceImpl.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcInfoBoardVocabularyServiceImpl.java create mode 100644 zc-business/src/main/resources/mapper/business/DcBoardReleaseLogMapper.xml create mode 100644 zc-business/src/main/resources/mapper/business/DcInfoBoardVocabularyMapper.xml diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index d40bbe92..12b84df0 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -39,6 +39,9 @@ public class SysUser extends BaseEntity @Excel(name = "用户名称") private String nickName; + /** 用户类型(00系统用户) */ + private String userType; + /** 用户邮箱 */ @Excel(name = "用户邮箱") private String email; @@ -146,6 +149,14 @@ public class SysUser extends BaseEntity this.nickName = nickName; } + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + @Xss(message = "用户账号不能包含脚本字符") @NotBlank(message = "用户账号不能为空") @Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符") @@ -321,6 +332,7 @@ public class SysUser extends BaseEntity .append("deptId", getDeptId()) .append("userName", getUserName()) .append("nickName", getNickName()) + .append("userType", getUserType()) .append("email", getEmail()) .append("phonenumber", getPhonenumber()) .append("sex", getSex()) diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 6e31ce71..ba4d680d 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -9,6 +9,7 @@ + @@ -47,7 +48,7 @@ - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, + select u.user_id, u.dept_id, u.user_name, u.nick_name, u.user_type, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status from sys_user u @@ -57,7 +58,7 @@ + + + and device_id = #{deviceId} + and device_name like concat('%', #{deviceName}, '%') + and release_content = #{releaseContent} + and release_status = #{releaseStatus} + and release_time = #{releaseTime} + and release_dept_name like concat('%', #{releaseDeptName}, '%') + and release_dept_id = #{releaseDeptId} + and release_user_name like concat('%', #{releaseUserName}, '%') + and release_user_id = #{releaseUserId} + and release_ip = #{releaseIp} + and platform = #{platform} + + + + + + + insert into dc_board_release_log + + device_id, + device_name, + release_content, + release_status, + release_dept_name, + release_dept_id, + release_user_name, + release_user_id, + release_ip, + platform, + release_time + + + #{deviceId}, + #{deviceName}, + #{releaseContent}, + #{releaseStatus}, + #{releaseDeptName}, + #{releaseDeptId}, + #{releaseUserName}, + #{releaseUserId}, + #{releaseIp}, + #{platform}, + now() + + + + + update dc_board_release_log + + device_id = #{deviceId}, + device_name = #{deviceName}, + release_content = #{releaseContent}, + release_status = #{releaseStatus}, + release_dept_name = #{releaseDeptName}, + release_dept_id = #{releaseDeptId}, + release_user_name = #{releaseUserName}, + release_user_id = #{releaseUserId}, + release_ip = #{releaseIp}, + platform = #{platform}, + + where id = #{id} + + + + delete from dc_board_release_log where id = #{id} + + + + delete from dc_board_release_log where id in + + #{id} + + + \ No newline at end of file diff --git a/zc-business/src/main/resources/mapper/business/DcInfoBoardVocabularyMapper.xml b/zc-business/src/main/resources/mapper/business/DcInfoBoardVocabularyMapper.xml new file mode 100644 index 00000000..4f828c67 --- /dev/null +++ b/zc-business/src/main/resources/mapper/business/DcInfoBoardVocabularyMapper.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + select id, word, create_time from dc_info_board_vocabulary + + + + + + + + insert into dc_info_board_vocabulary + + word, + create_time, + + + #{word}, + #{createTime}, + + + + + update dc_info_board_vocabulary + + word = #{word}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from dc_info_board_vocabulary where id = #{id} + + + + delete from dc_info_board_vocabulary where id in + + #{id} + + + \ No newline at end of file