Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
mengff 11 months ago
parent
commit
6cbc544a4d
  1. 116
      zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java
  2. 115
      zc-business/src/main/java/com/zc/business/controller/DcFacilityController.java
  3. 115
      zc-business/src/main/java/com/zc/business/controller/DcProductController.java
  4. 115
      zc-business/src/main/java/com/zc/business/controller/DcRoadController.java
  5. 115
      zc-business/src/main/java/com/zc/business/controller/DcStakeMarkController.java
  6. 50
      zc-business/src/main/java/com/zc/business/domain/DcDevice.java
  7. 40
      zc-business/src/main/java/com/zc/business/domain/DcFacility.java
  8. 34
      zc-business/src/main/java/com/zc/business/domain/DcProduct.java
  9. 28
      zc-business/src/main/java/com/zc/business/domain/DcRoad.java
  10. 31
      zc-business/src/main/java/com/zc/business/domain/DcStakeMark.java
  11. 14
      zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java
  12. 14
      zc-business/src/main/java/com/zc/business/mapper/DcFacilityMapper.java
  13. 14
      zc-business/src/main/java/com/zc/business/mapper/DcProductMapper.java
  14. 14
      zc-business/src/main/java/com/zc/business/mapper/DcRoadMapper.java
  15. 14
      zc-business/src/main/java/com/zc/business/mapper/DcStakeMarkMapper.java
  16. 64
      zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java
  17. 63
      zc-business/src/main/java/com/zc/business/service/IDcFacilityService.java
  18. 63
      zc-business/src/main/java/com/zc/business/service/IDcProductService.java
  19. 63
      zc-business/src/main/java/com/zc/business/service/IDcRoadService.java
  20. 63
      zc-business/src/main/java/com/zc/business/service/IDcStakeMarkService.java
  21. 258
      zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java
  22. 144
      zc-business/src/main/java/com/zc/business/service/impl/DcFacilityServiceImpl.java
  23. 144
      zc-business/src/main/java/com/zc/business/service/impl/DcProductServiceImpl.java
  24. 129
      zc-business/src/main/java/com/zc/business/service/impl/DcRoadServiceImpl.java
  25. 129
      zc-business/src/main/java/com/zc/business/service/impl/DcStakeMarkServiceImpl.java

116
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<String> ids) {
return toAjax(dcDeviceService.removeDevice(ids));
}
}

115
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<String> ids) {
return toAjax(dcFacilityService.removeFacility(ids));
}
}

115
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<String> ids) {
return toAjax(dcProdurtService.removeProduct(ids));
}
}

115
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<String> ids) {
return toAjax(dcRoadService.removeRoad(ids));
}
}

115
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<String> ids) {
return toAjax(dcStakeMarkService.removeStakeMark(ids));
}
}

50
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;
}

40
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;
}

34
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;
}

28
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;
}

31
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;
}

14
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<DcDevice> {
}

14
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<DcFacility> {
}

14
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<DcProduct> {
}

14
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<DcRoad> {
}

14
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<DcStakeMark> {
}

64
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<DcDevice> {
/**
* 添加设备信息
*
* @param dcDevice 设备信息
* @return 操作结果
*/
boolean addDevice(DcDevice dcDevice);
/**
* 修改设备信息
*
* @param dcDevice 设备信息
* @return 操作结果
*/
boolean editDevice(DcDevice dcDevice);
/**
* 删除设备
*
* @param ids 设备ID
* @return 操作结果
*/
boolean removeDevice(List<String> ids);
/**
* 获取设备列表
*
* @param dcDevice 参数
* @return 结果
*/
List<DcDevice> pageDevice(DcDevice dcDevice);
/**
* 获取设备列表
*
* @param dcDevice 参数
* @return 结果
*/
List<DcDevice> listDevice(DcDevice dcDevice);
/**
* 根据id查询设备信息
*
* @param id 设备ID
* @return 设备信息
*/
DcDevice getDevice(String id);
}

63
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<DcFacility> {
/**
* 添加设备信息
*
* @param dcFacility 设备信息
* @return 操作结果
*/
boolean addFacility(DcFacility dcFacility);
/**
* 修改设备信息
*
* @param dcFacility 设备信息
* @return 操作结果
*/
boolean editFacility(DcFacility dcFacility);
/**
* 删除设备
*
* @param ids 设备ID
* @return 操作结果
*/
boolean removeFacility(List<String> ids);
/**
* 获取设备列表
*
* @param dcFacility 参数
* @return 结果
*/
List<DcFacility> pageFacility(DcFacility dcFacility);
/**
* 获取设备列表
*
* @param dcFacility 参数
* @return 结果
*/
List<DcFacility> listFacility(DcFacility dcFacility);
/**
* 根据id查询设备信息
*
* @param id 设备ID
* @return 设备信息
*/
DcFacility getFacility(String id);
}

63
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<DcProduct> {
/**
* 添加设备信息
*
* @param dcProduct 设备信息
* @return 操作结果
*/
boolean addProduct(DcProduct dcProduct);
/**
* 修改设备信息
*
* @param dcProduct 设备信息
* @return 操作结果
*/
boolean editProduct(DcProduct dcProduct);
/**
* 删除设备
*
* @param ids 设备ID
* @return 操作结果
*/
boolean removeProduct(List<String> ids);
/**
* 获取设备列表
*
* @param dcProduct 参数
* @return 结果
*/
List<DcProduct> pageProduct(DcProduct dcProduct);
/**
* 获取设备列表
*
* @param dcProduct 参数
* @return 结果
*/
List<DcProduct> listProduct(DcProduct dcProduct);
/**
* 根据id查询设备信息
*
* @param id 设备ID
* @return 设备信息
*/
DcProduct getProduct(String id);
}

63
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<DcRoad> {
/**
* 添加设备信息
*
* @param dcRoad 设备信息
* @return 操作结果
*/
boolean addRoad(DcRoad dcRoad);
/**
* 修改设备信息
*
* @param dcRoad 设备信息
* @return 操作结果
*/
boolean editRoad(DcRoad dcRoad);
/**
* 删除设备
*
* @param ids 设备ID
* @return 操作结果
*/
boolean removeRoad(List<String> ids);
/**
* 获取设备列表
*
* @param dcRoad 参数
* @return 结果
*/
List<DcRoad> pageRoad(DcRoad dcRoad);
/**
* 获取设备列表
*
* @param dcRoad 参数
* @return 结果
*/
List<DcRoad> listRoad(DcRoad dcRoad);
/**
* 根据id查询设备信息
*
* @param id 设备ID
* @return 设备信息
*/
DcRoad getRoad(String id);
}

63
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<DcStakeMark> {
/**
* 添加设备信息
*
* @param dcStakeMark 设备信息
* @return 操作结果
*/
boolean addStakeMark(DcStakeMark dcStakeMark);
/**
* 修改设备信息
*
* @param dcStakeMark 设备信息
* @return 操作结果
*/
boolean editStakeMark(DcStakeMark dcStakeMark);
/**
* 删除设备
*
* @param ids 设备ID
* @return 操作结果
*/
boolean removeStakeMark(List<String> ids);
/**
* 获取设备列表
*
* @param dcStakeMark 参数
* @return 结果
*/
List<DcStakeMark> pageStakeMark(DcStakeMark dcStakeMark);
/**
* 获取设备列表
*
* @param dcStakeMark 参数
* @return 结果
*/
List<DcStakeMark> listStakeMark(DcStakeMark dcStakeMark);
/**
* 根据id查询设备信息
*
* @param id 设备ID
* @return 设备信息
*/
DcStakeMark getStakeMark(String id);
}

258
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<DcDeviceMapper, DcDevice> implements IDcDeviceService {
@Resource
private IDcProductService dcProdurtService;
public LambdaQueryWrapper<DcDevice> deviceQueryWrapper(DcDevice dcDevice) {
LambdaQueryWrapper<DcDevice> 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<DcDevice> 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<String> ids) {
// 根据 ids 批量查询设备信息
LambdaQueryWrapper<DcDevice> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(DcDevice::getId, ids);
List<DcDevice> 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<DcDevice> pageDevice(DcDevice dcDevice) {
// 分页
PageUtils.startPage();
return list(deviceQueryWrapper(dcDevice));
}
/**
* 无分页查询设备列表
*
* @param dcDevice 请求参数
* @return 查询结果
*/
@Override
public List<DcDevice> 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);
}
}

144
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<DcFacilityMapper, DcFacility> implements IDcFacilityService {
public LambdaQueryWrapper<DcFacility> facilityQueryWrapper(DcFacility dcFacility) {
LambdaQueryWrapper<DcFacility> 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<String> ids) {
return removeByIds(ids);
}
@Override
public List<DcFacility> pageFacility(DcFacility dcFacility) {
// 分页
PageUtils.startPage();
return list(facilityQueryWrapper(dcFacility));
}
@Override
public List<DcFacility> 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);
}
}

144
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<DcProductMapper, DcProduct> implements IDcProductService {
public LambdaQueryWrapper<DcProduct> productQueryWrapper(DcProduct dcProduct) {
LambdaQueryWrapper<DcProduct> 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<String> ids) {
return removeByIds(ids);
}
@Override
public List<DcProduct> pageProduct(DcProduct dcProduct) {
// 分页
PageUtils.startPage();
return list(productQueryWrapper(dcProduct));
}
@Override
public List<DcProduct> 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);
}
}

129
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<DcRoadMapper, DcRoad> implements IDcRoadService {
public LambdaQueryWrapper<DcRoad> roadQueryWrapper(DcRoad dcRoad) {
LambdaQueryWrapper<DcRoad> 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<String> ids) {
return removeByIds(ids);
}
@Override
public List<DcRoad> pageRoad(DcRoad dcRoad) {
// 分页
PageUtils.startPage();
return list(roadQueryWrapper(dcRoad));
}
@Override
public List<DcRoad> 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);
}
}

129
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<DcStakeMarkMapper, DcStakeMark> implements IDcStakeMarkService {
public LambdaQueryWrapper<DcStakeMark> stakeMarkQueryWrapper(DcStakeMark dcStakeMark) {
LambdaQueryWrapper<DcStakeMark> 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<String> ids) {
return removeByIds(ids);
}
@Override
public List<DcStakeMark> pageStakeMark(DcStakeMark dcStakeMark) {
// 分页
PageUtils.startPage();
return list(stakeMarkQueryWrapper(dcStakeMark));
}
@Override
public List<DcStakeMark> 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);
}
}
Loading…
Cancel
Save