From 62b79d5f0b23cfe87879a5b5cf18340315fce2be Mon Sep 17 00:00:00 2001 From: yaowanxin <3588231647@qq.com> Date: 星期一, 08 九月 2025 18:00:10 +0800 Subject: [PATCH] 用印管理,库存预警接口 --- src/main/java/com/ruoyi/collaborativeApproval/controller/SealApplicationManagementController.java | 50 +++ src/main/java/com/ruoyi/collaborativeApproval/service/SealApplicationManagementService.java | 10 src/main/java/com/ruoyi/collaborativeApproval/service/impl/SealApplicationManagementServiceImpl.java | 22 + src/main/java/com/ruoyi/procurementrecord/controller/GasTankWarningController.java | 44 +++ src/main/java/com/ruoyi/procurementrecord/service/GasTankWarningService.java | 15 + src/main/java/com/ruoyi/procurementrecord/mapper/GasTankWarningMapper.java | 13 + src/main/java/com/ruoyi/collaborativeApproval/service/RulesRegulationsManagementService.java | 11 src/main/resources/mapper/collaborativeApproval/SealApplicationManagementMapper.xml | 21 + src/main/java/com/ruoyi/procurementrecord/pojo/GasTankWarning.java | 158 ++++++++++++ src/main/resources/mapper/collaborativeApproval/RulesRegulationsManagementMapper.xml | 28 ++ src/main/java/com/ruoyi/approve/utils/ListToStringTypeHandler.java | 4 src/main/java/com/ruoyi/collaborativeApproval/pojo/SealApplicationManagement.java | 63 ++++ src/main/resources/mapper/procurementrecord/GasTankWarningMapper.xml | 23 + src/main/java/com/ruoyi/collaborativeApproval/service/impl/RulesRegulationsManagementServiceImpl.java | 21 + src/main/java/com/ruoyi/procurementrecord/service/impl/GasTankWarningServiceImpl.java | 40 +++ src/main/java/com/ruoyi/collaborativeApproval/dto/SealApplicationManagementDTO.java | 11 src/main/java/com/ruoyi/collaborativeApproval/pojo/RulesRegulationsManagement.java | 99 +++++++ src/main/java/com/ruoyi/collaborativeApproval/dto/RulesRegulationsManagementDTO.java | 16 + src/main/java/com/ruoyi/collaborativeApproval/mapper/SealApplicationManagementMapper.java | 14 + src/main/java/com/ruoyi/collaborativeApproval/mapper/RulesRegulationsManagementMapper.java | 14 + src/main/java/com/ruoyi/collaborativeApproval/controller/RulesRegulationsManagementController.java | 48 +++ 21 files changed, 725 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/ruoyi/approve/utils/ListToStringTypeHandler.java b/src/main/java/com/ruoyi/approve/utils/ListToStringTypeHandler.java index 5be97b7..4042a25 100644 --- a/src/main/java/com/ruoyi/approve/utils/ListToStringTypeHandler.java +++ b/src/main/java/com/ruoyi/approve/utils/ListToStringTypeHandler.java @@ -20,14 +20,18 @@ @Override public void setNonNullParameter(PreparedStatement ps, int i, List<String> parameter, JdbcType jdbcType) throws SQLException { + // 瀛樺偍鏃讹細List 杞�楀彿鍒嗛殧瀛楃涓� if (parameter == null) { ps.setString(i, null); } else { ps.setString(i, String.join(SEPARATOR, parameter)); } +// String value = parameter.stream().collect(Collectors.joining(",")); +// ps.setString(i, value); } @Override public List<String> getNullableResult(ResultSet rs, String columnName) throws SQLException { + // 鏌ヨ鏃讹細瀛楃涓茶浆 List String value = rs.getString(columnName); return value != null && !value.isEmpty() ? Arrays.asList(value.split(SEPARATOR)) : new ArrayList<>(); } diff --git a/src/main/java/com/ruoyi/collaborativeApproval/controller/RulesRegulationsManagementController.java b/src/main/java/com/ruoyi/collaborativeApproval/controller/RulesRegulationsManagementController.java new file mode 100644 index 0000000..ad1afe3 --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/controller/RulesRegulationsManagementController.java @@ -0,0 +1,48 @@ +package com.ruoyi.collaborativeApproval.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; +import com.ruoyi.collaborativeApproval.service.RulesRegulationsManagementService; +import com.ruoyi.framework.web.domain.AjaxResult; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@RestController +@RequestMapping("/rulesRegulationsManagement") +@AllArgsConstructor +public class RulesRegulationsManagementController { + @Autowired + private RulesRegulationsManagementService rulesRegulationsManagementService; + + @GetMapping("/getList") + @ApiOperation("鍒嗛〉鏌ヨ") + public AjaxResult listPage(Page page, RulesRegulationsManagement rulesRegulationsManagement){ + return AjaxResult.success(rulesRegulationsManagementService.listPage(page, rulesRegulationsManagement)); + } + + @PostMapping("/add") + @ApiOperation("鏂板") + public AjaxResult add(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ + return AjaxResult.success(rulesRegulationsManagementService.save(rulesRegulationsManagement)); + } + + @PostMapping("/update") + @ApiOperation("淇敼") + public AjaxResult update(@RequestBody RulesRegulationsManagement rulesRegulationsManagement){ + return AjaxResult.success(rulesRegulationsManagementService.updateById(rulesRegulationsManagement)); + } + + @DeleteMapping("/delete") + @ApiOperation("鍒犻櫎") + public AjaxResult delete(@PathVariable("ids") List<Long> ids){ + if (CollectionUtils.isEmpty(ids)) { + throw new RuntimeException("璇蜂紶鍏ヨ鍒犻櫎鐨処D"); + } + return AjaxResult.success(rulesRegulationsManagementService.removeBatchByIds(ids)); + } +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/controller/SealApplicationManagementController.java b/src/main/java/com/ruoyi/collaborativeApproval/controller/SealApplicationManagementController.java new file mode 100644 index 0000000..ef1e7a4 --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/controller/SealApplicationManagementController.java @@ -0,0 +1,50 @@ +package com.ruoyi.collaborativeApproval.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; +import com.ruoyi.collaborativeApproval.service.SealApplicationManagementService; +import com.ruoyi.framework.aspectj.lang.enums.BusinessType; +import com.ruoyi.framework.web.domain.AjaxResult; +import io.swagger.annotations.ApiOperation; +import lombok.AllArgsConstructor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@AllArgsConstructor +@RestController +@RequestMapping("/sealApplicationManagement") +public class SealApplicationManagementController { + @Autowired + private SealApplicationManagementService sealApplicationManagementService; + + @GetMapping("/getList") + @ApiOperation("鍒嗛〉鏌ヨ") + public AjaxResult listPage(Page page, SealApplicationManagement sealApplicationManagement){ + return AjaxResult.success(sealApplicationManagementService.listPage(page,sealApplicationManagement)); + } + + @PostMapping("/add") + @ApiOperation("鏂板") + public AjaxResult add(@RequestBody SealApplicationManagement sealApplicationManagement){ + return AjaxResult.success(sealApplicationManagementService.save(sealApplicationManagement)); + } + + @PostMapping("/update") + @ApiOperation("淇敼") + public AjaxResult update(@RequestBody SealApplicationManagement sealApplicationManagement){ + return AjaxResult.success(sealApplicationManagementService.updateById(sealApplicationManagement)); + } + + @DeleteMapping("/delete") + @ApiOperation("鍒犻櫎") + public AjaxResult delete(@PathVariable("ids") List<Long> ids){ + if (CollectionUtils.isEmpty(ids)) { + throw new RuntimeException("璇蜂紶鍏ヨ鍒犻櫎鐨処D"); + } + return AjaxResult.success(sealApplicationManagementService.removeBatchByIds(ids)); + } + +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/dto/RulesRegulationsManagementDTO.java b/src/main/java/com/ruoyi/collaborativeApproval/dto/RulesRegulationsManagementDTO.java new file mode 100644 index 0000000..61de2e9 --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/dto/RulesRegulationsManagementDTO.java @@ -0,0 +1,16 @@ +package com.ruoyi.collaborativeApproval.dto; + +import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; +import lombok.Data; + +import java.util.List; + +@Data +public class RulesRegulationsManagementDTO extends RulesRegulationsManagement { + /** + * 鍙戝竷浜哄鍚� + */ + private String createUserName; + private List<String> scope; + +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/dto/SealApplicationManagementDTO.java b/src/main/java/com/ruoyi/collaborativeApproval/dto/SealApplicationManagementDTO.java new file mode 100644 index 0000000..0dc75a6 --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/dto/SealApplicationManagementDTO.java @@ -0,0 +1,11 @@ +package com.ruoyi.collaborativeApproval.dto; + +import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; +import lombok.Data; + +@Data +public class SealApplicationManagementDTO extends SealApplicationManagement { + private String createUserName; + //鎵�灞為儴闂� + private String department; +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/mapper/RulesRegulationsManagementMapper.java b/src/main/java/com/ruoyi/collaborativeApproval/mapper/RulesRegulationsManagementMapper.java new file mode 100644 index 0000000..d37e631 --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/mapper/RulesRegulationsManagementMapper.java @@ -0,0 +1,14 @@ +package com.ruoyi.collaborativeApproval.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.collaborativeApproval.dto.RulesRegulationsManagementDTO; +import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface RulesRegulationsManagementMapper extends BaseMapper<RulesRegulationsManagement> { + IPage<RulesRegulationsManagementDTO> listPage(Page page,@Param("ew") RulesRegulationsManagement rulesRegulationsManagement); +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/mapper/SealApplicationManagementMapper.java b/src/main/java/com/ruoyi/collaborativeApproval/mapper/SealApplicationManagementMapper.java new file mode 100644 index 0000000..3b5e55f --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/mapper/SealApplicationManagementMapper.java @@ -0,0 +1,14 @@ +package com.ruoyi.collaborativeApproval.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.collaborativeApproval.dto.SealApplicationManagementDTO; +import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface SealApplicationManagementMapper extends BaseMapper<SealApplicationManagement> { + IPage<SealApplicationManagementDTO> listPage(Page page, @Param("ew") SealApplicationManagement sealApplicationManagement); +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/pojo/RulesRegulationsManagement.java b/src/main/java/com/ruoyi/collaborativeApproval/pojo/RulesRegulationsManagement.java new file mode 100644 index 0000000..6f5ea51 --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/pojo/RulesRegulationsManagement.java @@ -0,0 +1,99 @@ +package com.ruoyi.collaborativeApproval.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.approve.utils.ListToStringTypeHandler; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.apache.ibatis.type.JdbcType; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.List; + +@Data +@TableName(value = "rules_regulations_management") +public class RulesRegulationsManagement { + @TableId(value = "id", type = IdType.AUTO) + private Long id; + /** + * 鍒跺害缂栧彿 + */ + @ApiModelProperty("鍒跺害缂栧彿") + private String regulationNum; + + /** + * 鏍囬 + */ + @ApiModelProperty("鏍囬") + private String title; + /** + * 鍒跺害鍒嗙被 + */ + @ApiModelProperty("鍒跺害鍒嗙被") + private String category; + /** + * 鍒跺害鍐呭 + */ + @ApiModelProperty("鍒跺害鍐呭") + private String content; + /** + * 鐢熸晥鏃堕棿 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime effectiveTime; + + /** + * 閫傜敤鑼冨洿 + */ + @ApiModelProperty("閫傜敤鑼冨洿") + @TableField(value = "scope",typeHandler = ListToStringTypeHandler.class,jdbcType = JdbcType.VARCHAR) + private List<String> scope; + /** + * 鏄惁闇�瑕佺‘璁� + */ + @ApiModelProperty("鏄惁闇�瑕佺‘璁�") + private Boolean requireConfirm; + /** + * 鐗堟湰 + */ + @ApiModelProperty("鐗堟湰") + private String version; + /** + * 鐘舵�� + */ + @ApiModelProperty("鐘舵��") + private String status; + /** + * 宸茶浜烘暟 + */ + @ApiModelProperty("宸茶浜烘暟") + private Integer readCount; + /** + * 鍒涘缓鑰� + */ + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + /** + * 鍒涘缓鏃堕棿 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + /** + * 淇敼浜� + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + /** + * 淇敼鏃堕棿 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private LocalDateTime updateTime; + /** + * 绉熸埛ID + */ + @TableField(fill = FieldFill.INSERT) + private Long tenantId; +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/pojo/SealApplicationManagement.java b/src/main/java/com/ruoyi/collaborativeApproval/pojo/SealApplicationManagement.java new file mode 100644 index 0000000..6525fc3 --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/pojo/SealApplicationManagement.java @@ -0,0 +1,63 @@ +package com.ruoyi.collaborativeApproval.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.time.LocalDateTime; + +@Data +@TableName("seal_application_management") +public class SealApplicationManagement { + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + /** + * 鐢宠缂栧彿 + */ + @ApiModelProperty("鐢宠缂栧彿") + private String applicationNum; + + /** + * 鍏憡鏍囬 + */ + @ApiModelProperty("鍏憡鏍囬") + private String title; + /** + * 鐢ㄥ嵃绫诲瀷 + */ + @ApiModelProperty("鐢ㄥ嵃绫诲瀷") + private String sealType; + /** + * 鐢宠鐢ㄥ嵃鍘熷洜 + */ + @ApiModelProperty("鐢宠鐢ㄥ嵃鍘熷洜") + private String reason; + + /** + * 绱ф�ョ▼搴� + */ + @ApiModelProperty("绱ф�ョ▼搴�") + private String urgency; + /** + * 鐘舵�� + */ + @ApiModelProperty("鐘舵��") + private String status; + /** + * 鍒涘缓鑰� + */ + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + /** + * 鍒涘缓鏃堕棿 + */ + @TableField(fill = FieldFill.INSERT) + private LocalDateTime createTime; + /** + * 绉熸埛ID + */ + @TableField(fill = FieldFill.INSERT) + private Long tenantId; +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/service/RulesRegulationsManagementService.java b/src/main/java/com/ruoyi/collaborativeApproval/service/RulesRegulationsManagementService.java new file mode 100644 index 0000000..270fa56 --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/service/RulesRegulationsManagementService.java @@ -0,0 +1,11 @@ +package com.ruoyi.collaborativeApproval.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.collaborativeApproval.dto.RulesRegulationsManagementDTO; +import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; + +public interface RulesRegulationsManagementService extends IService<RulesRegulationsManagement> { + IPage<RulesRegulationsManagementDTO> listPage(Page page, RulesRegulationsManagement rulesRegulationsManagement); +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/service/SealApplicationManagementService.java b/src/main/java/com/ruoyi/collaborativeApproval/service/SealApplicationManagementService.java new file mode 100644 index 0000000..d0d931a --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/service/SealApplicationManagementService.java @@ -0,0 +1,10 @@ +package com.ruoyi.collaborativeApproval.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; + +public interface SealApplicationManagementService extends IService<SealApplicationManagement> { + IPage listPage(Page page, SealApplicationManagement sealApplicationManagement); +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/service/impl/RulesRegulationsManagementServiceImpl.java b/src/main/java/com/ruoyi/collaborativeApproval/service/impl/RulesRegulationsManagementServiceImpl.java new file mode 100644 index 0000000..a4f912e --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/service/impl/RulesRegulationsManagementServiceImpl.java @@ -0,0 +1,21 @@ +package com.ruoyi.collaborativeApproval.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.collaborativeApproval.dto.RulesRegulationsManagementDTO; +import com.ruoyi.collaborativeApproval.mapper.RulesRegulationsManagementMapper; +import com.ruoyi.collaborativeApproval.pojo.RulesRegulationsManagement; +import com.ruoyi.collaborativeApproval.service.RulesRegulationsManagementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class RulesRegulationsManagementServiceImpl extends ServiceImpl<RulesRegulationsManagementMapper, RulesRegulationsManagement> implements RulesRegulationsManagementService { + @Autowired + private RulesRegulationsManagementMapper rulesRegulationsManagementMapper; + @Override + public IPage<RulesRegulationsManagementDTO> listPage(Page page, RulesRegulationsManagement rulesRegulationsManagement) { + return rulesRegulationsManagementMapper.listPage(page, rulesRegulationsManagement); + } +} diff --git a/src/main/java/com/ruoyi/collaborativeApproval/service/impl/SealApplicationManagementServiceImpl.java b/src/main/java/com/ruoyi/collaborativeApproval/service/impl/SealApplicationManagementServiceImpl.java new file mode 100644 index 0000000..6cb8a2b --- /dev/null +++ b/src/main/java/com/ruoyi/collaborativeApproval/service/impl/SealApplicationManagementServiceImpl.java @@ -0,0 +1,22 @@ +package com.ruoyi.collaborativeApproval.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.collaborativeApproval.dto.SealApplicationManagementDTO; +import com.ruoyi.collaborativeApproval.mapper.SealApplicationManagementMapper; +import com.ruoyi.collaborativeApproval.pojo.SealApplicationManagement; +import com.ruoyi.collaborativeApproval.service.SealApplicationManagementService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class SealApplicationManagementServiceImpl extends ServiceImpl<SealApplicationManagementMapper, SealApplicationManagement> implements SealApplicationManagementService { + @Autowired + private SealApplicationManagementMapper sealApplicationManagementMapper; + + @Override + public IPage<SealApplicationManagementDTO> listPage(Page page, SealApplicationManagement sealApplicationManagement) { + return sealApplicationManagementMapper.listPage(page, sealApplicationManagement); + } +} diff --git a/src/main/java/com/ruoyi/procurementrecord/controller/GasTankWarningController.java b/src/main/java/com/ruoyi/procurementrecord/controller/GasTankWarningController.java new file mode 100644 index 0000000..7646478 --- /dev/null +++ b/src/main/java/com/ruoyi/procurementrecord/controller/GasTankWarningController.java @@ -0,0 +1,44 @@ +package com.ruoyi.procurementrecord.controller; + + +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.framework.web.domain.AjaxResult; +import com.ruoyi.procurementrecord.pojo.GasTankWarning; +import com.ruoyi.procurementrecord.service.GasTankWarningService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +@RestController +@RequestMapping("/gasTankWarning") +public class GasTankWarningController { + @Autowired + private GasTankWarningService gasTankWarningService; + + @GetMapping("/listPage") + public AjaxResult listPage(Page page, GasTankWarning gasTankWarning) { + return AjaxResult.success(gasTankWarningService.listPage(page, gasTankWarning)); + } + @PostMapping("/add") + public AjaxResult add(@RequestBody GasTankWarning gasTankWarning) { + return AjaxResult.success(gasTankWarningService.save(gasTankWarning)); + } + @PostMapping("update") + public AjaxResult update(@RequestBody GasTankWarning gasTankWarning) { + return AjaxResult.success(gasTankWarningService.updateById(gasTankWarning)); + } + @DeleteMapping("delete") + public AjaxResult delete(@RequestBody List<Long> ids){ + if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D"); + return AjaxResult.success(gasTankWarningService.removeByIds(ids)); + } + //瀵煎嚭 + @PostMapping("/export") + public void export(HttpServletResponse response,@RequestParam(name = "ids", required = false) List<Long> ids){ + gasTankWarningService.export(response,ids); + } + +} diff --git a/src/main/java/com/ruoyi/procurementrecord/mapper/GasTankWarningMapper.java b/src/main/java/com/ruoyi/procurementrecord/mapper/GasTankWarningMapper.java new file mode 100644 index 0000000..aab09cb --- /dev/null +++ b/src/main/java/com/ruoyi/procurementrecord/mapper/GasTankWarningMapper.java @@ -0,0 +1,13 @@ +package com.ruoyi.procurementrecord.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.ruoyi.procurementrecord.pojo.GasTankWarning; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface GasTankWarningMapper extends BaseMapper<GasTankWarning> { + IPage<GasTankWarning> listPage(Page page, @Param("gasTankWarning") GasTankWarning gasTankWarning); +} diff --git a/src/main/java/com/ruoyi/procurementrecord/pojo/GasTankWarning.java b/src/main/java/com/ruoyi/procurementrecord/pojo/GasTankWarning.java new file mode 100644 index 0000000..4f95872 --- /dev/null +++ b/src/main/java/com/ruoyi/procurementrecord/pojo/GasTankWarning.java @@ -0,0 +1,158 @@ +package com.ruoyi.procurementrecord.pojo; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.ruoyi.framework.aspectj.lang.annotation.Excel; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.time.LocalDateTime; + +@Data +@TableName("gas_tank_warning") +public class GasTankWarning implements Serializable { + @TableId(value = "id",type = IdType.AUTO) + private Long id; + /** + * 鍌ㄦ皵缃愮紪鐮� + */ + @Excel(name = "鍌ㄦ皵缃愮紪鐮�") + private String tankCode; + /** + * 鍌ㄦ皵缃愬悕绉� + */ + @Excel(name = "鍌ㄦ皵缃愬悕绉�") + private String tankName; + /** + * 鍌ㄦ皵缃愮被鍨� + */ + @Excel(name = "鍌ㄦ皵缃愮被鍨�") + private String tankType; + /** + * 瑙勬牸鍨嬪彿 + */ + @Excel(name = "瑙勬牸鍨嬪彿") + private String specificationModel; + /** + * 瀹圭Н(m鲁) + */ + @Excel(name = "瀹圭Н(m鲁)") + private Long volume; + /** + * 褰撳墠姘斾綋姘村钩(m鲁) + */ + @Excel(name = "褰撳墠姘斾綋姘村钩(m鲁)") + private Long currentGasLevel; + /** + * 瀹夊叏姘斾綋姘村钩(m鲁) + */ + @Excel(name = "瀹夊叏姘斾綋姘村钩(m鲁)") + private Long safetyGasLevel; + /** + * 鏈�灏忔皵浣撴按骞�(m鲁) + */ + @Excel(name = "鏈�灏忔皵浣撴按骞�(m鲁)") + private Long minGasLevel; + /** + * 鏈�澶ф皵浣撴按骞�(m鲁) + */ + @Excel(name = "鏈�澶ф皵浣撴按骞�(m鲁)") + private Long maxGasLevel; + /** + * 褰撳墠鍘嬪姏(MPa) + */ + @Excel(name = "褰撳墠鍘嬪姏(MPa)") + private Double currentPressure; + /** + * 棰勮绫诲瀷 + */ + @Excel(name = "棰勮绫诲瀷") + private String warningType; + /** + * 棰勮绛夌骇 + */ + @Excel(name = "棰勮绛夌骇") + private String warningLevel; + /** + * 棰勮闃堝�� + */ + @Excel(name = "棰勮闃堝��") + private Long warningThreshold; + /** + * 鏄惁鍚敤 + */ + @Excel(name = "鏄惁鍚敤") + private Boolean isEnabled; + /** + * 棰勮瑙勫垯-褰�???鏃惰Е鍙戦璀� + */ + @Excel(name = "棰勮瑙勫垯") + private String warningRule; + /** + * 棰勮鏃堕棿 + */ + @Excel(name = "棰勮鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime warningTime; + /** + * 棰勮鎸佺画澶╂暟 + */ + @Excel(name = "棰勮鎸佺画澶╂暟") + private Long warningDuration; + /** + * 鏈�鍚庢洿鏂版椂闂� + */ + @Excel(name = "鏈�鍚庢洿鏂版椂闂�") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime lastUpdateTime; + /** + * 棰勬湡鍏呰鏃堕棿 + */ + @Excel(name = "棰勬湡鍏呰鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime expectedRefillTime; + /** + * 棰勬湡缂烘皵鏃堕棿 + */ + @Excel(name = "棰勬湡缂烘皵鏃堕棿") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime expectedShortageTime; + /** + * 鍒涘缓鏃堕棿 + */ + @TableField(fill = FieldFill.INSERT) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime createTime; + + /** + * 鏇存柊鏃堕棿 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private LocalDateTime updateTime; + + /** + * 鍒涘缓浜� + */ + @TableField(fill = FieldFill.INSERT) + private Integer createUser; + + /** + * 鏇存柊浜� + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Integer updateUser; + + /** + * 绉熸埛ID + */ + @TableField(fill = FieldFill.INSERT) + private Long tenantId; +} diff --git a/src/main/java/com/ruoyi/procurementrecord/service/GasTankWarningService.java b/src/main/java/com/ruoyi/procurementrecord/service/GasTankWarningService.java new file mode 100644 index 0000000..912fb3c --- /dev/null +++ b/src/main/java/com/ruoyi/procurementrecord/service/GasTankWarningService.java @@ -0,0 +1,15 @@ +package com.ruoyi.procurementrecord.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.procurementrecord.pojo.GasTankWarning; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +public interface GasTankWarningService extends IService<GasTankWarning> { + IPage listPage(Page page, GasTankWarning gasTankWarning); + + void export(HttpServletResponse response, List<Long> ids); +} diff --git a/src/main/java/com/ruoyi/procurementrecord/service/impl/GasTankWarningServiceImpl.java b/src/main/java/com/ruoyi/procurementrecord/service/impl/GasTankWarningServiceImpl.java new file mode 100644 index 0000000..772869b --- /dev/null +++ b/src/main/java/com/ruoyi/procurementrecord/service/impl/GasTankWarningServiceImpl.java @@ -0,0 +1,40 @@ +package com.ruoyi.procurementrecord.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.exception.ServiceException; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.procurementrecord.dto.ProcurementPageDto; +import com.ruoyi.procurementrecord.mapper.GasTankWarningMapper; +import com.ruoyi.procurementrecord.pojo.GasTankWarning; +import com.ruoyi.procurementrecord.service.GasTankWarningService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.List; + +@Service +public class GasTankWarningServiceImpl extends ServiceImpl<GasTankWarningMapper, GasTankWarning> implements GasTankWarningService { + @Autowired + private GasTankWarningMapper gasTankWarningMapper; + @Override + public IPage listPage(Page page, GasTankWarning gasTankWarning) { + return gasTankWarningMapper.listPage(page,gasTankWarning); + } + + @Override + public void export(HttpServletResponse response, List<Long> ids) { + List<GasTankWarning> list = new ArrayList<>(); + if(CollectionUtils.isEmpty(ids)){ + list = gasTankWarningMapper.selectList(null); + }else { + list = gasTankWarningMapper.selectBatchIds(ids); + } + ExcelUtil<GasTankWarning> util = new ExcelUtil<>(GasTankWarning.class); + util.exportExcel(response, list, "鍌ㄦ皵缃愰璀�.xlsx"); + } +} diff --git a/src/main/resources/mapper/collaborativeApproval/RulesRegulationsManagementMapper.xml b/src/main/resources/mapper/collaborativeApproval/RulesRegulationsManagementMapper.xml new file mode 100644 index 0000000..c34b460 --- /dev/null +++ b/src/main/resources/mapper/collaborativeApproval/RulesRegulationsManagementMapper.xml @@ -0,0 +1,28 @@ +<?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.collaborativeApproval.mapper.RulesRegulationsManagementMapper"> + <resultMap id="RulesRegulationsManagementDTOMap" type="com.ruoyi.collaborativeApproval.dto.RulesRegulationsManagementDTO"> + <!-- 鍏朵粬瀛楁鏄犲皠锛堜繚鎸佷笉鍙橈級 --> + <result column="id" property="id"/> + <result column="regulation_num" property="regulationNum"/> + <result column="title" property="title"/> + <!-- ... 鐪佺暐鍏朵粬瀛楁 ... --> + + <!-- 鍏抽敭淇锛氫负 scope 瀛楁鎸囧畾绫诲瀷澶勭悊鍣� --> + <result column="scope" property="scope" typeHandler="com.ruoyi.approve.utils.ListToStringTypeHandler"/> + </resultMap> + + <select id="listPage" resultMap="RulesRegulationsManagementDTOMap"> + select rrm.*, su.user_name as create_user_name + from rules_regulations_management rrm + left join sys_user su on rrm.create_user = su.user_id + <where> + <if test="ew.title != null and ew.title != ''"> + and rrm.title like concat('%',#{ew.title},'%') + </if> + <if test="ew.category != null"> + and rrm.category = #{ew.category} + </if> + </where> + </select> +</mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/collaborativeApproval/SealApplicationManagementMapper.xml b/src/main/resources/mapper/collaborativeApproval/SealApplicationManagementMapper.xml new file mode 100644 index 0000000..b8ad6a7 --- /dev/null +++ b/src/main/resources/mapper/collaborativeApproval/SealApplicationManagementMapper.xml @@ -0,0 +1,21 @@ +<?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.collaborativeApproval.mapper.SealApplicationManagementMapper"> + + + <select id="listPage" resultType="com.ruoyi.collaborativeApproval.dto.SealApplicationManagementDTO"> + select sam.*, su.user_name as create_user_name, d.dept_name as department + from seal_application_management sam + left join sys_user su on sam.create_user = su.user_id + left join sys_user_dept sud on su.user_id = sud.user_id + left join sys_dept d on sud.dept_id = d.dept_id + <where> + <if test="ew.title != null and ew.title != ''"> + and sam.title like concat('%',#{ew.title},'%') + </if> + <if test="ew.status != null"> + and sam.status = #{ew.status} + </if> + </where> + </select> +</mapper> \ No newline at end of file diff --git a/src/main/resources/mapper/procurementrecord/GasTankWarningMapper.xml b/src/main/resources/mapper/procurementrecord/GasTankWarningMapper.xml new file mode 100644 index 0000000..9f06e2c --- /dev/null +++ b/src/main/resources/mapper/procurementrecord/GasTankWarningMapper.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<mapper namespace="com.ruoyi.procurementrecord.mapper.GasTankWarningMapper"> + + + <select id="listPage" resultType="com.ruoyi.procurementrecord.pojo.GasTankWarning"> + select * from gas_tank_warning + where 1=1 + <if test="gasTankWarning.tankName != null and gasTankWarning.tankName != ''"> + and tank_name like concat('%', #{gasTankWarning.tankName}, '%') + </if> + <if test="gasTankWarning.tankType != null"> + and tank_type = #{gasTankWarning.tankType} + </if> + <if test="gasTankWarning.warningType != null"> + and warning_type = #{gasTankWarning.warningType} + </if> + <if test="gasTankWarning.warningLevel != null"> + and warning_level = #{gasTankWarning.warningLevel} + </if> + + </select> +</mapper> \ No newline at end of file -- Gitblit v1.9.3