From ede630639ad494189282c2c02dbcd4b88741cc30 Mon Sep 17 00:00:00 2001 From: 唐耀东 <18861537@qq.com> Date: 星期四, 12 五月 2022 17:43:37 +0800 Subject: [PATCH] 提交代码 --- ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java | 4 ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java | 1 ruoyi-oa/src/main/java/com/ruoyi/oa/mapper/SgIotMapper.java | 14 ruoyi-oa/src/main/java/com/ruoyi/oa/domain/SgIot.java | 101 ++++++ ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgIotServiceImpl.java | 197 +++++++++++++ ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevBatchServiceImpl.java | 3 ruoyi-oa/src/main/java/com/ruoyi/oa/domain/bo/SgIotBo.java | 171 +++++++++++ ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/SgIotController.java | 127 ++++++++ ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgNvrServiceImpl.java | 5 ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsOrganizationServiceImpl.java | 4 ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentLogServiceImpl.java | 4 ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsSchoolServiceImpl.java | 4 ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgIpcServiceImpl.java | 5 ruoyi-oa/src/main/java/com/ruoyi/oa/service/ISgIotService.java | 58 +++ ruoyi-oa/src/main/resources/mapper/oa/SgIotMapper.xml | 32 ++ ruoyi-oa/src/main/java/com/ruoyi/oa/domain/vo/SgIotVo.java | 153 ++++++++++ ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevManufacturerServiceImpl.java | 3 ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsBuildingServiceImpl.java | 4 ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgReserveIpServiceImpl.java | 5 19 files changed, 895 insertions(+), 0 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/SgIotController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/SgIotController.java new file mode 100644 index 0000000..393e4cf --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/SgIotController.java @@ -0,0 +1,127 @@ +package com.ruoyi.web.controller.oa; + +import java.util.List; +import java.util.Arrays; +import java.util.concurrent.TimeUnit; + +import com.ruoyi.common.annotation.DataDictClass; +import lombok.RequiredArgsConstructor; +import javax.servlet.http.HttpServletResponse; +import javax.validation.constraints.*; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.ruoyi.common.annotation.RepeatSubmit; +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.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.core.validate.QueryGroup; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.oa.domain.vo.SgIotVo; +import com.ruoyi.oa.domain.bo.SgIotBo; +import com.ruoyi.oa.service.ISgIotService; +import com.ruoyi.common.core.page.TableDataInfo; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiOperation; + +/** + * IoT璁惧Controller + * + * @author ruoyi + * @date 2022-05-12 + */ +@Validated +@Api(value = "IoT璁惧鎺у埗鍣�", tags = {"IoT璁惧绠$悊"}) +@RequiredArgsConstructor(onConstructor_ = @Autowired) +@RestController +@RequestMapping("/oa/iot") +public class SgIotController extends BaseController { + + private final ISgIotService iSgIotService; + + /** + * 鏌ヨIoT璁惧鍒楄〃 + */ + @DataDictClass + @ApiOperation("鏌ヨIoT璁惧鍒楄〃") + @PreAuthorize("@ss.hasPermi('oa:iot:list')") + @GetMapping("/list") + public TableDataInfo<SgIotVo> list(@Validated(QueryGroup.class) SgIotBo bo) { + return iSgIotService.queryPageList(bo); + } + + /** + * 鑾峰彇澶栬鏁伴噺 + */ + @ApiOperation("鏌ヨIoT璁惧鍒楄〃") + @GetMapping("/number") + public AjaxResult getNumber(SgIotBo bo) { + return AjaxResult.success(iSgIotService.getNumber(bo)); + } + + /** + * 瀵煎嚭IoT璁惧鍒楄〃 + */ + @ApiOperation("瀵煎嚭IoT璁惧鍒楄〃") + @PreAuthorize("@ss.hasPermi('oa:iot:export')") + @Log(title = "IoT璁惧", businessType = BusinessType.EXPORT) + @GetMapping("/export") + public void export(@Validated SgIotBo bo, HttpServletResponse response) { + List<SgIotVo> list = iSgIotService.queryList(bo); + ExcelUtil.exportExcel(list, "IoT璁惧", SgIotVo.class, response); + } + + /** + * 鑾峰彇IoT璁惧璇︾粏淇℃伅 + */ + @ApiOperation("鑾峰彇IoT璁惧璇︾粏淇℃伅") + @PreAuthorize("@ss.hasPermi('oa:iot:query')") + @GetMapping("/{id}") + public AjaxResult<SgIotVo> getInfo(@ApiParam("涓婚敭") + @NotNull(message = "涓婚敭涓嶈兘涓虹┖") + @PathVariable("id") Long id) { + return AjaxResult.success(iSgIotService.queryById(id)); + } + + /** + * 鏂板IoT璁惧 + */ + @ApiOperation("鏂板IoT璁惧") + @PreAuthorize("@ss.hasPermi('oa:iot:add')") + @Log(title = "IoT璁惧", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public AjaxResult<Void> add(@Validated(AddGroup.class) @RequestBody SgIotBo bo) { + return toAjax(iSgIotService.insertByBo(bo) ? 1 : 0); + } + + /** + * 淇敼IoT璁惧 + */ + @ApiOperation("淇敼IoT璁惧") + @PreAuthorize("@ss.hasPermi('oa:iot:edit')") + @Log(title = "IoT璁惧", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public AjaxResult<Void> edit(@Validated(EditGroup.class) @RequestBody SgIotBo bo) { + return toAjax(iSgIotService.updateByBo(bo) ? 1 : 0); + } + + /** + * 鍒犻櫎IoT璁惧 + */ + @ApiOperation("鍒犻櫎IoT璁惧") + @PreAuthorize("@ss.hasPermi('oa:iot:remove')") + @Log(title = "IoT璁惧" , businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult<Void> remove(@ApiParam("涓婚敭涓�") + @NotEmpty(message = "涓婚敭涓嶈兘涓虹┖") + @PathVariable Long[] ids) { + return toAjax(iSgIotService.deleteWithValidByIds(Arrays.asList(ids), true) ? 1 : 0); + } +} diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/domain/SgIot.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/domain/SgIot.java new file mode 100644 index 0000000..4d5472d --- /dev/null +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/domain/SgIot.java @@ -0,0 +1,101 @@ +package com.ruoyi.oa.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; +import java.io.Serializable; +import java.util.Date; +import java.math.BigDecimal; + +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * IoT璁惧瀵硅薄 sg_iot + * + * @author ruoyi + * @date 2022-05-12 + */ +@Data +@Accessors(chain = true) +@TableName("sg_iot") +public class SgIot extends BaseEntity { + + private static final long serialVersionUID=1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + /** + * 楂樻牎 + */ + private Long schoolId; + /** + * 閮ㄧ讲鍚嶇О + */ + private String deploymentName; + /** + * 鐗堟湰 + */ + private String edition; + /** + * LAN + */ + private String lan; + /** + * IP + */ + private String ip; + /** + * 瀹夎浣嶇疆 + */ + private Long buildingId; + /** + * 鎵�灞炲崟浣� + */ + private Long organizationId; + /** + * 鏂藉伐鎵规 + */ + private Long constructionBatchId; + /** + * 搴忓垪鍙� + */ + private String serialNumber; + /** + * 鍨嬪彿 + */ + private String model; + /** + * 鐢熶骇鍘傚晢 + */ + private Long manufacturerId; + /** + * 鐩戞帶瀵硅薄 + */ + private String monitorObject; + /** + * 閫氶亾1 + */ + private Long passagewayOne; + /** + * 閫氶亾2 + */ + private Long passagewayTwo; + /** + * 閫氶亾3 + */ + private Long passagewayThree; + /** + * 閫氶亾4 + */ + private Long passagewayFour; + /** + * + */ + @TableLogic + private String delFlag; + +} diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/domain/bo/SgIotBo.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/domain/bo/SgIotBo.java new file mode 100644 index 0000000..0acbc5a --- /dev/null +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/domain/bo/SgIotBo.java @@ -0,0 +1,171 @@ +package com.ruoyi.oa.domain.bo; + +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import javax.validation.constraints.*; + +import java.util.Date; + +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * IoT璁惧涓氬姟瀵硅薄 sg_iot + * + * @author ruoyi + * @date 2022-05-12 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@ApiModel("IoT璁惧涓氬姟瀵硅薄") +public class SgIotBo extends BaseEntity { + + /** + * + */ + @ApiModelProperty(value = "", required = true) + @NotNull(message = "涓嶈兘涓虹┖", groups = { EditGroup.class }) + private Long id; + /** + * 楂樻牎 + */ + private Long schoolId; + /** + * 閮ㄧ讲鍚嶇О + */ + @ApiModelProperty(value = "閮ㄧ讲鍚嶇О", required = true) + @NotBlank(message = "閮ㄧ讲鍚嶇О涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + private String deploymentName; + + /** + * 鐗堟湰 + */ + @ApiModelProperty(value = "鐗堟湰", required = true) + @NotBlank(message = "鐗堟湰涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + private String edition; + + /** + * LAN + */ + @ApiModelProperty(value = "LAN", required = true) + @NotBlank(message = "LAN涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + private String lan; + + /** + * IP + */ + @ApiModelProperty(value = "IP", required = true) + @NotBlank(message = "IP涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + private String ip; + + /** + * 瀹夎浣嶇疆 + */ + @ApiModelProperty(value = "瀹夎浣嶇疆", required = true) + @NotNull(message = "瀹夎浣嶇疆涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + private Long buildingId; + + /** + * 鎵�灞炲崟浣� + */ + @ApiModelProperty(value = "鎵�灞炲崟浣�", required = true) + @NotNull(message = "鎵�灞炲崟浣嶄笉鑳戒负绌�", groups = { AddGroup.class, EditGroup.class }) + private Long organizationId; + + /** + * 鏂藉伐鎵规 + */ + @ApiModelProperty(value = "鏂藉伐鎵规", required = true) + @NotNull(message = "鏂藉伐鎵规涓嶈兘涓虹┖", groups = { AddGroup.class, EditGroup.class }) + private Long constructionBatchId; + + /** + * 搴忓垪鍙� + */ + @ApiModelProperty(value = "搴忓垪鍙�") + private String serialNumber; + + /** + * 鍨嬪彿 + */ + @ApiModelProperty(value = "鍨嬪彿") + private String model; + + /** + * 鐢熶骇鍘傚晢 + */ + @ApiModelProperty(value = "鐢熶骇鍘傚晢") + private Long manufacturerId; + + /** + * 鐩戞帶瀵硅薄 + */ + @ApiModelProperty(value = "鐩戞帶瀵硅薄") + private String monitorObject; + + /** + * 閫氶亾1 + */ + @ApiModelProperty(value = "閫氶亾1") + private Long passagewayOne; + + /** + * 閫氶亾2 + */ + @ApiModelProperty(value = "閫氶亾2") + private Long passagewayTwo; + + /** + * 閫氶亾3 + */ + @ApiModelProperty(value = "閫氶亾3") + private Long passagewayThree; + + /** + * 閫氶亾4 + */ + @ApiModelProperty(value = "閫氶亾4") + private Long passagewayFour; + + /** + * 閫氶亾 + */ + @ApiModelProperty(value = "閫氶亾") + private String passageway; + + /** + * 澶栬鍗曞厓 + */ + @ApiModelProperty(value = "澶栬鍗曞厓") + private Long peripheralUnit; + + + /** + * 鍒嗛〉澶у皬 + */ + @ApiModelProperty("鍒嗛〉澶у皬") + private Integer pageSize; + + /** + * 褰撳墠椤垫暟 + */ + @ApiModelProperty("褰撳墠椤垫暟") + private Integer pageNum; + + /** + * 鎺掑簭鍒� + */ + @ApiModelProperty("鎺掑簭鍒�") + private String orderByColumn; + + /** + * 鎺掑簭鐨勬柟鍚慸esc鎴栬�卆sc + */ + @ApiModelProperty(value = "鎺掑簭鐨勬柟鍚�", example = "asc,desc") + private String isAsc; + +} diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/domain/vo/SgIotVo.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/domain/vo/SgIotVo.java new file mode 100644 index 0000000..54c83bd --- /dev/null +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/domain/vo/SgIotVo.java @@ -0,0 +1,153 @@ +package com.ruoyi.oa.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.common.annotation.Dict; +import com.ruoyi.common.annotation.ExcelDictFormat; +import com.ruoyi.common.convert.ExcelDictConvert; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import java.util.Date; + + + +/** + * IoT璁惧瑙嗗浘瀵硅薄 sg_iot + * + * @author ruoyi + * @date 2022-05-12 + */ +@Data +@ApiModel("IoT璁惧瑙嗗浘瀵硅薄") +@ExcelIgnoreUnannotated +public class SgIotVo { + + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + @ApiModelProperty("") + private Long id; + /** + * 楂樻牎 + */ + private Long schoolId; + /** + * 閮ㄧ讲鍚嶇О + */ + @ExcelProperty(value = "閮ㄧ讲鍚嶇О") + @ApiModelProperty("閮ㄧ讲鍚嶇О") + private String deploymentName; + + /** + * 鐗堟湰 + */ + @ExcelProperty(value = "鐗堟湰", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "DICT110") + @ApiModelProperty("鐗堟湰") + private String edition; + + /** + * LAN + */ + @ExcelProperty(value = "LAN") + @ApiModelProperty("LAN") + private String lan; + + /** + * IP + */ + @ExcelProperty(value = "IP") + @ApiModelProperty("IP") + private String ip; + + /** + * 瀹夎浣嶇疆 + */ + @ExcelProperty(value = "瀹夎浣嶇疆") + @ApiModelProperty("瀹夎浣嶇疆") + @Dict(dictTable = "bs_building", dicCode = "id", dicText = "detailed_name") + private Long buildingId; + + /** + * 鎵�灞炲崟浣� + */ + @ExcelProperty(value = "鎵�灞炲崟浣�") + @ApiModelProperty("鎵�灞炲崟浣�") + @Dict(dictTable = "bs_organization", dicCode = "id", dicText = "detailed_name") + private Long organizationId; + + /** + * 鏂藉伐鎵规 + */ + @ExcelProperty(value = "鏂藉伐鎵规") + @ApiModelProperty("鏂藉伐鎵规") + @Dict(dictTable = "sg_construction_batch", dicCode = "id", dicText = "batch") + private Long constructionBatchId; + + /** + * 搴忓垪鍙� + */ + @ExcelProperty(value = "搴忓垪鍙�") + @ApiModelProperty("搴忓垪鍙�") + private String serialNumber; + + /** + * 鍨嬪彿 + */ + @ExcelProperty(value = "鍨嬪彿") + @ApiModelProperty("鍨嬪彿") + private String model; + + /** + * 鐢熶骇鍘傚晢 + */ + @ExcelProperty(value = "鐢熶骇鍘傚晢") + @ApiModelProperty("鐢熶骇鍘傚晢") + @Dict(dictTable = "dev_manufacturer", dicCode = "id", dicText = "name") + private Long manufacturerId; + + /** + * 鐩戞帶瀵硅薄 + */ + @ExcelProperty(value = "鐩戞帶瀵硅薄") + @ApiModelProperty("鐩戞帶瀵硅薄") + private String monitorObject; + + /** + * 閫氶亾1 + */ + @ExcelProperty(value = "閫氶亾1", converter = ExcelDictConvert.class) + @ApiModelProperty("閫氶亾1") + @Dict(dictTable = "dev_peripheral_unit", dicCode = "id", dicText = "name") + private Long passagewayOne; + + /** + * 閫氶亾2 + */ + @ExcelProperty(value = "閫氶亾2") + @ApiModelProperty("閫氶亾2") + @Dict(dictTable = "dev_peripheral_unit", dicCode = "id", dicText = "name") + private Long passagewayTwo; + + /** + * 閫氶亾3 + */ + @ExcelProperty(value = "閫氶亾3") + @ApiModelProperty("閫氶亾3") + @Dict(dictTable = "dev_peripheral_unit", dicCode = "id", dicText = "name") + private Long passagewayThree; + + /** + * 閫氶亾4 + */ + @ExcelProperty(value = "閫氶亾4") + @ApiModelProperty("閫氶亾4") + @Dict(dictTable = "dev_peripheral_unit", dicCode = "id", dicText = "name") + private Long passagewayFour; + + +} diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/mapper/SgIotMapper.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/mapper/SgIotMapper.java new file mode 100644 index 0000000..34861cf --- /dev/null +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/mapper/SgIotMapper.java @@ -0,0 +1,14 @@ +package com.ruoyi.oa.mapper; + +import com.ruoyi.oa.domain.SgIot; +import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; + +/** + * IoT璁惧Mapper鎺ュ彛 + * + * @author ruoyi + * @date 2022-05-12 + */ +public interface SgIotMapper extends BaseMapperPlus<SgIot> { + +} diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/ISgIotService.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/ISgIotService.java new file mode 100644 index 0000000..c2067a8 --- /dev/null +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/ISgIotService.java @@ -0,0 +1,58 @@ +package com.ruoyi.oa.service; + +import com.ruoyi.oa.domain.SgIot; +import com.ruoyi.oa.domain.vo.SgIotVo; +import com.ruoyi.oa.domain.bo.SgIotBo; +import com.ruoyi.common.core.mybatisplus.core.IServicePlus; +import com.ruoyi.common.core.page.TableDataInfo; + +import java.util.Collection; +import java.util.List; + +/** + * IoT璁惧Service鎺ュ彛 + * + * @author ruoyi + * @date 2022-05-12 + */ +public interface ISgIotService extends IServicePlus<SgIot, SgIotVo> { + /** + * 鏌ヨ鍗曚釜 + * @return + */ + SgIotVo queryById(Long id); + + /** + * 鏌ヨ鍒楄〃 + */ + TableDataInfo<SgIotVo> queryPageList(SgIotBo bo); + + /** + * 鏌ヨ鍒楄〃 + */ + List<SgIotVo> queryList(SgIotBo bo); + + /** + * 鏍规嵁鏂板涓氬姟瀵硅薄鎻掑叆IoT璁惧 + * @param bo IoT璁惧鏂板涓氬姟瀵硅薄 + * @return + */ + Boolean insertByBo(SgIotBo bo); + + /** + * 鏍规嵁缂栬緫涓氬姟瀵硅薄淇敼IoT璁惧 + * @param bo IoT璁惧缂栬緫涓氬姟瀵硅薄 + * @return + */ + Boolean updateByBo(SgIotBo bo); + + /** + * 鏍¢獙骞跺垹闄ゆ暟鎹� + * @param ids 涓婚敭闆嗗悎 + * @param isValid 鏄惁鏍¢獙,true-鍒犻櫎鍓嶆牎楠�,false-涓嶆牎楠� + * @return + */ + Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); + + int getNumber(SgIotBo bo); +} diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsBuildingServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsBuildingServiceImpl.java index 8e65684..dc33b85 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsBuildingServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsBuildingServiceImpl.java @@ -18,6 +18,7 @@ import com.ruoyi.oa.domain.BsBuilding; import com.ruoyi.oa.mapper.BsBuildingMapper; import com.ruoyi.oa.service.IBsBuildingService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -60,6 +61,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(BsBuildingBo bo) { BsBuilding add = BeanUtil.toBean(bo, BsBuilding.class); if (bo.getParentId() == Long.valueOf(0)) { @@ -79,6 +81,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(BsBuildingBo bo) { BsBuilding update = BeanUtil.toBean(bo, BsBuilding.class); if (bo.getParentId() == Long.valueOf(0)) { @@ -104,6 +107,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { List<BsBuilding> list = baseMapper.selectList(new LambdaQueryWrapper<BsBuilding>() .in(BsBuilding::getParentId, ids)); diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsOrganizationServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsOrganizationServiceImpl.java index d52ff20..b3460e4 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsOrganizationServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsOrganizationServiceImpl.java @@ -17,6 +17,7 @@ import com.ruoyi.oa.domain.BsOrganization; import com.ruoyi.oa.mapper.BsOrganizationMapper; import com.ruoyi.oa.service.IBsOrganizationService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -54,6 +55,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(BsOrganizationBo bo) { BsOrganization add = BeanUtil.toBean(bo, BsOrganization.class); if (bo.getParentId() == Long.valueOf(0)) { @@ -73,6 +75,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(BsOrganizationBo bo) { BsOrganization update = BeanUtil.toBean(bo, BsOrganization.class); if (bo.getParentId() == Long.valueOf(0)) { @@ -98,6 +101,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { List<BsOrganization> list = baseMapper.selectList(new LambdaQueryWrapper<BsOrganization>() .in(BsOrganization::getParentId, ids)); diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsSchoolServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsSchoolServiceImpl.java index c4892a4..dd9dec9 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsSchoolServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/BsSchoolServiceImpl.java @@ -18,6 +18,7 @@ import com.ruoyi.oa.domain.BsSchool; import com.ruoyi.oa.mapper.BsSchoolMapper; import com.ruoyi.oa.service.IBsSchoolService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -64,6 +65,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(BsSchoolBo bo) { List<BsSchool> list = baseMapper.selectList(new QueryWrapper<BsSchool>().lambda().eq(BsSchool::getCode, bo.getCode())); if (list.size() > 0) { @@ -79,6 +81,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(BsSchoolBo bo) { List<BsSchool> list = baseMapper.selectList(new QueryWrapper<BsSchool>().lambda() .eq(BsSchool::getCode, bo.getCode()).ne(BsSchool::getId, bo.getId())); @@ -100,6 +103,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { if(isValid){ //TODO 鍋氫竴浜涗笟鍔′笂鐨勬牎楠�,鍒ゆ柇鏄惁闇�瑕佹牎楠� diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevBatchServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevBatchServiceImpl.java index 6560869..199da67 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevBatchServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevBatchServiceImpl.java @@ -14,6 +14,7 @@ import com.ruoyi.oa.domain.DevBatch; import com.ruoyi.oa.mapper.DevBatchMapper; import com.ruoyi.oa.service.IDevBatchService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -55,6 +56,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(DevBatchBo bo) { DevBatch add = BeanUtil.toBean(bo, DevBatch.class); validEntityBeforeSave(add); @@ -66,6 +68,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(DevBatchBo bo) { DevBatch update = BeanUtil.toBean(bo, DevBatch.class); validEntityBeforeSave(update); diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentLogServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentLogServiceImpl.java index 07ec710..d4d362c 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentLogServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentLogServiceImpl.java @@ -18,6 +18,7 @@ import com.ruoyi.oa.domain.DevEquipmentLog; import com.ruoyi.oa.mapper.DevEquipmentLogMapper; import com.ruoyi.oa.service.IDevEquipmentLogService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -62,6 +63,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(DevEquipmentLogBo bo) { DevEquipmentLog add = BeanUtil.toBean(bo, DevEquipmentLog.class); validEntityBeforeSave(add); @@ -73,6 +75,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(DevEquipmentLogBo bo) { DevEquipmentLog update = BeanUtil.toBean(bo, DevEquipmentLog.class); validEntityBeforeSave(update); @@ -97,6 +100,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public void recordOper(EquipmentLogDTO dto){ DevEquipmentLog po = BeanUtil.toBean(dto, DevEquipmentLog.class); // 杩滅▼鏌ヨ鎿嶄綔鍦扮偣 diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java index f0ffce9..dd8ce44 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevEquipmentServiceImpl.java @@ -96,6 +96,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(DevEquipmentBo bo) { List<DevEquipment> list = baseMapper.selectList(new QueryWrapper<DevEquipment>().lambda() .eq(DevEquipment::getSequenceCode, bo.getSequenceCode()) diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevManufacturerServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevManufacturerServiceImpl.java index f636a62..88e60e3 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevManufacturerServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/DevManufacturerServiceImpl.java @@ -17,6 +17,7 @@ import com.ruoyi.oa.domain.DevManufacturer; import com.ruoyi.oa.mapper.DevManufacturerMapper; import com.ruoyi.oa.service.IDevManufacturerService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -59,6 +60,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(DevManufacturerBo bo) { List<DevManufacturer> list = baseMapper.selectList(new QueryWrapper<DevManufacturer>().lambda() .eq(DevManufacturer::getCode, bo.getCode())); @@ -75,6 +77,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(DevManufacturerBo bo) { List<DevManufacturer> list = baseMapper.selectList(new QueryWrapper<DevManufacturer>().lambda() .eq(DevManufacturer::getCode, bo.getCode()).ne(DevManufacturer::getId, bo.getId())); diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java index 4df9028..ecca73a 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgConstructionBatchServiceImpl.java @@ -16,6 +16,7 @@ import com.ruoyi.oa.domain.SgConstructionBatch; import com.ruoyi.oa.mapper.SgConstructionBatchMapper; import com.ruoyi.oa.service.ISgConstructionBatchService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -51,10 +52,12 @@ LambdaQueryWrapper<SgConstructionBatch> lqw = Wrappers.lambdaQuery(); lqw.like(StringUtils.isNotBlank(bo.getBatch()), SgConstructionBatch::getBatch, bo.getBatch()); lqw.eq(SgConstructionBatch::getSchoolId, bo.getSchoolId()); + lqw.orderByDesc(SgConstructionBatch::getUpdateTime); return lqw; } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(SgConstructionBatchBo bo) { List<SgConstructionBatch> list = baseMapper.selectList(new LambdaQueryWrapper<SgConstructionBatch>() .eq(SgConstructionBatch::getBatch, bo.getBatch()).eq(SgConstructionBatch::getSchoolId, bo.getSchoolId())); @@ -71,6 +74,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(SgConstructionBatchBo bo) { List<SgConstructionBatch> list = baseMapper.selectList(new LambdaQueryWrapper<SgConstructionBatch>() .eq(SgConstructionBatch::getBatch, bo.getBatch()) diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgIotServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgIotServiceImpl.java new file mode 100644 index 0000000..c4e1b46 --- /dev/null +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgIotServiceImpl.java @@ -0,0 +1,197 @@ +package com.ruoyi.oa.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.http.HttpStatus; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.common.utils.PageUtils; +import com.ruoyi.common.core.page.PagePlus; +import com.ruoyi.common.core.page.TableDataInfo; +import org.springframework.stereotype.Service; +import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.oa.domain.bo.SgIotBo; +import com.ruoyi.oa.domain.vo.SgIotVo; +import com.ruoyi.oa.domain.SgIot; +import com.ruoyi.oa.mapper.SgIotMapper; +import com.ruoyi.oa.service.ISgIotService; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * IoT璁惧Service涓氬姟灞傚鐞� + * + * @author ruoyi + * @date 2022-05-12 + */ +@Service +public class SgIotServiceImpl extends ServicePlusImpl<SgIotMapper, SgIot, SgIotVo> implements ISgIotService { + + @Override + public SgIotVo queryById(Long id) { + return getVoById(id); + } + + @Override + public TableDataInfo<SgIotVo> queryPageList(SgIotBo bo) { + PagePlus<SgIot, SgIotVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo)); + return PageUtils.buildDataInfo(result); + } + + @Override + public List<SgIotVo> queryList(SgIotBo bo) { + return listVo(buildQueryWrapper(bo)); + } + + private LambdaQueryWrapper<SgIot> buildQueryWrapper(SgIotBo bo) { + Map<String, Object> params = bo.getParams(); + LambdaQueryWrapper<SgIot> lqw = Wrappers.lambdaQuery(); + lqw.like(StringUtils.isNotBlank(bo.getDeploymentName()), SgIot::getDeploymentName, bo.getDeploymentName()); + lqw.eq(StringUtils.isNotBlank(bo.getEdition()), SgIot::getEdition, bo.getEdition()); + lqw.eq(bo.getBuildingId() != null, SgIot::getBuildingId, bo.getBuildingId()); + lqw.eq(bo.getOrganizationId() != null, SgIot::getOrganizationId, bo.getOrganizationId()); + lqw.eq(bo.getConstructionBatchId() != null, SgIot::getConstructionBatchId, bo.getConstructionBatchId()); + lqw.like(StringUtils.isNotBlank(bo.getMonitorObject()), SgIot::getMonitorObject, bo.getMonitorObject()); + lqw.eq(SgIot::getSchoolId, bo.getSchoolId()); + lqw.orderByDesc(SgIot::getUpdateTime); + if (bo.getPeripheralUnit() != null && StringUtils.isNotBlank(bo.getPassageway())) { + if ("1".equals(bo.getPassageway())) { + lqw.eq(SgIot::getPassagewayOne, bo.getPeripheralUnit()); + } + if ("2".equals(bo.getPassageway())) { + lqw.eq(SgIot::getPassagewayTwo, bo.getPeripheralUnit()); + } + if ("3".equals(bo.getPassageway())) { + lqw.eq(SgIot::getPassagewayThree, bo.getPeripheralUnit()); + } + if ("4".equals(bo.getPassageway())) { + lqw.eq(SgIot::getPassagewayFour, bo.getPeripheralUnit()); + } + if ("5".equals(bo.getPassageway())) { + lqw.and(i -> i.eq(SgIot::getPassagewayOne, bo.getPeripheralUnit()) + .or().eq(SgIot::getPassagewayTwo, bo.getPeripheralUnit()) + .or().eq(SgIot::getPassagewayThree, bo.getPeripheralUnit()) + .or().eq(SgIot::getPassagewayFour, bo.getPeripheralUnit())); + } + } + return lqw; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean insertByBo(SgIotBo bo) { + List<SgIot> list = baseMapper.selectList(new LambdaQueryWrapper<SgIot>() + .eq(SgIot::getDeploymentName, bo.getDeploymentName()) + .eq(SgIot::getSchoolId, bo.getSchoolId())); + if (list.size() > 0) { + throw new ServiceException("閮ㄧ讲鍚嶇О閲嶅", HttpStatus.HTTP_PARTIAL); + } + List<SgIot> lanList = baseMapper.selectList(new LambdaQueryWrapper<SgIot>() + .eq(SgIot::getLan, bo.getLan()) + .eq(SgIot::getSchoolId, bo.getSchoolId())); + if (lanList.size() > 0) { + throw new ServiceException("LAN閲嶅", HttpStatus.HTTP_PARTIAL); + } + SgIot add = BeanUtil.toBean(bo, SgIot.class); + validEntityBeforeSave(add); + boolean flag = save(add); + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean updateByBo(SgIotBo bo) { + List<SgIot> list = baseMapper.selectList(new LambdaQueryWrapper<SgIot>() + .eq(SgIot::getDeploymentName, bo.getDeploymentName()) + .eq(SgIot::getSchoolId, bo.getSchoolId()) + .ne(SgIot::getId, bo.getId())); + if (list.size() > 0) { + throw new ServiceException("閮ㄧ讲鍚嶇О閲嶅", HttpStatus.HTTP_PARTIAL); + } + List<SgIot> lanList = baseMapper.selectList(new LambdaQueryWrapper<SgIot>() + .eq(SgIot::getLan, bo.getLan()) + .eq(SgIot::getSchoolId, bo.getSchoolId()) + .ne(SgIot::getId, bo.getId())); + if (lanList.size() > 0) { + throw new ServiceException("LAN閲嶅", HttpStatus.HTTP_PARTIAL); + } + SgIot update = BeanUtil.toBean(bo, SgIot.class); + validEntityBeforeSave(update); + return updateById(update); + } + + @Override + public int getNumber(SgIotBo bo) { + int sum = 0; + LambdaQueryWrapper<SgIot> lqw = Wrappers.lambdaQuery(); + lqw.eq(SgIot::getSchoolId, bo.getSchoolId()); + if (bo.getPeripheralUnit() != null && StringUtils.isNotBlank(bo.getPassageway())) { + if ("5".equals(bo.getPassageway())) { + lqw.and(i -> i.eq(SgIot::getPassagewayOne, bo.getPeripheralUnit()) + .or().eq(SgIot::getPassagewayTwo, bo.getPeripheralUnit()) + .or().eq(SgIot::getPassagewayThree, bo.getPeripheralUnit()) + .or().eq(SgIot::getPassagewayFour, bo.getPeripheralUnit())); + List<SgIot> list = baseMapper.selectList(lqw); + if (list.size() > 0) { + for (SgIot s : list) { + if (s.getPassagewayOne() != null && s.getPassagewayOne().equals(bo.getPeripheralUnit())) { + sum = sum + 1; + } + if (s.getPassagewayTwo() != null && s.getPassagewayTwo().equals(bo.getPeripheralUnit())) { + sum = sum + 1; + } + if (s.getPassagewayThree() != null && s.getPassagewayThree().equals(bo.getPeripheralUnit())) { + sum = sum + 1; + } + if (s.getPassagewayFour() != null && s.getPassagewayFour().equals(bo.getPeripheralUnit())) { + sum = sum + 1; + } + } + } else { + sum = 0; + } + } else { + if ("1".equals(bo.getPassageway())) { + lqw.eq(SgIot::getPassagewayOne, bo.getPeripheralUnit()); + } + if ("2".equals(bo.getPassageway())) { + lqw.eq(SgIot::getPassagewayTwo, bo.getPeripheralUnit()); + } + if ("3".equals(bo.getPassageway())) { + lqw.eq(SgIot::getPassagewayThree, bo.getPeripheralUnit()); + } + if ("4".equals(bo.getPassageway())) { + lqw.eq(SgIot::getPassagewayFour, bo.getPeripheralUnit()); + } + List<SgIot> list = baseMapper.selectList(lqw); + sum = list.size(); + } + } + return sum; + } + + /** + * 淇濆瓨鍓嶇殑鏁版嵁鏍¢獙 + * + * @param entity 瀹炰綋绫绘暟鎹� + */ + private void validEntityBeforeSave(SgIot entity) { + //TODO 鍋氫竴浜涙暟鎹牎楠�,濡傚敮涓�绾︽潫 + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { + if (isValid) { + //TODO 鍋氫竴浜涗笟鍔′笂鐨勬牎楠�,鍒ゆ柇鏄惁闇�瑕佹牎楠� + } + return removeByIds(ids); + } +} diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgIpcServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgIpcServiceImpl.java index 16bf05f..203eda0 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgIpcServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgIpcServiceImpl.java @@ -19,6 +19,7 @@ import com.ruoyi.oa.domain.SgIpc; import com.ruoyi.oa.mapper.SgIpcMapper; import com.ruoyi.oa.service.ISgIpcService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -61,10 +62,12 @@ lqw.eq(bo.getOrganizationId() != null, SgIpc::getOrganizationId, bo.getOrganizationId()); lqw.eq(bo.getConstructionBatchId() != null, SgIpc::getConstructionBatchId, bo.getConstructionBatchId()); lqw.like(StringUtils.isNotBlank(bo.getModel()), SgIpc::getModel, bo.getModel()); + lqw.orderByDesc(SgIpc::getUpdateTime); return lqw; } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(SgIpcBo bo) { List<SgIpc> list = baseMapper.selectList(new LambdaQueryWrapper<SgIpc>() .eq(SgIpc::getSchoolId, bo.getSchoolId()).eq(SgIpc::getMac, bo.getMac())); @@ -85,6 +88,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(SgIpcBo bo) { List<SgIpc> list = baseMapper.selectList(new LambdaQueryWrapper<SgIpc>() .eq(SgIpc::getSchoolId, bo.getSchoolId()) @@ -112,6 +116,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { if (isValid) { //TODO 鍋氫竴浜涗笟鍔′笂鐨勬牎楠�,鍒ゆ柇鏄惁闇�瑕佹牎楠� diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgNvrServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgNvrServiceImpl.java index a6170d8..5f511ae 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgNvrServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgNvrServiceImpl.java @@ -5,6 +5,7 @@ import com.ruoyi.common.utils.PageUtils; import com.ruoyi.common.core.page.PagePlus; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.oa.domain.SgReserveIp; import org.springframework.stereotype.Service; import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -14,6 +15,7 @@ import com.ruoyi.oa.domain.SgNvr; import com.ruoyi.oa.mapper.SgNvrMapper; import com.ruoyi.oa.service.ISgNvrService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -53,10 +55,12 @@ lqw.eq(bo.getConstructionBatchId() != null, SgNvr::getConstructionBatchId, bo.getConstructionBatchId()); lqw.like(StringUtils.isNotBlank(bo.getModel()), SgNvr::getModel, bo.getModel()); lqw.eq(SgNvr::getSchoolId, bo.getSchoolId()); + lqw.orderByDesc(SgNvr::getUpdateTime); return lqw; } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(SgNvrBo bo) { SgNvr add = BeanUtil.toBean(bo, SgNvr.class); validEntityBeforeSave(add); @@ -68,6 +72,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(SgNvrBo bo) { SgNvr update = BeanUtil.toBean(bo, SgNvr.class); validEntityBeforeSave(update); diff --git a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgReserveIpServiceImpl.java b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgReserveIpServiceImpl.java index 57b7ed1..421eee2 100644 --- a/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgReserveIpServiceImpl.java +++ b/ruoyi-oa/src/main/java/com/ruoyi/oa/service/impl/SgReserveIpServiceImpl.java @@ -14,6 +14,7 @@ import com.ruoyi.oa.domain.SgReserveIp; import com.ruoyi.oa.mapper.SgReserveIpMapper; import com.ruoyi.oa.service.ISgReserveIpService; +import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; @@ -50,10 +51,12 @@ lqw.like(StringUtils.isNotBlank(bo.getIp()), SgReserveIp::getIp, bo.getIp()); lqw.eq(bo.getBuildingId() != null, SgReserveIp::getBuildingId, bo.getBuildingId()); lqw.eq(SgReserveIp::getSchoolId, bo.getSchoolId()); + lqw.orderByDesc(SgReserveIp::getUpdateTime); return lqw; } @Override + @Transactional(rollbackFor = Exception.class) public Boolean insertByBo(SgReserveIpBo bo) { SgReserveIp add = BeanUtil.toBean(bo, SgReserveIp.class); validEntityBeforeSave(add); @@ -65,6 +68,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean updateByBo(SgReserveIpBo bo) { SgReserveIp update = BeanUtil.toBean(bo, SgReserveIp.class); validEntityBeforeSave(update); @@ -81,6 +85,7 @@ } @Override + @Transactional(rollbackFor = Exception.class) public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { if(isValid){ //TODO 鍋氫竴浜涗笟鍔′笂鐨勬牎楠�,鍒ゆ柇鏄惁闇�瑕佹牎楠� diff --git a/ruoyi-oa/src/main/resources/mapper/oa/SgIotMapper.xml b/ruoyi-oa/src/main/resources/mapper/oa/SgIotMapper.xml new file mode 100644 index 0000000..4051e0a --- /dev/null +++ b/ruoyi-oa/src/main/resources/mapper/oa/SgIotMapper.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE mapper +PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" +"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.oa.mapper.SgIotMapper"> + + <resultMap type="com.ruoyi.oa.domain.SgIot" id="SgIotResult"> + <result property="id" column="id"/> + <result property="deploymentName" column="deployment_name"/> + <result property="edition" column="edition"/> + <result property="lan" column="lan"/> + <result property="ip" column="ip"/> + <result property="buildingId" column="building_id"/> + <result property="organizationId" column="organization_id"/> + <result property="constructionBatchId" column="construction_batch_id"/> + <result property="serialNumber" column="serial_number"/> + <result property="model" column="model"/> + <result property="manufacturerId" column="manufacturer_id"/> + <result property="monitorObject" column="monitor_object"/> + <result property="passagewayOne" column="passageway_one"/> + <result property="passagewayTwo" column="passageway_two"/> + <result property="passagewayThree" column="passageway_three"/> + <result property="passagewayFour" column="passageway_four"/> + <result property="createBy" column="create_by"/> + <result property="createTime" column="create_time"/> + <result property="updateBy" column="update_by"/> + <result property="updateTime" column="update_time"/> + <result property="delFlag" column="del_flag"/> + </resultMap> + + +</mapper> -- Gitblit v1.9.1