Browse Source

新增爆破片更换记录、盘点信息模块

lingpeng.li 3 days ago
parent
commit
2dfa35aeba
23 changed files with 1249 additions and 160 deletions
  1. 113 15
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/controller/InventoryCountController.java
  2. 2 6
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/entity/InventoryCount.java
  3. 134 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/entity/InventoryInfo.java
  4. 2 2
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/mapper/InventoryCountMapper.java
  5. 31 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/mapper/InventoryInfoMapper.java
  6. 16 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/mapper/xml/InventoryInfoMapper.xml
  7. 37 2
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/service/IInventoryCountService.java
  8. 23 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/service/IInventoryInfoService.java
  9. 61 2
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/service/impl/InventoryCountServiceImpl.java
  10. 27 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/service/impl/InventoryInfoServiceImpl.java
  11. 165 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/vo/InventoryCountPage.java
  12. 162 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/controller/BurstDiscReplaceRecordController.java
  13. 140 127
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/controller/SpecialDeviceController.java
  14. 131 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/entity/BurstDiscReplaceRecord.java
  15. 60 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/enums/DiscardRangeEnum.java
  16. 14 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/mapper/BurstDiscReplaceRecordMapper.java
  17. 4 2
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/mapper/SpecialDeviceMapper.java
  18. 5 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/mapper/xml/BurstDiscReplaceRecordMapper.xml
  19. 14 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/service/IBurstDiscReplaceRecordService.java
  20. 5 2
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/service/ISpecialDeviceService.java
  21. 19 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/service/impl/BurstDiscReplaceRecordServiceImpl.java
  22. 60 2
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/service/impl/SpecialDeviceServiceImpl.java
  23. 24 0
      zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/vo/NumberCountsVO.java

+ 113 - 15
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/controller/InventoryCountController.java

@@ -7,38 +7,55 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.jeecg.common.api.CommonAPI;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.AutoLog;
-import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.RedisUtil;
 import org.jeecg.common.util.TokenUtils;
+import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryCount;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryInfo;
 import org.jeecg.modules.sparePartsConsumables.inventoryManagement.service.IInventoryCountService;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.service.IInventoryInfoService;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.vo.InventoryCountPage;
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
 
 /**
  * @Description: 库存盘点
  * @Author: jeecg-boot
- * @Date: 2025-05-22
+ * @Date: 2025-05-23
  * @Version: V1.0
  */
 @Api(tags = "库存盘点")
 @RestController
 @RequestMapping("/sparePartsConsumables/inventoryCount")
 @Slf4j
-public class InventoryCountController extends JeecgController<InventoryCount, IInventoryCountService> {
+public class InventoryCountController {
 
     @Lazy
     @Resource
@@ -50,6 +67,8 @@ public class InventoryCountController extends JeecgController<InventoryCount, II
 
     @Autowired
     private IInventoryCountService inventoryCountService;
+    @Autowired
+    private IInventoryInfoService inventoryInfoService;
 
     /**
      * 分页列表查询
@@ -76,30 +95,38 @@ public class InventoryCountController extends JeecgController<InventoryCount, II
     /**
      * 添加
      *
-     * @param inventoryCount
+     * @param inventoryCountPage
      * @return
      */
     @AutoLog(value = "库存盘点-添加")
     @ApiOperation(value = "库存盘点-添加", notes = "库存盘点-添加")
     @RequiresPermissions("sparePartsConsumables:sbsmzq_inventory_count:add")
     @PostMapping(value = "/add")
-    public Result<String> add(@RequestBody InventoryCount inventoryCount) {
-        inventoryCountService.save(inventoryCount);
+    public Result<String> add(@RequestBody InventoryCountPage inventoryCountPage) {
+        InventoryCount inventoryCount = new InventoryCount();
+        BeanUtils.copyProperties(inventoryCountPage, inventoryCount);
+        inventoryCountService.saveMain(inventoryCount, inventoryCountPage.getInventoryInfoList());
         return Result.OK("添加成功!");
     }
 
     /**
      * 编辑
      *
-     * @param inventoryCount
+     * @param inventoryCountPage
      * @return
      */
     @AutoLog(value = "库存盘点-编辑")
     @ApiOperation(value = "库存盘点-编辑", notes = "库存盘点-编辑")
     @RequiresPermissions("sparePartsConsumables:sbsmzq_inventory_count:edit")
     @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
-    public Result<String> edit(@RequestBody InventoryCount inventoryCount) {
-        inventoryCountService.updateById(inventoryCount);
+    public Result<String> edit(@RequestBody InventoryCountPage inventoryCountPage) {
+        InventoryCount inventoryCount = new InventoryCount();
+        BeanUtils.copyProperties(inventoryCountPage, inventoryCount);
+        InventoryCount inventoryCountEntity = inventoryCountService.getById(inventoryCount.getId());
+        if (inventoryCountEntity == null) {
+            return Result.error("未找到对应数据");
+        }
+        inventoryCountService.updateMain(inventoryCount, inventoryCountPage.getInventoryInfoList());
         return Result.OK("编辑成功!");
     }
 
@@ -114,7 +141,7 @@ public class InventoryCountController extends JeecgController<InventoryCount, II
     @RequiresPermissions("sparePartsConsumables:sbsmzq_inventory_count:delete")
     @DeleteMapping(value = "/delete")
     public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
-        inventoryCountService.removeById(id);
+        inventoryCountService.delMain(id);
         return Result.OK("删除成功!");
     }
 
@@ -129,8 +156,8 @@ public class InventoryCountController extends JeecgController<InventoryCount, II
     @RequiresPermissions("sparePartsConsumables:sbsmzq_inventory_count:deleteBatch")
     @DeleteMapping(value = "/deleteBatch")
     public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        this.inventoryCountService.removeByIds(Arrays.asList(ids.split(",")));
-        return Result.OK("批量删除成功!");
+        this.inventoryCountService.delBatchMain(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功");
     }
 
     /**
@@ -148,6 +175,21 @@ public class InventoryCountController extends JeecgController<InventoryCount, II
             return Result.error("未找到对应数据");
         }
         return Result.OK(inventoryCount);
+
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    //@AutoLog(value = "盘点信息通过主表ID查询")
+    @ApiOperation(value = "盘点信息主表ID查询", notes = "盘点信息-通主表ID查询")
+    @GetMapping(value = "/queryInventoryInfoByMainId")
+    public Result<List<InventoryInfo>> queryInventoryInfoListByMainId(@RequestParam(name = "id", required = true) String id) {
+        List<InventoryInfo> inventoryInfoList = inventoryInfoService.selectByMainId(id);
+        return Result.OK(inventoryInfoList);
     }
 
     /**
@@ -159,7 +201,36 @@ public class InventoryCountController extends JeecgController<InventoryCount, II
     @RequiresPermissions("sparePartsConsumables:sbsmzq_inventory_count:exportXls")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, InventoryCount inventoryCount) {
-        return super.exportXls(request, inventoryCount, InventoryCount.class, "库存盘点");
+        // Step.1 组装查询条件查询数据
+        QueryWrapper<InventoryCount> queryWrapper = QueryGenerator.initQueryWrapper(inventoryCount, request.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+        //配置选中数据查询条件
+        String selections = request.getParameter("selections");
+        if (oConvertUtils.isNotEmpty(selections)) {
+            List<String> selectionList = Arrays.asList(selections.split(","));
+            queryWrapper.in("id", selectionList);
+        }
+        //Step.2 获取导出数据
+        List<InventoryCount> inventoryCountList = inventoryCountService.list(queryWrapper);
+
+        // Step.3 组装pageList
+        List<InventoryCountPage> pageList = new ArrayList<InventoryCountPage>();
+        for (InventoryCount main : inventoryCountList) {
+            InventoryCountPage vo = new InventoryCountPage();
+            BeanUtils.copyProperties(main, vo);
+            List<InventoryInfo> inventoryInfoList = inventoryInfoService.selectByMainId(main.getId());
+            vo.setInventoryInfoList(inventoryInfoList);
+            pageList.add(vo);
+        }
+
+        // Step.4 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        mv.addObject(NormalExcelConstants.FILE_NAME, "库存盘点列表");
+        mv.addObject(NormalExcelConstants.CLASS, InventoryCountPage.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("库存盘点数据", "导出人:" + sysUser.getRealname(), "库存盘点"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+        return mv;
     }
 
     /**
@@ -172,10 +243,37 @@ public class InventoryCountController extends JeecgController<InventoryCount, II
     @RequiresPermissions("sparePartsConsumables:sbsmzq_inventory_count:importExcel")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, InventoryCount.class);
+        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+            // 获取上传文件对象
+            MultipartFile file = entity.getValue();
+            ImportParams params = new ImportParams();
+            params.setTitleRows(2);
+            params.setHeadRows(1);
+            params.setNeedSave(true);
+            try {
+                List<InventoryCountPage> list = ExcelImportUtil.importExcel(file.getInputStream(), InventoryCountPage.class, params);
+                for (InventoryCountPage page : list) {
+                    InventoryCount po = new InventoryCount();
+                    BeanUtils.copyProperties(page, po);
+                    inventoryCountService.saveMain(po, page.getInventoryInfoList());
+                }
+                return Result.OK("文件导入成功!数据行数:" + list.size());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+                return Result.error("文件导入失败:" + e.getMessage());
+            } finally {
+                try {
+                    file.getInputStream().close();
+                } catch (IOException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+        return Result.OK("文件导入失败!");
     }
 
-
     /**
      * 分页列表查询(与我相关)
      *

+ 2 - 6
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/entity/InventoryCount.java

@@ -7,8 +7,6 @@ import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.experimental.Accessors;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
@@ -18,14 +16,12 @@ import java.util.Date;
 /**
  * @Description: 库存盘点
  * @Author: jeecg-boot
- * @Date: 2025-05-22
+ * @Date: 2025-05-23
  * @Version: V1.0
  */
+@ApiModel(value = "sbsmzq_inventory_count对象", description = "库存盘点")
 @Data
 @TableName("sbsmzq_inventory_count")
-@Accessors(chain = true)
-@EqualsAndHashCode(callSuper = false)
-@ApiModel(value = "sbsmzq_inventory_count对象", description = "库存盘点")
 public class InventoryCount implements Serializable {
     private static final long serialVersionUID = 1L;
 

+ 134 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/entity/InventoryInfo.java

@@ -0,0 +1,134 @@
+package org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 盘点信息
+ * @Author: jeecg-boot
+ * @Date: 2025-05-23
+ * @Version: V1.0
+ */
+@ApiModel(value = "sbsmzq_inventory_info对象", description = "盘点信息")
+@Data
+@TableName("sbsmzq_inventory_info")
+public class InventoryInfo implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建日期
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**
+     * 更新日期
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+    /**
+     * 所属部门
+     */
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+    /**
+     * 图片
+     */
+    @Excel(name = "图片", width = 15)
+    @ApiModelProperty(value = "图片")
+    private String imageUrl;
+    /**
+     * 备件编号
+     */
+    @Excel(name = "备件编号", width = 15)
+    @ApiModelProperty(value = "备件编号")
+    private String sparePartCode;
+    /**
+     * 备件名称
+     */
+    @Excel(name = "备件名称", width = 15)
+    @ApiModelProperty(value = "备件名称")
+    private String sparePartName;
+    /**
+     * 单位
+     */
+    @Excel(name = "单位", width = 15)
+    @ApiModelProperty(value = "单位")
+    private String unit;
+    /**
+     * 规格型号
+     */
+    @Excel(name = "规格型号", width = 15)
+    @ApiModelProperty(value = "规格型号")
+    private String spec;
+    /**
+     * 库位
+     */
+    @Excel(name = "库位", width = 15)
+    @ApiModelProperty(value = "库位")
+    private String location;
+    /**
+     * 库存数量
+     */
+    @Excel(name = "库存数量", width = 15)
+    @ApiModelProperty(value = "库存数量")
+    private Integer inventoryQuantity;
+    /**
+     * 盘存数
+     */
+    @Excel(name = "盘存数", width = 15)
+    @ApiModelProperty(value = "盘存数")
+    private Integer countedQuantity;
+    /**
+     * 盘点差异
+     */
+    @Excel(name = "盘点差异", width = 15)
+    @ApiModelProperty(value = "盘点差异")
+    private String inventoryDiff;
+    /**
+     * 处理单据号
+     */
+    @Excel(name = "处理单据号", width = 15)
+    @ApiModelProperty(value = "处理单据号")
+    private String processOrderNo;
+    /**
+     * 相关图片
+     */
+    @Excel(name = "相关图片", width = 15)
+    @ApiModelProperty(value = "相关图片")
+    private String relatedImage;
+    /**
+     * 盘点id
+     */
+    @ApiModelProperty(value = "盘点id")
+    private String countId;
+}

+ 2 - 2
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/mapper/InventoryCountMapper.java

@@ -1,12 +1,12 @@
 package org.jeecg.modules.sparePartsConsumables.inventoryManagement.mapper;
 
-import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryCount;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryCount;
 
 /**
  * @Description: 库存盘点
  * @Author: jeecg-boot
- * @Date:   2025-05-22
+ * @Date: 2025-05-23
  * @Version: V1.0
  */
 public interface InventoryCountMapper extends BaseMapper<InventoryCount> {

+ 31 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/mapper/InventoryInfoMapper.java

@@ -0,0 +1,31 @@
+package org.jeecg.modules.sparePartsConsumables.inventoryManagement.mapper;
+
+import java.util.List;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @Description: 盘点信息
+ * @Author: jeecg-boot
+ * @Date:   2025-05-23
+ * @Version: V1.0
+ */
+public interface InventoryInfoMapper extends BaseMapper<InventoryInfo> {
+
+	/**
+	 * 通过主表id删除子表数据
+	 *
+	 * @param mainId 主表id
+	 * @return boolean
+	 */
+	public boolean deleteByMainId(@Param("mainId") String mainId);
+
+  /**
+   * 通过主表id查询子表数据
+   *
+   * @param mainId 主表id
+   * @return List<InventoryInfo>
+   */
+	public List<InventoryInfo> selectByMainId(@Param("mainId") String mainId);
+}

+ 16 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/mapper/xml/InventoryInfoMapper.xml

@@ -0,0 +1,16 @@
+<?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="org.jeecg.modules.sparePartsConsumables.inventoryManagement.mapper.InventoryInfoMapper">
+
+	<delete id="deleteByMainId" parameterType="java.lang.String">
+		DELETE 
+		FROM  sbsmzq_inventory_info 
+		WHERE
+			 count_id = #{mainId} 	</delete>
+	
+	<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryInfo">
+		SELECT * 
+		FROM  sbsmzq_inventory_info
+		WHERE
+			 count_id = #{mainId} 	</select>
+</mapper>

+ 37 - 2
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/service/IInventoryCountService.java

@@ -1,14 +1,49 @@
 package org.jeecg.modules.sparePartsConsumables.inventoryManagement.service;
 
-import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryCount;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryCount;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryInfo;
+
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
 
 /**
  * @Description: 库存盘点
  * @Author: jeecg-boot
- * @Date:   2025-05-22
+ * @Date: 2025-05-23
  * @Version: V1.0
  */
 public interface IInventoryCountService extends IService<InventoryCount> {
 
+    /**
+     * 添加一对多
+     *
+     * @param inventoryCount
+     * @param inventoryInfoList
+     */
+    public void saveMain(InventoryCount inventoryCount, List<InventoryInfo> inventoryInfoList);
+
+    /**
+     * 修改一对多
+     *
+     * @param inventoryCount
+     * @param inventoryInfoList
+     */
+    public void updateMain(InventoryCount inventoryCount, List<InventoryInfo> inventoryInfoList);
+
+    /**
+     * 删除一对多
+     *
+     * @param id
+     */
+    public void delMain(String id);
+
+    /**
+     * 批量删除一对多
+     *
+     * @param idList
+     */
+    public void delBatchMain(Collection<? extends Serializable> idList);
+
 }

+ 23 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/service/IInventoryInfoService.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.sparePartsConsumables.inventoryManagement.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryInfo;
+
+import java.util.List;
+
+/**
+ * @Description: 盘点信息
+ * @Author: jeecg-boot
+ * @Date: 2025-05-23
+ * @Version: V1.0
+ */
+public interface IInventoryInfoService extends IService<InventoryInfo> {
+
+    /**
+     * 通过主表id查询子表数据
+     *
+     * @param mainId 主表id
+     * @return List<InventoryInfo>
+     */
+    public List<InventoryInfo> selectByMainId(String mainId);
+}

+ 61 - 2
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/service/impl/InventoryCountServiceImpl.java

@@ -1,19 +1,78 @@
 package org.jeecg.modules.sparePartsConsumables.inventoryManagement.service.impl;
 
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryCount;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryInfo;
 import org.jeecg.modules.sparePartsConsumables.inventoryManagement.mapper.InventoryCountMapper;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.mapper.InventoryInfoMapper;
 import org.jeecg.modules.sparePartsConsumables.inventoryManagement.service.IInventoryCountService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.List;
 
 /**
  * @Description: 库存盘点
  * @Author: jeecg-boot
- * @Date:   2025-05-22
+ * @Date: 2025-05-23
  * @Version: V1.0
  */
 @Service
 public class InventoryCountServiceImpl extends ServiceImpl<InventoryCountMapper, InventoryCount> implements IInventoryCountService {
 
+    @Autowired
+    private InventoryCountMapper inventoryCountMapper;
+    @Autowired
+    private InventoryInfoMapper inventoryInfoMapper;
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void saveMain(InventoryCount inventoryCount, List<InventoryInfo> inventoryInfoList) {
+        inventoryCountMapper.insert(inventoryCount);
+        if (inventoryInfoList != null && inventoryInfoList.size() > 0) {
+            for (InventoryInfo entity : inventoryInfoList) {
+                //外键设置
+                entity.setCountId(inventoryCount.getId());
+                inventoryInfoMapper.insert(entity);
+            }
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateMain(InventoryCount inventoryCount, List<InventoryInfo> inventoryInfoList) {
+        inventoryCountMapper.updateById(inventoryCount);
+
+        //1.先删除子表数据
+        inventoryInfoMapper.deleteByMainId(inventoryCount.getId());
+
+        //2.子表数据重新插入
+        if (inventoryInfoList != null && inventoryInfoList.size() > 0) {
+            for (InventoryInfo entity : inventoryInfoList) {
+                //外键设置
+                entity.setCountId(inventoryCount.getId());
+                inventoryInfoMapper.insert(entity);
+            }
+        }
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delMain(String id) {
+        inventoryInfoMapper.deleteByMainId(id);
+        inventoryCountMapper.deleteById(id);
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void delBatchMain(Collection<? extends Serializable> idList) {
+        for (Serializable id : idList) {
+            inventoryInfoMapper.deleteByMainId(id.toString());
+            inventoryCountMapper.deleteById(id);
+        }
+    }
+
 }

+ 27 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/service/impl/InventoryInfoServiceImpl.java

@@ -0,0 +1,27 @@
+package org.jeecg.modules.sparePartsConsumables.inventoryManagement.service.impl;
+
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryInfo;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.mapper.InventoryInfoMapper;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.service.IInventoryInfoService;
+import org.springframework.stereotype.Service;
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * @Description: 盘点信息
+ * @Author: jeecg-boot
+ * @Date:   2025-05-23
+ * @Version: V1.0
+ */
+@Service
+public class InventoryInfoServiceImpl extends ServiceImpl<InventoryInfoMapper, InventoryInfo> implements IInventoryInfoService {
+	
+	@Autowired
+	private InventoryInfoMapper inventoryInfoMapper;
+	
+	@Override
+	public List<InventoryInfo> selectByMainId(String mainId) {
+		return inventoryInfoMapper.selectByMainId(mainId);
+	}
+}

+ 165 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/sparePartsConsumables/inventoryManagement/vo/InventoryCountPage.java

@@ -0,0 +1,165 @@
+package org.jeecg.modules.sparePartsConsumables.inventoryManagement.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecg.modules.sparePartsConsumables.inventoryManagement.entity.InventoryInfo;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecgframework.poi.excel.annotation.ExcelCollection;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.List;
+
+/**
+ * @Description: 库存盘点
+ * @Author: jeecg-boot
+ * @Date: 2025-05-23
+ * @Version: V1.0
+ */
+@Data
+@ApiModel(value = "sbsmzq_inventory_countPage对象", description = "库存盘点")
+public class InventoryCountPage {
+
+    /**
+     * id
+     */
+    @ApiModelProperty(value = "id")
+    private java.lang.String id;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+    /**
+     * 创建日期
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private java.util.Date createTime;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+    /**
+     * 更新日期
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private java.util.Date updateTime;
+    /**
+     * 所属部门
+     */
+    @ApiModelProperty(value = "所属部门")
+    private java.lang.String sysOrgCode;
+    /**
+     * 盘点单号
+     */
+    @Excel(name = "盘点单号", width = 15)
+    @ApiModelProperty(value = "盘点单号")
+    private java.lang.String inventoryNumber;
+    /**
+     * 计划盘点开始时间
+     */
+    @Excel(name = "计划盘点开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "计划盘点开始时间")
+    private java.util.Date checkStartTime;
+    /**
+     * 计划盘点结束时间
+     */
+    @Excel(name = "计划盘点结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "计划盘点结束时间")
+    private java.util.Date checkEndTime;
+    /**
+     * 备注
+     */
+    @Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private java.lang.String remark;
+    /**
+     * 盘点仓库
+     */
+    @Excel(name = "盘点仓库", width = 15)
+    @ApiModelProperty(value = "盘点仓库")
+    private java.lang.String checkWarehouse;
+    /**
+     * 负责人
+     */
+    @Excel(name = "负责人", width = 15)
+    @ApiModelProperty(value = "负责人")
+    private java.lang.String director;
+    /**
+     * 库存数量
+     */
+    @Excel(name = "库存数量", width = 15)
+    @ApiModelProperty(value = "库存数量")
+    private java.lang.Integer inventoryQuantity;
+    /**
+     * 状态
+     */
+    @Excel(name = "状态", width = 15)
+    @ApiModelProperty(value = "状态")
+    private java.lang.Integer status;
+    /**
+     * 应盘项
+     */
+    @Excel(name = "应盘项", width = 15)
+    @ApiModelProperty(value = "应盘项")
+    private java.lang.Integer planCount;
+    /**
+     * 已盘项
+     */
+    @Excel(name = "已盘项", width = 15)
+    @ApiModelProperty(value = "已盘项")
+    private java.lang.Integer actualCount;
+    /**
+     * 盘盈项
+     */
+    @Excel(name = "盘盈项", width = 15)
+    @ApiModelProperty(value = "盘盈项")
+    private java.lang.Integer inventoryGain;
+    /**
+     * 盘亏项
+     */
+    @Excel(name = "盘亏项", width = 15)
+    @ApiModelProperty(value = "盘亏项")
+    private java.lang.Integer inventoryLoss;
+    /**
+     * 当前节点
+     */
+    @Excel(name = "当前节点", width = 15)
+    @ApiModelProperty(value = "当前节点")
+    private java.lang.String currentNode;
+    /**
+     * 审批状态
+     */
+    @Excel(name = "审批状态", width = 15)
+    @ApiModelProperty(value = "审批状态")
+    private java.lang.Integer approvalStatus;
+    /**
+     * 审批结束时间
+     */
+    @Excel(name = "审批结束时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "审批结束时间")
+    private java.util.Date approvalEndTime;
+    /**
+     * 库位
+     */
+    @Excel(name = "库位", width = 15)
+    @ApiModelProperty(value = "库位")
+    private java.lang.String location;
+
+    @ExcelCollection(name = "盘点信息")
+    @ApiModelProperty(value = "盘点信息")
+    private List<InventoryInfo> inventoryInfoList;
+
+}

+ 162 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/controller/BurstDiscReplaceRecordController.java

@@ -0,0 +1,162 @@
+package org.jeecg.modules.specialEquipment.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.specialEquipment.entity.BurstDiscReplaceRecord;
+import org.jeecg.modules.specialEquipment.service.IBurstDiscReplaceRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+
+/**
+ * @Description: 爆破片更换记录
+ * @Author: jeecg-boot
+ * @Date: 2025-05-23
+ * @Version: V1.0
+ */
+@Api(tags = "爆破片更换记录")
+@RestController
+@RequestMapping("/specialEquipment/burstDiscReplaceRecord")
+@Slf4j
+public class BurstDiscReplaceRecordController extends JeecgController<BurstDiscReplaceRecord, IBurstDiscReplaceRecordService> {
+    @Autowired
+    private IBurstDiscReplaceRecordService burstDiscReplaceRecordService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param burstDiscReplaceRecord
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    //@AutoLog(value = "爆破片更换记录-分页列表查询")
+    @ApiOperation(value = "爆破片更换记录-分页列表查询", notes = "爆破片更换记录-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<BurstDiscReplaceRecord>> queryPageList(BurstDiscReplaceRecord burstDiscReplaceRecord,
+                                                               @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                               @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                               HttpServletRequest req) {
+        QueryWrapper<BurstDiscReplaceRecord> queryWrapper = QueryGenerator.initQueryWrapper(burstDiscReplaceRecord, req.getParameterMap());
+        Page<BurstDiscReplaceRecord> page = new Page<BurstDiscReplaceRecord>(pageNo, pageSize);
+        IPage<BurstDiscReplaceRecord> pageList = burstDiscReplaceRecordService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param burstDiscReplaceRecord
+     * @return
+     */
+    @AutoLog(value = "爆破片更换记录-添加")
+    @ApiOperation(value = "爆破片更换记录-添加", notes = "爆破片更换记录-添加")
+    @RequiresPermissions("specialEquipment:sbsmzq_burst_disc_replace_record:add")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody BurstDiscReplaceRecord burstDiscReplaceRecord) {
+        burstDiscReplaceRecordService.save(burstDiscReplaceRecord);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param burstDiscReplaceRecord
+     * @return
+     */
+    @AutoLog(value = "爆破片更换记录-编辑")
+    @ApiOperation(value = "爆破片更换记录-编辑", notes = "爆破片更换记录-编辑")
+    @RequiresPermissions("specialEquipment:sbsmzq_burst_disc_replace_record:edit")
+    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody BurstDiscReplaceRecord burstDiscReplaceRecord) {
+        burstDiscReplaceRecordService.updateById(burstDiscReplaceRecord);
+        return Result.OK("编辑成功!");
+    }
+
+    /**
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "爆破片更换记录-通过id删除")
+    @ApiOperation(value = "爆破片更换记录-通过id删除", notes = "爆破片更换记录-通过id删除")
+    @RequiresPermissions("specialEquipment:sbsmzq_burst_disc_replace_record:delete")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        burstDiscReplaceRecordService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "爆破片更换记录-批量删除")
+    @ApiOperation(value = "爆破片更换记录-批量删除", notes = "爆破片更换记录-批量删除")
+    @RequiresPermissions("specialEquipment:sbsmzq_burst_disc_replace_record:deleteBatch")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.burstDiscReplaceRecordService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    //@AutoLog(value = "爆破片更换记录-通过id查询")
+    @ApiOperation(value = "爆破片更换记录-通过id查询", notes = "爆破片更换记录-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<BurstDiscReplaceRecord> queryById(@RequestParam(name = "id", required = true) String id) {
+        BurstDiscReplaceRecord burstDiscReplaceRecord = burstDiscReplaceRecordService.getById(id);
+        if (burstDiscReplaceRecord == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(burstDiscReplaceRecord);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param burstDiscReplaceRecord
+     */
+    @RequiresPermissions("specialEquipment:sbsmzq_burst_disc_replace_record:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, BurstDiscReplaceRecord burstDiscReplaceRecord) {
+        return super.exportXls(request, burstDiscReplaceRecord, BurstDiscReplaceRecord.class, "爆破片更换记录");
+    }
+
+    /**
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
+    @RequiresPermissions("specialEquipment:sbsmzq_burst_disc_replace_record:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, BurstDiscReplaceRecord.class);
+    }
+
+}

+ 140 - 127
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/controller/SpecialDeviceController.java

@@ -1,146 +1,146 @@
 package org.jeecg.modules.specialEquipment.controller;
 
-import java.util.Arrays;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.jeecg.common.api.vo.Result;
-import org.jeecg.common.system.query.QueryGenerator;
-import org.jeecg.modules.specialEquipment.entity.SpecialDevice;
-import org.jeecg.modules.specialEquipment.service.ISpecialDeviceService;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
-
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.specialEquipment.entity.SpecialDevice;
+import org.jeecg.modules.specialEquipment.service.ISpecialDeviceService;
+import org.jeecg.modules.specialEquipment.vo.NumberCountsVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.jeecg.common.aspect.annotation.AutoLog;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 
- /**
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+
+/**
  * @Description: 特种设备
  * @Author: jeecg-boot
- * @Date:   2025-05-16
+ * @Date: 2025-05-16
  * @Version: V1.0
  */
-@Api(tags="特种设备")
+@Api(tags = "特种设备")
 @RestController
 @RequestMapping("/specialEquipment/specialDevice")
 @Slf4j
 public class SpecialDeviceController extends JeecgController<SpecialDevice, ISpecialDeviceService> {
-	@Autowired
-	private ISpecialDeviceService specialDeviceService;
-	
-	/**
-	 * 分页列表查询
-	 *
-	 * @param specialDevice
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
-	 * @return
-	 */
-	//@AutoLog(value = "特种设备-分页列表查询")
-	@ApiOperation(value="特种设备-分页列表查询", notes="特种设备-分页列表查询")
-	@GetMapping(value = "/list")
-	public Result<IPage<SpecialDevice>> queryPageList(SpecialDevice specialDevice,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
+    @Autowired
+    private ISpecialDeviceService specialDeviceService;
+
+    /**
+     * 分页列表查询
+     *
+     * @param specialDevice
+     * @param pageNo
+     * @param pageSize
+     * @param req
+     * @return
+     */
+    //@AutoLog(value = "特种设备-分页列表查询")
+    @ApiOperation(value = "特种设备-分页列表查询", notes = "特种设备-分页列表查询")
+    @GetMapping(value = "/list")
+    public Result<IPage<SpecialDevice>> queryPageList(SpecialDevice specialDevice,
+                                                      @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+                                                      @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+                                                      HttpServletRequest req) {
         QueryWrapper<SpecialDevice> queryWrapper = QueryGenerator.initQueryWrapper(specialDevice, req.getParameterMap());
-		Page<SpecialDevice> page = new Page<SpecialDevice>(pageNo, pageSize);
-		IPage<SpecialDevice> pageList = specialDeviceService.page(page, queryWrapper);
-		return Result.OK(pageList);
-	}
-	
-	/**
-	 *   添加
-	 *
-	 * @param specialDevice
-	 * @return
-	 */
-	@AutoLog(value = "特种设备-添加")
-	@ApiOperation(value="特种设备-添加", notes="特种设备-添加")
-	@RequiresPermissions("specialEquipment:sbsmzq_special_device:add")
-	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody SpecialDevice specialDevice) {
-		specialDeviceService.save(specialDevice);
-		return Result.OK("添加成功!");
-	}
-	
-	/**
-	 *  编辑
-	 *
-	 * @param specialDevice
-	 * @return
-	 */
-	@AutoLog(value = "特种设备-编辑")
-	@ApiOperation(value="特种设备-编辑", notes="特种设备-编辑")
-	@RequiresPermissions("specialEquipment:sbsmzq_special_device:edit")
-	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody SpecialDevice specialDevice) {
-		specialDeviceService.updateById(specialDevice);
-		return Result.OK("编辑成功!");
-	}
-	
-	/**
-	 *   通过id删除
-	 *
-	 * @param id
-	 * @return
-	 */
-	@AutoLog(value = "特种设备-通过id删除")
-	@ApiOperation(value="特种设备-通过id删除", notes="特种设备-通过id删除")
-	@RequiresPermissions("specialEquipment:sbsmzq_special_device:delete")
-	@DeleteMapping(value = "/delete")
-	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
-		specialDeviceService.removeById(id);
-		return Result.OK("删除成功!");
-	}
-	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "特种设备-批量删除")
-	@ApiOperation(value="特种设备-批量删除", notes="特种设备-批量删除")
-	@RequiresPermissions("specialEquipment:sbsmzq_special_device:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.specialDeviceService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
-	/**
-	 * 通过id查询
-	 *
-	 * @param id
-	 * @return
-	 */
-	//@AutoLog(value = "特种设备-通过id查询")
-	@ApiOperation(value="特种设备-通过id查询", notes="特种设备-通过id查询")
-	@GetMapping(value = "/queryById")
-	public Result<SpecialDevice> queryById(@RequestParam(name="id",required=true) String id) {
-		SpecialDevice specialDevice = specialDeviceService.getById(id);
-		if(specialDevice==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(specialDevice);
-	}
+        Page<SpecialDevice> page = new Page<SpecialDevice>(pageNo, pageSize);
+        IPage<SpecialDevice> pageList = specialDeviceService.page(page, queryWrapper);
+        return Result.OK(pageList);
+    }
+
+    /**
+     * 添加
+     *
+     * @param specialDevice
+     * @return
+     */
+    @AutoLog(value = "特种设备-添加")
+    @ApiOperation(value = "特种设备-添加", notes = "特种设备-添加")
+    @RequiresPermissions("specialEquipment:sbsmzq_special_device:add")
+    @PostMapping(value = "/add")
+    public Result<String> add(@RequestBody SpecialDevice specialDevice) {
+        specialDeviceService.save(specialDevice);
+        return Result.OK("添加成功!");
+    }
+
+    /**
+     * 编辑
+     *
+     * @param specialDevice
+     * @return
+     */
+    @AutoLog(value = "特种设备-编辑")
+    @ApiOperation(value = "特种设备-编辑", notes = "特种设备-编辑")
+    @RequiresPermissions("specialEquipment:sbsmzq_special_device:edit")
+    @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
+    public Result<String> edit(@RequestBody SpecialDevice specialDevice) {
+        specialDeviceService.updateById(specialDevice);
+        return Result.OK("编辑成功!");
+    }
 
     /**
-    * 导出excel
-    *
-    * @param request
-    * @param specialDevice
-    */
+     * 通过id删除
+     *
+     * @param id
+     * @return
+     */
+    @AutoLog(value = "特种设备-通过id删除")
+    @ApiOperation(value = "特种设备-通过id删除", notes = "特种设备-通过id删除")
+    @RequiresPermissions("specialEquipment:sbsmzq_special_device:delete")
+    @DeleteMapping(value = "/delete")
+    public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
+        specialDeviceService.removeById(id);
+        return Result.OK("删除成功!");
+    }
+
+    /**
+     * 批量删除
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "特种设备-批量删除")
+    @ApiOperation(value = "特种设备-批量删除", notes = "特种设备-批量删除")
+    @RequiresPermissions("specialEquipment:sbsmzq_special_device:deleteBatch")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+        this.specialDeviceService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
+
+    /**
+     * 通过id查询
+     *
+     * @param id
+     * @return
+     */
+    //@AutoLog(value = "特种设备-通过id查询")
+    @ApiOperation(value = "特种设备-通过id查询", notes = "特种设备-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result<SpecialDevice> queryById(@RequestParam(name = "id", required = true) String id) {
+        SpecialDevice specialDevice = specialDeviceService.getById(id);
+        if (specialDevice == null) {
+            return Result.error("未找到对应数据");
+        }
+        return Result.OK(specialDevice);
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param specialDevice
+     */
     @RequiresPermissions("specialEquipment:sbsmzq_special_device:exportXls")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, SpecialDevice specialDevice) {
@@ -148,16 +148,29 @@ public class SpecialDeviceController extends JeecgController<SpecialDevice, ISpe
     }
 
     /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
+     * 通过excel导入数据
+     *
+     * @param request
+     * @param response
+     * @return
+     */
     @RequiresPermissions("specialEquipment:sbsmzq_special_device:importExcel")
     @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
     public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
         return super.importExcel(request, response, SpecialDevice.class);
     }
 
+    /**
+     * 根据时间统计特种设备数量
+     *
+     * @param nextCheckTime
+     * @return
+     */
+    @ApiOperation(value = "根据时间统计特种设备数量", notes = "根据时间统计特种设备数量")
+    @GetMapping(value = "/numberCounts")
+    public Result<NumberCountsVO> numberCounts(@RequestParam(name = "nextCheckTime") String nextCheckTime) {
+        NumberCountsVO numberCountsVO = specialDeviceService.numberCounts(nextCheckTime);
+        return Result.OK(numberCountsVO);
+    }
+
 }

+ 131 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/entity/BurstDiscReplaceRecord.java

@@ -0,0 +1,131 @@
+package org.jeecg.modules.specialEquipment.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @Description: 爆破片更换记录
+ * @Author: jeecg-boot
+ * @Date: 2025-05-23
+ * @Version: V1.0
+ */
+@Data
+@TableName("sbsmzq_burst_disc_replace_record")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value = "sbsmzq_burst_disc_replace_record对象", description = "爆破片更换记录")
+public class BurstDiscReplaceRecord implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+    /**
+     * 创建人
+     */
+    @ApiModelProperty(value = "创建人")
+    private String createBy;
+    /**
+     * 创建日期
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private Date createTime;
+    /**
+     * 更新人
+     */
+    @ApiModelProperty(value = "更新人")
+    private String updateBy;
+    /**
+     * 更新日期
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private Date updateTime;
+    /**
+     * 所属部门
+     */
+    @ApiModelProperty(value = "所属部门")
+    private String sysOrgCode;
+    /**
+     * 编号
+     */
+    @Excel(name = "编号", width = 15)
+    @ApiModelProperty(value = "编号")
+    private String code;
+    /**
+     * 设备编号
+     */
+    @Excel(name = "设备编号", width = 15)
+    @ApiModelProperty(value = "设备编号")
+    private String deviceCode;
+    /**
+     * 设备名称
+     */
+    @Excel(name = "设备名称", width = 15)
+    @ApiModelProperty(value = "设备名称")
+    private String deviceName;
+    /**
+     * 规格型号
+     */
+    @Excel(name = "规格型号", width = 15)
+    @ApiModelProperty(value = "规格型号")
+    private String spec;
+    /**
+     * 出厂编号
+     */
+    @Excel(name = "出厂编号", width = 15)
+    @ApiModelProperty(value = "出厂编号")
+    private String factoryCode;
+    /**
+     * 更换时间
+     */
+    @Excel(name = "更换时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更换时间")
+    private Date replaceTime;
+    /**
+     * 下次更换时间
+     */
+    @Excel(name = "下次更换时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "下次更换时间")
+    private Date nextReplaceTime;
+    /**
+     * 序列号
+     */
+    @Excel(name = "序列号", width = 15)
+    @ApiModelProperty(value = "序列号")
+    private String serialNumber;
+    /**
+     * 备注
+     */
+    @Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private String remark;
+    /**
+     * 设备id
+     */
+    @Excel(name = "设备id", width = 15)
+    @ApiModelProperty(value = "设备id")
+    private String deviceId;
+}

+ 60 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/enums/DiscardRangeEnum.java

@@ -0,0 +1,60 @@
+package org.jeecg.modules.specialEquipment.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
+import java.util.Date;
+
+@Getter
+@AllArgsConstructor
+public enum DiscardRangeEnum {
+
+    DAY1(1),
+    DAY3(3),
+    DAY7(7),
+    DAY15(15),
+    MONTH1(30),
+    MONTH3(90),
+    WITHIN_NEXT_MONTH(null),
+    CURRENT_YEAR(null),
+    NEXT_YEAR(null);
+
+    private final Integer days;
+
+    /**
+     * 判断 expectedDiscardDate 是否符合该范围
+     */
+    public boolean match(Date expectedDiscardDate, LocalDate now) {
+        if (expectedDiscardDate == null) {
+            return false;
+        }
+
+        // 将 java.util.Date 转换为 LocalDate
+        LocalDate discardDate = expectedDiscardDate.toInstant()
+                .atZone(ZoneId.systemDefault())
+                .toLocalDate();
+
+        switch (this) {
+            case WITHIN_NEXT_MONTH:
+                LocalDate start = now.withDayOfMonth(1).plusMonths(1);
+                LocalDate end = start.withDayOfMonth(start.lengthOfMonth());
+                return !discardDate.isBefore(start) && !discardDate.isAfter(end);
+
+            case CURRENT_YEAR:
+                LocalDate endOfYear = LocalDate.of(now.getYear(), 12, 31);
+                return !discardDate.isBefore(now) && !discardDate.isAfter(endOfYear);
+
+            case NEXT_YEAR:
+                LocalDate startNextYear = LocalDate.of(now.getYear() + 1, 1, 1);
+                LocalDate endNextYear = LocalDate.of(now.getYear() + 1, 12, 31);
+                return !discardDate.isBefore(startNextYear) && !discardDate.isAfter(endNextYear);
+
+            default:
+                long daysDiff = ChronoUnit.DAYS.between(now, discardDate);
+                return daysDiff >= 0 && daysDiff <= this.days;
+        }
+    }
+}

+ 14 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/mapper/BurstDiscReplaceRecordMapper.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.specialEquipment.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.specialEquipment.entity.BurstDiscReplaceRecord;
+
+/**
+ * @Description: 爆破片更换记录
+ * @Author: jeecg-boot
+ * @Date:   2025-05-23
+ * @Version: V1.0
+ */
+public interface BurstDiscReplaceRecordMapper extends BaseMapper<BurstDiscReplaceRecord> {
+
+}

+ 4 - 2
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/mapper/SpecialDeviceMapper.java

@@ -1,14 +1,16 @@
 package org.jeecg.modules.specialEquipment.mapper;
 
-import org.jeecg.modules.specialEquipment.entity.SpecialDevice;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+import org.jeecg.modules.specialEquipment.entity.SpecialDevice;
 
 /**
  * @Description: 特种设备
  * @Author: jeecg-boot
- * @Date:   2025-05-16
+ * @Date: 2025-05-16
  * @Version: V1.0
  */
+@Mapper
 public interface SpecialDeviceMapper extends BaseMapper<SpecialDevice> {
 
 }

+ 5 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/mapper/xml/BurstDiscReplaceRecordMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.specialEquipment.mapper.BurstDiscReplaceRecordMapper">
+
+</mapper>

+ 14 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/service/IBurstDiscReplaceRecordService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.specialEquipment.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.specialEquipment.entity.BurstDiscReplaceRecord;
+
+/**
+ * @Description: 爆破片更换记录
+ * @Author: jeecg-boot
+ * @Date: 2025-05-23
+ * @Version: V1.0
+ */
+public interface IBurstDiscReplaceRecordService extends IService<BurstDiscReplaceRecord> {
+
+}

+ 5 - 2
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/service/ISpecialDeviceService.java

@@ -1,14 +1,17 @@
 package org.jeecg.modules.specialEquipment.service;
 
-import org.jeecg.modules.specialEquipment.entity.SpecialDevice;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.specialEquipment.entity.SpecialDevice;
+import org.jeecg.modules.specialEquipment.vo.NumberCountsVO;
 
 /**
  * @Description: 特种设备
  * @Author: jeecg-boot
- * @Date:   2025-05-16
+ * @Date: 2025-05-16
  * @Version: V1.0
  */
 public interface ISpecialDeviceService extends IService<SpecialDevice> {
 
+    NumberCountsVO numberCounts(String nextCheckTime);
+
 }

+ 19 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/service/impl/BurstDiscReplaceRecordServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.specialEquipment.service.impl;
+
+import org.jeecg.modules.specialEquipment.entity.BurstDiscReplaceRecord;
+import org.jeecg.modules.specialEquipment.mapper.BurstDiscReplaceRecordMapper;
+import org.jeecg.modules.specialEquipment.service.IBurstDiscReplaceRecordService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 爆破片更换记录
+ * @Author: jeecg-boot
+ * @Date:   2025-05-23
+ * @Version: V1.0
+ */
+@Service
+public class BurstDiscReplaceRecordServiceImpl extends ServiceImpl<BurstDiscReplaceRecordMapper, BurstDiscReplaceRecord> implements IBurstDiscReplaceRecordService {
+
+}

+ 60 - 2
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/service/impl/SpecialDeviceServiceImpl.java

@@ -1,19 +1,77 @@
 package org.jeecg.modules.specialEquipment.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.jeecg.modules.specialEquipment.entity.SpecialDevice;
+import org.jeecg.modules.specialEquipment.enums.DiscardRangeEnum;
 import org.jeecg.modules.specialEquipment.mapper.SpecialDeviceMapper;
 import org.jeecg.modules.specialEquipment.service.ISpecialDeviceService;
+import org.jeecg.modules.specialEquipment.vo.NumberCountsVO;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import java.time.LocalDate;
+import java.time.ZoneId;
+import java.util.Date;
+import java.util.List;
 
 /**
  * @Description: 特种设备
  * @Author: jeecg-boot
- * @Date:   2025-05-16
+ * @Date: 2025-05-16
  * @Version: V1.0
  */
 @Service
 public class SpecialDeviceServiceImpl extends ServiceImpl<SpecialDeviceMapper, SpecialDevice> implements ISpecialDeviceService {
 
+    @Autowired
+    private SpecialDeviceMapper specialDeviceMapper;
+
+    @Override
+    public NumberCountsVO numberCounts(String nextCheckTime) {
+
+        List<SpecialDevice> allSpecialDeviceList = specialDeviceMapper.selectList(new QueryWrapper<SpecialDevice>());
+
+        LocalDate today = LocalDate.now();
+
+        Integer totalCount = allSpecialDeviceList.size();
+
+        long overdueCount = allSpecialDeviceList.stream()
+                .filter(device -> {
+                    Date expectedDate = device.getExpectedDiscardDate();
+                    if (expectedDate == null) {
+                        return false;
+                    }
+                    LocalDate discardDate = expectedDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
+                    return today.isAfter(discardDate);
+                })
+                .count();
+
+        NumberCountsVO vo = new NumberCountsVO();
+        vo.setTotalCount(totalCount);
+        vo.setOutOfDateCount(Math.toIntExact(overdueCount));
+
+        Integer counts = countByRange(allSpecialDeviceList, nextCheckTime);
+        vo.setNextCheckTimeCount(counts);
+
+        return vo;
+    }
+
+    public Integer countByRange(List<SpecialDevice> specialDeviceList, String rangeKey) {
+        DiscardRangeEnum range;
+        try {
+            range = DiscardRangeEnum.valueOf(rangeKey);
+        } catch (IllegalArgumentException e) {
+            // 前端传的值非法
+            return 0;
+        }
+
+        LocalDate today = LocalDate.now();
+
+        long count = specialDeviceList.stream()
+                .filter(dev -> range.match(dev.getExpectedDiscardDate(), today))
+                .count();
+
+        return Math.toIntExact(count);
+    }
 }

+ 24 - 0
zgzt-sbsmzq/jeecg-module-lifecycle/src/main/java/org/jeecg/modules/specialEquipment/vo/NumberCountsVO.java

@@ -0,0 +1,24 @@
+package org.jeecg.modules.specialEquipment.vo;
+
+import lombok.Data;
+
+@Data
+public class NumberCountsVO {
+
+    /**
+     * 传递时间内过期数量
+     */
+    private Integer nextCheckTimeCount;
+
+    /**
+     * 特种设备过期未检定数量
+     */
+    private Integer outOfDateCount;
+
+    /**
+     * 特种设备总数量
+     */
+    private Integer totalCount;
+
+
+}