“djh”
2025-03-05 06af2ffa26ed44bb2a8a60c0618f8d0490fdd6ed
用量统计页面及导出 修改
已修改4个文件
32 ■■■■ 文件已修改
hazmat-admin/src/main/java/com/gkhy/hazmat/admin/controller/web/HzStatisticController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzSecientificServiceImpl.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzStatisticServiceImpl.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hazmat-admin/src/main/java/com/gkhy/hazmat/admin/controller/web/HzStatisticController.java
@@ -1,6 +1,7 @@
package com.gkhy.hazmat.admin.controller.web;
import com.gkhy.hazmat.common.annotation.Anonymous;
import com.gkhy.hazmat.common.api.CommonResult;
import com.gkhy.hazmat.system.service.HzStatisticService;
import io.swagger.annotations.Api;
@@ -9,6 +10,7 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -70,8 +72,6 @@
    @ApiOperation(value = "危化品使用记录导出")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
            @ApiImplicitParam(paramType = "query", name = "startTime", dataType = "string", required = false, value = "开始时间,格式xxxx-xx-xx 00:00:00"),
            @ApiImplicitParam(paramType = "query", name = "endTime", dataType = "string", required = false, value = "结束时间,格式xxxx-xx-xx 23:59:59")
    })
hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzHazmatServiceImpl.java
@@ -195,6 +195,7 @@
        HzWarehouseRecord warehouseRecord = new HzWarehouseRecord()
                .setWarehouseId(hazmat.getWarehouseId())
                .setBasicId(hazmat.getBasicId())
                .setCupboardId(hazmat.getCupboardId())
                .setCreateId(currentUser.getId())
                .setNum(-1)
                .setState(OperateStatusEnum.USING.getCode())
@@ -249,6 +250,7 @@
        HzWarehouseRecord warehouseRecord = new HzWarehouseRecord()
                .setWarehouseId(dbhazmat.getWarehouseId())
                .setBasicId(dbhazmat.getBasicId())
                .setCupboardId(hazmat.getCupboardId())
                .setCreateId(currentUser.getId())
                .setNum(1)
                .setState(OperateStatusEnum.RETURN.getCode())
@@ -318,6 +320,7 @@
        HzWarehouseRecord warehouseRecord = new HzWarehouseRecord()
                .setWarehouseId(hazmat.getWarehouseId())
                .setBasicId(hazmat.getBasicId())
                .setCupboardId(hazmat.getCupboardId())
                .setCreateId(currentUser.getId())
                .setNum(-1)
                .setState(OperateStatusEnum.DISCARD.getCode())
hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzSecientificServiceImpl.java
@@ -113,16 +113,16 @@
    private void checkData(SecientificExcelData secientificExcelDatum) {
        if(StringUtils.isBlank(secientificExcelDatum.getSecientificName())){
            throw new ApiException("序号"+secientificExcelDatum.getIndex()+"品名为空");
            throw new ApiException("序号"+secientificExcelDatum.getIndex()+"品名为空"+"危险性类别:"+secientificExcelDatum.getRiskType());
        }
        if(StringUtils.isBlank(secientificExcelDatum.getCas())){
            throw new ApiException("序号"+secientificExcelDatum.getIndex()+"CAS码为空");
        }
        if(StringUtils.isBlank(secientificExcelDatum.getRiskType())){
            throw new ApiException("序号"+secientificExcelDatum.getIndex()+"危险性类别为空");
        }
        if(secientificExcelDatum.getPeculiarityNumber() == null){
            throw new ApiException("序号"+secientificExcelDatum.getIndex()+"危化品特性编码为空");
        }
//        if(StringUtils.isBlank(secientificExcelDatum.getCas())){
//            throw new ApiException("序号"+secientificExcelDatum.getIndex()+"CAS码为空");
//        }
//        if(StringUtils.isBlank(secientificExcelDatum.getRiskType())){
//            throw new ApiException("序号"+secientificExcelDatum.getIndex()+"危险性类别为空");
//        }
//        if(secientificExcelDatum.getPeculiarityNumber() == null){
//            throw new ApiException("序号"+secientificExcelDatum.getIndex()+"危化品特性编码为空");
//        }
    }
}
hazmat-system/src/main/java/com/gkhy/hazmat/system/service/impl/HzStatisticServiceImpl.java
@@ -248,7 +248,7 @@
            }
            //设置分表id
            IdTableNameHandler.setCurrentId(currentUser.getCompanyId());
            PageUtils.startPage();
//            PageUtils.startPage();
            List<HzHazmatUseVO> hazmatUseVOList= hazmatMapper.useCountStatic(startDate, endDate,currentUser.getCompanyId());
            IdTableNameHandler.removeCurrentId();
            List<HazmatBasicUseExcelData> hazmatBasicUseExcelDatas = new ArrayList<>();
@@ -286,9 +286,6 @@
        } catch (IOException e) {
            throw new RuntimeException(e);
        }finally {
            outputStream.flush();
            outputStream.close();
        }