main #1

Merged
root merged 5 commits from main into dev 2025-10-13 18:20:56 +08:00
35 changed files with 3169 additions and 0 deletions
Showing only changes of commit 8f1532e976 - Show all commits

View File

@ -67,6 +67,12 @@ public interface SpringSecurityConstant {
"/captcha/**",
"/getCaptchaOpen",
//大屏的
"/scrProduction/driQuery",
"/scrSecurity/driQuery",
"/scrProduction/driQhQuery",
"/scrProduction/driMaterQuery"
};
}

View File

@ -0,0 +1,148 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrfactoryheat.controller;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.scrfactoryheat.param.ScrFactoryHeatParam;
import vip.xiaonuo.modular.scrfactoryheat.service.ScrFactoryHeatService;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.List;
/**
* 分厂炉号对应关系控制器
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@RestController
public class ScrFactoryHeatController {
@Resource
private ScrFactoryHeatService scrFactoryHeatService;
/**
* 查询分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@Permission
@GetMapping("/scrFactoryHeat/page")
@BusinessLog(title = "分厂炉号对应关系_查询", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData page(ScrFactoryHeatParam scrFactoryHeatParam) {
return new SuccessResponseData(scrFactoryHeatService.page(scrFactoryHeatParam));
}
/**
* 添加分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@Permission
@PostMapping("/scrFactoryHeat/add")
@BusinessLog(title = "分厂炉号对应关系_增加", opType = LogAnnotionOpTypeEnum.ADD)
public ResponseData add(@RequestBody @Validated(ScrFactoryHeatParam.add.class) ScrFactoryHeatParam scrFactoryHeatParam) {
scrFactoryHeatService.add(scrFactoryHeatParam);
return new SuccessResponseData();
}
/**
* 删除分厂炉号对应关系可批量删除
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@Permission
@PostMapping("/scrFactoryHeat/delete")
@BusinessLog(title = "分厂炉号对应关系_删除", opType = LogAnnotionOpTypeEnum.DELETE)
public ResponseData delete(@RequestBody @Validated(ScrFactoryHeatParam.delete.class) List<ScrFactoryHeatParam> scrFactoryHeatParamList) {
scrFactoryHeatService.delete(scrFactoryHeatParamList);
return new SuccessResponseData();
}
/**
* 编辑分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@Permission
@PostMapping("/scrFactoryHeat/edit")
@BusinessLog(title = "分厂炉号对应关系_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
public ResponseData edit(@RequestBody @Validated(ScrFactoryHeatParam.edit.class) ScrFactoryHeatParam scrFactoryHeatParam) {
scrFactoryHeatService.edit(scrFactoryHeatParam);
return new SuccessResponseData();
}
/**
* 查看分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@Permission
@GetMapping("/scrFactoryHeat/detail")
@BusinessLog(title = "分厂炉号对应关系_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
public ResponseData detail(@Validated(ScrFactoryHeatParam.detail.class) ScrFactoryHeatParam scrFactoryHeatParam) {
return new SuccessResponseData(scrFactoryHeatService.detail(scrFactoryHeatParam));
}
/**
* 分厂炉号对应关系列表
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@Permission
@GetMapping("/scrFactoryHeat/list")
@BusinessLog(title = "分厂炉号对应关系_列表", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData list(ScrFactoryHeatParam scrFactoryHeatParam) {
return new SuccessResponseData(scrFactoryHeatService.list(scrFactoryHeatParam));
}
/**
* 导出系统用户
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@Permission
@GetMapping("/scrFactoryHeat/export")
@BusinessLog(title = "分厂炉号对应关系_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
public void export(ScrFactoryHeatParam scrFactoryHeatParam) {
scrFactoryHeatService.export(scrFactoryHeatParam);
}
}

View File

@ -0,0 +1,63 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrfactoryheat.entity;
import com.baomidou.mybatisplus.annotation.*;
import vip.xiaonuo.core.pojo.base.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.*;
import cn.afterturn.easypoi.excel.annotation.Excel;
/**
* 分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("scr_factory_heat")
public class ScrFactoryHeat extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 分厂
*/
@Excel(name = "分厂")
private String branchPlant;
/**
* 炉号
*/
@Excel(name = "炉号")
private String furnaceNumber;
}

View File

@ -0,0 +1,64 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrfactoryheat.enums;
import vip.xiaonuo.core.annotion.ExpEnumType;
import vip.xiaonuo.core.exception.enums.abs.AbstractBaseExceptionEnum;
import vip.xiaonuo.core.factory.ExpEnumCodeFactory;
import vip.xiaonuo.sys.core.consts.SysExpEnumConstant;
/**
* 分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@ExpEnumType(module = SysExpEnumConstant.SNOWY_SYS_MODULE_EXP_CODE)
public enum ScrFactoryHeatExceptionEnum implements AbstractBaseExceptionEnum {
/**
* 数据不存在
*/
NOT_EXIST(1, "此数据不存在");
private final Integer code;
private final String message;
ScrFactoryHeatExceptionEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
@Override
public Integer getCode() {
return ExpEnumCodeFactory.getExpEnumCode(this.getClass(), code);
}
@Override
public String getMessage() {
return message;
}
}

View File

@ -0,0 +1,37 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrfactoryheat.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import vip.xiaonuo.modular.scrfactoryheat.entity.ScrFactoryHeat;
/**
* 分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
public interface ScrFactoryHeatMapper extends BaseMapper<ScrFactoryHeat> {
}

View File

@ -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="vip.xiaonuo.modular.scrfactoryheat.mapper.ScrFactoryHeatMapper">
</mapper>

View File

@ -0,0 +1,60 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrfactoryheat.param;
import vip.xiaonuo.core.pojo.base.param.BaseParam;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import java.util.*;
/**
* 分厂炉号对应关系参数类
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@Data
public class ScrFactoryHeatParam extends BaseParam {
/**
* 主键
*/
@NotNull(message = "主键不能为空请检查id参数", groups = {edit.class, delete.class, detail.class})
private Long id;
/**
* 分厂
*/
@NotBlank(message = "分厂不能为空请检查branchPlant参数", groups = {add.class, edit.class})
private String branchPlant;
/**
* 炉号
*/
@NotBlank(message = "炉号不能为空请检查furnaceNumber参数", groups = {add.class, edit.class})
private String furnaceNumber;
}

View File

@ -0,0 +1,97 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrfactoryheat.service;
import com.baomidou.mybatisplus.extension.service.IService;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.modular.scrfactoryheat.entity.ScrFactoryHeat;
import vip.xiaonuo.modular.scrfactoryheat.param.ScrFactoryHeatParam;
import java.util.List;
/**
* 分厂炉号对应关系service接口
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
public interface ScrFactoryHeatService extends IService<ScrFactoryHeat> {
/**
* 查询分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
PageResult<ScrFactoryHeat> page(ScrFactoryHeatParam scrFactoryHeatParam);
/**
* 分厂炉号对应关系列表
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
List<ScrFactoryHeat> list(ScrFactoryHeatParam scrFactoryHeatParam);
/**
* 添加分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
void add(ScrFactoryHeatParam scrFactoryHeatParam);
/**
* 删除分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
void delete(List<ScrFactoryHeatParam> scrFactoryHeatParamList);
/**
* 编辑分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
void edit(ScrFactoryHeatParam scrFactoryHeatParam);
/**
* 查看分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
ScrFactoryHeat detail(ScrFactoryHeatParam scrFactoryHeatParam);
/**
* 导出分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
void export(ScrFactoryHeatParam scrFactoryHeatParam);
}

View File

@ -0,0 +1,128 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrfactoryheat.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import vip.xiaonuo.core.consts.CommonConstant;
import vip.xiaonuo.core.enums.CommonStatusEnum;
import vip.xiaonuo.core.exception.ServiceException;
import vip.xiaonuo.core.factory.PageFactory;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.core.util.PoiUtil;
import vip.xiaonuo.modular.scrfactoryheat.entity.ScrFactoryHeat;
import vip.xiaonuo.modular.scrfactoryheat.enums.ScrFactoryHeatExceptionEnum;
import vip.xiaonuo.modular.scrfactoryheat.mapper.ScrFactoryHeatMapper;
import vip.xiaonuo.modular.scrfactoryheat.param.ScrFactoryHeatParam;
import vip.xiaonuo.modular.scrfactoryheat.service.ScrFactoryHeatService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* 分厂炉号对应关系service接口实现类
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
@Service
public class ScrFactoryHeatServiceImpl extends ServiceImpl<ScrFactoryHeatMapper, ScrFactoryHeat> implements ScrFactoryHeatService {
@Override
public PageResult<ScrFactoryHeat> page(ScrFactoryHeatParam scrFactoryHeatParam) {
QueryWrapper<ScrFactoryHeat> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotNull(scrFactoryHeatParam)) {
// 根据分厂 查询
if (ObjectUtil.isNotEmpty(scrFactoryHeatParam.getBranchPlant())) {
queryWrapper.lambda().eq(ScrFactoryHeat::getBranchPlant, scrFactoryHeatParam.getBranchPlant());
}
// 根据炉号 查询
if (ObjectUtil.isNotEmpty(scrFactoryHeatParam.getFurnaceNumber())) {
queryWrapper.lambda().eq(ScrFactoryHeat::getFurnaceNumber, scrFactoryHeatParam.getFurnaceNumber());
}
}
return new PageResult<>(this.page(PageFactory.defaultPage(), queryWrapper));
}
@Override
public List<ScrFactoryHeat> list(ScrFactoryHeatParam scrFactoryHeatParam) {
return this.list();
}
@Override
public void add(ScrFactoryHeatParam scrFactoryHeatParam) {
ScrFactoryHeat scrFactoryHeat = new ScrFactoryHeat();
BeanUtil.copyProperties(scrFactoryHeatParam, scrFactoryHeat);
this.save(scrFactoryHeat);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void delete(List<ScrFactoryHeatParam> scrFactoryHeatParamList) {
scrFactoryHeatParamList.forEach(scrFactoryHeatParam -> {
this.removeById(scrFactoryHeatParam.getId());
});
}
@Transactional(rollbackFor = Exception.class)
@Override
public void edit(ScrFactoryHeatParam scrFactoryHeatParam) {
ScrFactoryHeat scrFactoryHeat = this.queryScrFactoryHeat(scrFactoryHeatParam);
BeanUtil.copyProperties(scrFactoryHeatParam, scrFactoryHeat);
this.updateById(scrFactoryHeat);
}
@Override
public ScrFactoryHeat detail(ScrFactoryHeatParam scrFactoryHeatParam) {
return this.queryScrFactoryHeat(scrFactoryHeatParam);
}
/**
* 获取分厂炉号对应关系
*
* @author zhangyn
* @date 2025-09-10 10:02:57
*/
private ScrFactoryHeat queryScrFactoryHeat(ScrFactoryHeatParam scrFactoryHeatParam) {
ScrFactoryHeat scrFactoryHeat = this.getById(scrFactoryHeatParam.getId());
if (ObjectUtil.isNull(scrFactoryHeat)) {
throw new ServiceException(ScrFactoryHeatExceptionEnum.NOT_EXIST);
}
return scrFactoryHeat;
}
@Override
public void export(ScrFactoryHeatParam scrFactoryHeatParam) {
List<ScrFactoryHeat> list = this.list(scrFactoryHeatParam);
PoiUtil.exportExcelWithStream("SnowyScrFactoryHeat.xls", ScrFactoryHeat.class, list);
}
}

View File

@ -0,0 +1,163 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrproduction.controller;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.scrproduction.param.ScrProductionParam;
import vip.xiaonuo.modular.scrproduction.service.ScrProductionService;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.List;
/**
* 产量控制器
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@RestController
public class ScrProductionController {
@Resource
private ScrProductionService scrProductionService;
/**
* 查询产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Permission
@GetMapping("/scrProduction/page")
@BusinessLog(title = "产量_查询", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData page(ScrProductionParam scrProductionParam) {
return new SuccessResponseData(scrProductionService.page(scrProductionParam));
}
/**
* 添加产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Permission
@PostMapping("/scrProduction/add")
@BusinessLog(title = "产量_增加", opType = LogAnnotionOpTypeEnum.ADD)
public ResponseData add(@RequestBody @Validated(ScrProductionParam.add.class) ScrProductionParam scrProductionParam) {
scrProductionService.add(scrProductionParam);
return new SuccessResponseData();
}
/**
* 删除产量可批量删除
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Permission
@PostMapping("/scrProduction/delete")
@BusinessLog(title = "产量_删除", opType = LogAnnotionOpTypeEnum.DELETE)
public ResponseData delete(@RequestBody @Validated(ScrProductionParam.delete.class) List<ScrProductionParam> scrProductionParamList) {
scrProductionService.delete(scrProductionParamList);
return new SuccessResponseData();
}
/**
* 编辑产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Permission
@PostMapping("/scrProduction/edit")
@BusinessLog(title = "产量_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
public ResponseData edit(@RequestBody @Validated(ScrProductionParam.edit.class) ScrProductionParam scrProductionParam) {
scrProductionService.edit(scrProductionParam);
return new SuccessResponseData();
}
/**
* 查看产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Permission
@GetMapping("/scrProduction/detail")
@BusinessLog(title = "产量_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
public ResponseData detail(@Validated(ScrProductionParam.detail.class) ScrProductionParam scrProductionParam) {
return new SuccessResponseData(scrProductionService.detail(scrProductionParam));
}
/**
* 产量列表
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Permission
@GetMapping("/scrProduction/list")
@BusinessLog(title = "产量_列表", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData list(ScrProductionParam scrProductionParam) {
return new SuccessResponseData(scrProductionService.list(scrProductionParam));
}
/**
* 导出系统用户
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Permission
@GetMapping("/scrProduction/export")
@BusinessLog(title = "产量_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
public void export(ScrProductionParam scrProductionParam) {
scrProductionService.export(scrProductionParam);
}
@GetMapping("/scrProduction/driQuery")
@BusinessLog(title = "产量_大屏查询", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData driQuery(ScrProductionParam scrProductionParam) {
return new SuccessResponseData(scrProductionService.driQuery(scrProductionParam));
}
@GetMapping("/scrProduction/driMaterQuery")
@BusinessLog(title = "原材料产量和耗电量_大屏查询", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData driMaterQuery(ScrProductionParam scrProductionParam) {
return new SuccessResponseData(scrProductionService.driMaterQuery(scrProductionParam));
}
@GetMapping("/scrProduction/driQhQuery")
@BusinessLog(title = "各炉号产量_大屏查询", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData driQhQuery(ScrProductionParam scrProductionParam) {
return new SuccessResponseData(scrProductionService.driQhQuery(scrProductionParam));
}
}

View File

@ -0,0 +1,111 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrproduction.entity;
import com.baomidou.mybatisplus.annotation.*;
import vip.xiaonuo.core.pojo.base.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.*;
import cn.afterturn.easypoi.excel.annotation.Excel;
import vip.xiaonuo.core.pojo.base.param.BaseParam;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* 产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("scr_production")
public class ScrProduction extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 日期
*/
@Excel(name = "日期", databaseFormat = "yyyy-MM-dd HH:mm:ss", format = "yyyy-MM-dd", width = 20)
private Date productionDay;
/**
* 炉号
*/
@Excel(name = "炉号")
private String furnaceNumber;
/**
* 产品
*/
@Excel(name = "产品")
private String product;
/**
* 产量
*/
@Excel(name = "产量")
private BigDecimal production;
/**
* 回收率
*/
@Excel(name = "回收率")
private BigDecimal passRate;
/**
* 扣铁粉渣用量
*/
@Excel(name = "扣铁粉渣用量")
private BigDecimal conts;
/**
* 耗电量
*/
@Excel(name = "耗电量")
private BigDecimal power;
/**
* 渣Mn
*/
@Excel(name = "渣Mn")
private BigDecimal slagMn;
/**
* 炉编号
*/
@Excel(name = "炉编号")
private String furnaceCode;
/**
* 单耗
*/
@Excel(name = "单耗")
private BigDecimal units;
}

View File

@ -0,0 +1,64 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrproduction.enums;
import vip.xiaonuo.core.annotion.ExpEnumType;
import vip.xiaonuo.core.exception.enums.abs.AbstractBaseExceptionEnum;
import vip.xiaonuo.core.factory.ExpEnumCodeFactory;
import vip.xiaonuo.sys.core.consts.SysExpEnumConstant;
/**
* 产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@ExpEnumType(module = SysExpEnumConstant.SNOWY_SYS_MODULE_EXP_CODE)
public enum ScrProductionExceptionEnum implements AbstractBaseExceptionEnum {
/**
* 数据不存在
*/
NOT_EXIST(1, "此数据不存在");
private final Integer code;
private final String message;
ScrProductionExceptionEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
@Override
public Integer getCode() {
return ExpEnumCodeFactory.getExpEnumCode(this.getClass(), code);
}
@Override
public String getMessage() {
return message;
}
}

View File

@ -0,0 +1,37 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrproduction.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import vip.xiaonuo.modular.scrproduction.entity.ScrProduction;
/**
* 产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
public interface ScrProductionMapper extends BaseMapper<ScrProduction> {
}

View File

@ -0,0 +1,13 @@
<?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="vip.xiaonuo.modular.scrproduction.mapper.ScrProductionMapper">
<!--获取用户分页列表-->
<select id="page" resultMap="sysUserResult">
select sys_user.*,
sys_emp.job_num,
sys_emp.org_id,
sys_emp.org_name
from sys_user left join sys_emp on sys_user.id = sys_emp.id left join sys_org on sys_emp.org_id = sys_org.id
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -0,0 +1,59 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrproduction.param;
import lombok.Data;
import vip.xiaonuo.core.pojo.base.param.BaseParam;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;
/**
* 产量参数类
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Data
public class ScrProductionDriParam {
/**
* 累计产量
*/
private BigDecimal production;
/**
* 回收率
*/
private BigDecimal passRate;
/**
* 单耗
*/
private BigDecimal units;
}

View File

@ -0,0 +1,59 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrproduction.param;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 产量参数类
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Data
public class ScrProductionMaterParam {
/**
* 名称
*/
private String title;
/**
* 用量
*/
private BigDecimal consumption;
/**
* 耗电量
*/
private BigDecimal power;
/**
* 各原料
*/
private List<ScrProductionMaterParam> list;
}

View File

@ -0,0 +1,111 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrproduction.param;
import cn.afterturn.easypoi.excel.annotation.Excel;
import vip.xiaonuo.core.pojo.base.param.BaseParam;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
* 产量参数类
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Data
public class ScrProductionParam extends BaseParam {
/**
* 主键
*/
@NotNull(message = "主键不能为空请检查id参数", groups = {edit.class, delete.class, detail.class})
private Long id;
/**
* 日期
*/
@NotNull(message = "日期不能为空请检查productionDay参数", groups = {add.class, edit.class})
private String productionDay;
/**
* 炉号
*/
@NotBlank(message = "炉号不能为空请检查furnaceNumber参数", groups = {add.class, edit.class})
private String furnaceNumber;
/**
* 产品
*/
@NotBlank(message = "产品不能为空请检查product参数", groups = {add.class, edit.class})
private String product;
/**
* 产量
*/
@NotNull(message = "产量不能为空请检查production参数", groups = {add.class, edit.class})
private BigDecimal production;
/**
* 回收率
*/
@NotNull(message = "合格率不能为空请检查passRate参数", groups = {add.class, edit.class})
private BigDecimal passRate;
/**
* 回收率
*/
@NotNull(message = "扣铁粉渣用量不能为空请检查conts参数", groups = {add.class, edit.class})
private BigDecimal conts;
/**
* 耗电量
*/
@NotNull(message = "耗电量不能为空请检查power参数", groups = {add.class, edit.class})
private BigDecimal power;
/**
* 渣Mn
*/
@NotNull(message = "渣Mn不能为空请检查slagMn参数", groups = {add.class, edit.class})
private BigDecimal slagMn;
/**
* 炉编号
*/
@NotNull(message = "炉编号不能为空请检查furnaceCode参数", groups = {add.class, edit.class})
private String furnaceCode;
/**
* 单耗
*/
@NotNull(message = "单耗不能为空请检查units参数", groups = {add.class, edit.class})
private BigDecimal units;
private Integer year;
private Integer month;
private Date startDate;
private Date endDate;
}

View File

@ -0,0 +1,104 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrproduction.service;
import com.baomidou.mybatisplus.extension.service.IService;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.modular.scrproduction.entity.ScrProduction;
import vip.xiaonuo.modular.scrproduction.param.ScrProductionParam;
import vip.xiaonuo.modular.scrproduction.param.ScrProductionDriParam;
import vip.xiaonuo.modular.scrproduction.param.ScrProductionMaterParam;
import java.util.List;
/**
* 产量service接口
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
public interface ScrProductionService extends IService<ScrProduction> {
/**
* 查询产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
PageResult<ScrProduction> page(ScrProductionParam scrProductionParam);
/**
* 产量列表
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
List<ScrProduction> list(ScrProductionParam scrProductionParam);
/**
* 添加产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
void add(ScrProductionParam scrProductionParam);
/**
* 删除产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
void delete(List<ScrProductionParam> scrProductionParamList);
/**
* 编辑产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
void edit(ScrProductionParam scrProductionParam);
/**
* 查看产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
ScrProduction detail(ScrProductionParam scrProductionParam);
/**
* 导出产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
void export(ScrProductionParam scrProductionParam);
ScrProductionDriParam driQuery(ScrProductionParam scrProductionParam);
List<ScrProduction> driQhQuery(ScrProductionParam scrProductionParam);
List<ScrProductionMaterParam> driMaterQuery(ScrProductionParam scrProductionParam);
}

View File

@ -0,0 +1,487 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrproduction.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import vip.xiaonuo.core.exception.ServiceException;
import vip.xiaonuo.core.factory.PageFactory;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.core.util.PoiUtil;
import vip.xiaonuo.modular.scrproduction.entity.ScrProduction;
import vip.xiaonuo.modular.scrproduction.enums.ScrProductionExceptionEnum;
import vip.xiaonuo.modular.scrproduction.mapper.ScrProductionMapper;
import vip.xiaonuo.modular.scrproduction.param.ScrProductionDriParam;
import vip.xiaonuo.modular.scrproduction.param.ScrProductionMaterParam;
import vip.xiaonuo.modular.scrproduction.param.ScrProductionParam;
import vip.xiaonuo.modular.scrproduction.service.ScrProductionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import vip.xiaonuo.modular.scrrawmaterials.entity.ScrRawMaterials;
import vip.xiaonuo.modular.scrrawmaterials.service.ScrRawMaterialsService;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 产量service接口实现类
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
@Service
public class ScrProductionServiceImpl extends ServiceImpl<ScrProductionMapper, ScrProduction> implements ScrProductionService {
@Resource
private ScrRawMaterialsService scrRawMaterialsService;
@Override
public PageResult<ScrProduction> page(ScrProductionParam scrProductionParam) {
QueryWrapper<ScrProduction> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotNull(scrProductionParam)) {
// 根据日期 查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getProductionDay())) {
queryWrapper.lambda().eq(ScrProduction::getProductionDay, scrProductionParam.getProductionDay());
}
// 根据炉号 查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getFurnaceNumber())) {
queryWrapper.lambda().eq(ScrProduction::getFurnaceNumber, scrProductionParam.getFurnaceNumber());
}
// 根据产品 查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getProduct())) {
queryWrapper.lambda().eq(ScrProduction::getProduct, scrProductionParam.getProduct());
}
// 根据产量 查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getProduction())) {
queryWrapper.lambda().eq(ScrProduction::getProduction, scrProductionParam.getProduction());
}
// 根据合格率 查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getPassRate())) {
queryWrapper.lambda().eq(ScrProduction::getPassRate, scrProductionParam.getPassRate());
}
}
return new PageResult<>(this.page(PageFactory.defaultPage(), queryWrapper));
}
@Override
public List<ScrProduction> list(ScrProductionParam scrProductionParam) {
return this.list();
}
@Override
public void add(ScrProductionParam scrProductionParam) {
ScrProduction scrProduction = new ScrProduction();
BeanUtil.copyProperties(scrProductionParam, scrProduction);
this.save(scrProduction);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void delete(List<ScrProductionParam> scrProductionParamList) {
scrProductionParamList.forEach(scrProductionParam -> {
this.removeById(scrProductionParam.getId());
});
}
@Transactional(rollbackFor = Exception.class)
@Override
public void edit(ScrProductionParam scrProductionParam) {
ScrProduction scrProduction = this.queryScrProduction(scrProductionParam);
BeanUtil.copyProperties(scrProductionParam, scrProduction);
this.updateById(scrProduction);
}
@Override
public ScrProduction detail(ScrProductionParam scrProductionParam) {
return this.queryScrProduction(scrProductionParam);
}
/**
* 获取产量
*
* @author zyn
* @date 2025-09-10 10:03:01
*/
private ScrProduction queryScrProduction(ScrProductionParam scrProductionParam) {
ScrProduction scrProduction = this.getById(scrProductionParam.getId());
if (ObjectUtil.isNull(scrProduction)) {
throw new ServiceException(ScrProductionExceptionEnum.NOT_EXIST);
}
return scrProduction;
}
@Override
public void export(ScrProductionParam scrProductionParam) {
List<ScrProduction> list = this.list(scrProductionParam);
PoiUtil.exportExcelWithStream("SnowyScrProduction.xls", ScrProduction.class, list);
}
@Override
public ScrProductionDriParam driQuery(ScrProductionParam scrProductionParam) {
QueryWrapper<ScrProduction> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotNull(scrProductionParam)) {
// 按指定日期查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getProductionDay())) {
LocalDate targetDate = LocalDate.parse(scrProductionParam.getProductionDay());
queryWrapper.lambda().eq(ScrProduction::getProductionDay, targetDate);
}
// 按月份查询如果有年份和月份参数
if (ObjectUtil.isNotEmpty(scrProductionParam.getYear()) && ObjectUtil.isNotEmpty(scrProductionParam.getMonth())) {
Integer year = scrProductionParam.getYear();
Integer month = scrProductionParam.getMonth();
LocalDate startDate = LocalDate.of(year, month, 1);
LocalDate endDate = startDate.withDayOfMonth(startDate.lengthOfMonth());
queryWrapper.lambda()
.ge(ScrProduction::getProductionDay, startDate)
.le(ScrProduction::getProductionDay, endDate);
}
// 按年份查询只有年份参数没有月份参数
else if (ObjectUtil.isNotEmpty(scrProductionParam.getYear())) {
Integer year = scrProductionParam.getYear();
LocalDate startDate = LocalDate.of(year, 1, 1);
LocalDate endDate = LocalDate.of(year, 12, 31);
queryWrapper.lambda()
.ge(ScrProduction::getProductionDay, startDate)
.le(ScrProduction::getProductionDay, endDate);
}
// 按日期范围查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getStartDate()) && ObjectUtil.isNotEmpty(scrProductionParam.getEndDate())) {
queryWrapper.lambda()
.ge(ScrProduction::getProductionDay, scrProductionParam.getStartDate())
.le(ScrProduction::getProductionDay, scrProductionParam.getEndDate());
}
// 其他可能的过滤条件
if (ObjectUtil.isNotEmpty(scrProductionParam.getFurnaceNumber())) {
queryWrapper.lambda().eq(ScrProduction::getFurnaceNumber, scrProductionParam.getFurnaceNumber());
}
if (ObjectUtil.isNotEmpty(scrProductionParam.getProduct())) {
queryWrapper.lambda().eq(ScrProduction::getProduct, scrProductionParam.getProduct());
}
}
// 查询符合条件的所有产量记录
List<ScrProduction> productions = this.list(queryWrapper);
// 计算单耗
BigDecimal units = productions.stream()
.map(ScrProduction::getUnits)
.filter(ObjectUtil::isNotEmpty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
// 计算总产量
BigDecimal totalProduction = productions.stream()
.map(ScrProduction::getProduction)
.filter(ObjectUtil::isNotEmpty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
// 计算平均合格率
BigDecimal avgPassRate =null;
if (!productions.isEmpty()) {
List<BigDecimal> validPassRates = productions.stream()
.map(ScrProduction::getPassRate)
.filter(ObjectUtil::isNotEmpty)
.collect(Collectors.toList());
if (!validPassRates.isEmpty()) {
BigDecimal sumPassRate = validPassRates.stream()
.reduce(BigDecimal.ZERO, BigDecimal::add);
avgPassRate = sumPassRate.divide(BigDecimal.valueOf(validPassRates.size()), 4, RoundingMode.HALF_UP);
}
}
// 创建返回对象
ScrProductionDriParam result = new ScrProductionDriParam();
result.setProduction(totalProduction);
result.setPassRate(avgPassRate);
result.setUnits(units);
return result;
}
@Override
public List<ScrProduction> driQhQuery(ScrProductionParam scrProductionParam) {
QueryWrapper<ScrProduction> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotNull(scrProductionParam)) {
// 按指定日期查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getProductionDay())) {
queryWrapper.lambda().eq(ScrProduction::getProductionDay, scrProductionParam.getProductionDay());
}
// 按年月查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getYear()) && ObjectUtil.isNotEmpty(scrProductionParam.getMonth())) {
Integer year = scrProductionParam.getYear();
Integer month = scrProductionParam.getMonth();
LocalDate startDate = LocalDate.of(year, month, 1);
LocalDate endDate = startDate.withDayOfMonth(startDate.lengthOfMonth());
queryWrapper.lambda()
.ge(ScrProduction::getProductionDay, startDate)
.le(ScrProduction::getProductionDay, endDate);
}
// 按年度查询
else if (ObjectUtil.isNotEmpty(scrProductionParam.getYear())) {
Integer year = scrProductionParam.getYear();
LocalDate startDate = LocalDate.of(year, 1, 1);
LocalDate endDate = LocalDate.of(year, 12, 31);
queryWrapper.lambda()
.ge(ScrProduction::getProductionDay, startDate)
.le(ScrProduction::getProductionDay, endDate);
}
// 按日期范围查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getStartDate()) && ObjectUtil.isNotEmpty(scrProductionParam.getEndDate())) {
queryWrapper.lambda()
.ge(ScrProduction::getProductionDay, scrProductionParam.getStartDate())
.le(ScrProduction::getProductionDay, scrProductionParam.getEndDate());
}
// 按产品查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getProduct())) {
queryWrapper.lambda().eq(ScrProduction::getProduct, scrProductionParam.getProduct());
}
}
// 查询原始数据
List<ScrProduction> productions = this.list(queryWrapper);
// 按炉号分组并聚合产量
return productions.stream()
.collect(Collectors.groupingBy(ScrProduction::getFurnaceNumber))
.entrySet()
.stream()
.map(entry -> {
String furnaceNumber = entry.getKey();
List<ScrProduction> furnaceProductions = entry.getValue();
// 创建聚合记录
ScrProduction aggregated = new ScrProduction();
aggregated.setFurnaceNumber(furnaceNumber);
// 聚合产量只聚合产量
BigDecimal totalProduction = furnaceProductions.stream()
.map(ScrProduction::getProduction)
.filter(ObjectUtil::isNotEmpty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
aggregated.setProduction(totalProduction);
return aggregated;
})
.collect(Collectors.toList());
}
@Override
public List<ScrProductionMaterParam> driMaterQuery(ScrProductionParam scrProductionParam) {
QueryWrapper<ScrProduction> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotNull(scrProductionParam)) {
// 按指定日期查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getProductionDay())) {
queryWrapper.lambda().eq(ScrProduction::getProductionDay, scrProductionParam.getProductionDay());
}
// 按年月查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getYear()) && ObjectUtil.isNotEmpty(scrProductionParam.getMonth())) {
Integer year = scrProductionParam.getYear();
Integer month = scrProductionParam.getMonth();
LocalDate startDate = LocalDate.of(year, month, 1);
LocalDate endDate = startDate.withDayOfMonth(startDate.lengthOfMonth());
queryWrapper.lambda()
.ge(ScrProduction::getProductionDay, startDate)
.le(ScrProduction::getProductionDay, endDate);
}
// 按年度查询
else if (ObjectUtil.isNotEmpty(scrProductionParam.getYear())) {
Integer year = scrProductionParam.getYear();
LocalDate startDate = LocalDate.of(year, 1, 1);
LocalDate endDate = LocalDate.of(year, 12, 31);
queryWrapper.lambda()
.ge(ScrProduction::getProductionDay, startDate)
.le(ScrProduction::getProductionDay, endDate);
}
// 按日期范围查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getStartDate()) && ObjectUtil.isNotEmpty(scrProductionParam.getEndDate())) {
queryWrapper.lambda()
.ge(ScrProduction::getProductionDay, scrProductionParam.getStartDate())
.le(ScrProduction::getProductionDay, scrProductionParam.getEndDate());
}
// 按炉号查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getFurnaceNumber())) {
queryWrapper.lambda().eq(ScrProduction::getFurnaceNumber, scrProductionParam.getFurnaceNumber());
}
}
// 添加产品过滤条件只查询硅锰铬铁硅铁
queryWrapper.lambda().in(ScrProduction::getProduct, "硅锰", "铬铁", "硅铁");
// 查询产量数据
List<ScrProduction> productions = this.list(queryWrapper);
// 获取涉及的炉号列表
List<String> furnaceNumbers = productions.stream()
.map(ScrProduction::getFurnaceNumber)
.distinct()
.collect(Collectors.toList());
// 如果没有炉号数据直接返回空列表
if (furnaceNumbers.isEmpty()) {
return Collections.emptyList();
}
// 查询原材料用量数据
QueryWrapper<ScrRawMaterials> rawMaterialsQueryWrapper = new QueryWrapper<>();
rawMaterialsQueryWrapper.lambda().in(ScrRawMaterials::getFurnaceNumber, furnaceNumbers);
// 添加时间条件到原材料查询
if (ObjectUtil.isNotNull(scrProductionParam)) {
// 按指定日期查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getProductionDay())) {
rawMaterialsQueryWrapper.lambda().eq(ScrRawMaterials::getConsumptionDay, scrProductionParam.getProductionDay());
}
// 按年月查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getYear()) && ObjectUtil.isNotEmpty(scrProductionParam.getMonth())) {
Integer year = scrProductionParam.getYear();
Integer month = scrProductionParam.getMonth();
LocalDate startDate = LocalDate.of(year, month, 1);
LocalDate endDate = startDate.withDayOfMonth(startDate.lengthOfMonth());
rawMaterialsQueryWrapper.lambda()
.ge(ScrRawMaterials::getConsumptionDay, startDate)
.le(ScrRawMaterials::getConsumptionDay, endDate);
}
// 按年度查询
else if (ObjectUtil.isNotEmpty(scrProductionParam.getYear())) {
Integer year = scrProductionParam.getYear();
LocalDate startDate = LocalDate.of(year, 1, 1);
LocalDate endDate = LocalDate.of(year, 12, 31);
rawMaterialsQueryWrapper.lambda()
.ge(ScrRawMaterials::getConsumptionDay, startDate)
.le(ScrRawMaterials::getConsumptionDay, endDate);
}
// 按日期范围查询
if (ObjectUtil.isNotEmpty(scrProductionParam.getStartDate()) && ObjectUtil.isNotEmpty(scrProductionParam.getEndDate())) {
rawMaterialsQueryWrapper.lambda()
.ge(ScrRawMaterials::getConsumptionDay, scrProductionParam.getStartDate())
.le(ScrRawMaterials::getConsumptionDay, scrProductionParam.getEndDate());
}
}
List<ScrRawMaterials> rawMaterialsList = scrRawMaterialsService.list(rawMaterialsQueryWrapper);
// 按产品分组并聚合数据保持炉号对应关系
return productions.stream()
.collect(Collectors.groupingBy(ScrProduction::getProduct))
.entrySet()
.stream()
.map(entry -> {
String product = entry.getKey();
List<ScrProduction> productProductions = entry.getValue();
// 创建产品参数对象
ScrProductionMaterParam productParam = new ScrProductionMaterParam();
productParam.setTitle(product);
// 聚合该产品的总产量
BigDecimal totalProduction = productProductions.stream()
.map(ScrProduction::getProduction)
.filter(ObjectUtil::isNotEmpty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
productParam.setPower(totalProduction); // 使用power字段存储总产量
// 获取该产品涉及的炉号
List<String> productFurnaceNumbers = productProductions.stream()
.map(ScrProduction::getFurnaceNumber)
.distinct()
.collect(Collectors.toList());
// 筛选出该产品涉及的原材料数据
List<ScrRawMaterials> productRawMaterials = rawMaterialsList.stream()
.filter(material -> productFurnaceNumbers.contains(material.getFurnaceNumber()))
.collect(Collectors.toList());
// 计算该产品涉及炉号的原材料总用量
BigDecimal totalConsumption = productRawMaterials.stream()
.map(ScrRawMaterials::getConsumption)
.filter(ObjectUtil::isNotEmpty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
productParam.setConsumption(totalConsumption);
// 按原材料名称分组并聚合用量确保只包含该产品的炉号数据
List<ScrProductionMaterParam> materialList = productRawMaterials.stream()
.collect(Collectors.groupingBy(ScrRawMaterials::getRawMaterials))
.entrySet()
.stream()
.map(materialEntry -> {
String rawMaterialName = materialEntry.getKey();
List<ScrRawMaterials> materials = materialEntry.getValue();
ScrProductionMaterParam materialParam = new ScrProductionMaterParam();
materialParam.setTitle(rawMaterialName);
// 计算该原材料的总用量仅该产品的炉号
BigDecimal materialConsumption = materials.stream()
.map(ScrRawMaterials::getConsumption)
.filter(ObjectUtil::isNotEmpty)
.reduce(BigDecimal.ZERO, BigDecimal::add);
materialParam.setConsumption(materialConsumption);
return materialParam;
})
.collect(Collectors.toList());
productParam.setList(materialList);
return productParam;
})
.collect(Collectors.toList());
}
}

View File

@ -0,0 +1,148 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrrawmaterials.controller;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.scrrawmaterials.param.ScrRawMaterialsParam;
import vip.xiaonuo.modular.scrrawmaterials.service.ScrRawMaterialsService;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.List;
/**
* 原材料控制器
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@RestController
public class ScrRawMaterialsController {
@Resource
private ScrRawMaterialsService scrRawMaterialsService;
/**
* 查询原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@Permission
@GetMapping("/scrRawMaterials/page")
@BusinessLog(title = "原材料_查询", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData page(ScrRawMaterialsParam scrRawMaterialsParam) {
return new SuccessResponseData(scrRawMaterialsService.page(scrRawMaterialsParam));
}
/**
* 添加原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@Permission
@PostMapping("/scrRawMaterials/add")
@BusinessLog(title = "原材料_增加", opType = LogAnnotionOpTypeEnum.ADD)
public ResponseData add(@RequestBody @Validated(ScrRawMaterialsParam.add.class) ScrRawMaterialsParam scrRawMaterialsParam) {
scrRawMaterialsService.add(scrRawMaterialsParam);
return new SuccessResponseData();
}
/**
* 删除原材料可批量删除
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@Permission
@PostMapping("/scrRawMaterials/delete")
@BusinessLog(title = "原材料_删除", opType = LogAnnotionOpTypeEnum.DELETE)
public ResponseData delete(@RequestBody @Validated(ScrRawMaterialsParam.delete.class) List<ScrRawMaterialsParam> scrRawMaterialsParamList) {
scrRawMaterialsService.delete(scrRawMaterialsParamList);
return new SuccessResponseData();
}
/**
* 编辑原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@Permission
@PostMapping("/scrRawMaterials/edit")
@BusinessLog(title = "原材料_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
public ResponseData edit(@RequestBody @Validated(ScrRawMaterialsParam.edit.class) ScrRawMaterialsParam scrRawMaterialsParam) {
scrRawMaterialsService.edit(scrRawMaterialsParam);
return new SuccessResponseData();
}
/**
* 查看原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@Permission
@GetMapping("/scrRawMaterials/detail")
@BusinessLog(title = "原材料_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
public ResponseData detail(@Validated(ScrRawMaterialsParam.detail.class) ScrRawMaterialsParam scrRawMaterialsParam) {
return new SuccessResponseData(scrRawMaterialsService.detail(scrRawMaterialsParam));
}
/**
* 原材料列表
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@Permission
@GetMapping("/scrRawMaterials/list")
@BusinessLog(title = "原材料_列表", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData list(ScrRawMaterialsParam scrRawMaterialsParam) {
return new SuccessResponseData(scrRawMaterialsService.list(scrRawMaterialsParam));
}
/**
* 导出系统用户
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@Permission
@GetMapping("/scrRawMaterials/export")
@BusinessLog(title = "原材料_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
public void export(ScrRawMaterialsParam scrRawMaterialsParam) {
scrRawMaterialsService.export(scrRawMaterialsParam);
}
}

View File

@ -0,0 +1,76 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrrawmaterials.entity;
import com.baomidou.mybatisplus.annotation.*;
import vip.xiaonuo.core.pojo.base.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.*;
import cn.afterturn.easypoi.excel.annotation.Excel;
import java.math.BigDecimal;
/**
* 原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("scr_raw_materials")
public class ScrRawMaterials extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 日期
*/
@Excel(name = "日期", databaseFormat = "yyyy-MM-dd HH:mm:ss", format = "yyyy-MM-dd", width = 20)
private Date consumptionDay;
/**
* 炉号
*/
@Excel(name = "炉号")
private String furnaceNumber;
/**
* 原材料
*/
@Excel(name = "原材料")
private String rawMaterials;
/**
* 用量
*/
@Excel(name = "用量")
private BigDecimal consumption;
}

View File

@ -0,0 +1,64 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrrawmaterials.enums;
import vip.xiaonuo.core.annotion.ExpEnumType;
import vip.xiaonuo.core.exception.enums.abs.AbstractBaseExceptionEnum;
import vip.xiaonuo.core.factory.ExpEnumCodeFactory;
import vip.xiaonuo.sys.core.consts.SysExpEnumConstant;
/**
* 原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@ExpEnumType(module = SysExpEnumConstant.SNOWY_SYS_MODULE_EXP_CODE)
public enum ScrRawMaterialsExceptionEnum implements AbstractBaseExceptionEnum {
/**
* 数据不存在
*/
NOT_EXIST(1, "此数据不存在");
private final Integer code;
private final String message;
ScrRawMaterialsExceptionEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
@Override
public Integer getCode() {
return ExpEnumCodeFactory.getExpEnumCode(this.getClass(), code);
}
@Override
public String getMessage() {
return message;
}
}

View File

@ -0,0 +1,37 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrrawmaterials.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import vip.xiaonuo.modular.scrrawmaterials.entity.ScrRawMaterials;
/**
* 原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
public interface ScrRawMaterialsMapper extends BaseMapper<ScrRawMaterials> {
}

View File

@ -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="vip.xiaonuo.modular.scrrawmaterials.mapper.ScrRawMaterialsMapper">
</mapper>

View File

@ -0,0 +1,73 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrrawmaterials.param;
import vip.xiaonuo.core.pojo.base.param.BaseParam;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import java.util.*;
import java.math.BigDecimal;
/**
* 原材料参数类
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@Data
public class ScrRawMaterialsParam extends BaseParam {
/**
* 主键
*/
@NotNull(message = "主键不能为空请检查id参数", groups = {edit.class, delete.class, detail.class})
private Long id;
/**
* 日期
*/
@NotNull(message = "日期不能为空请检查consumptionDay参数", groups = {add.class, edit.class})
private String consumptionDay;
/**
* 炉号
*/
@NotBlank(message = "炉号不能为空请检查furnaceNumber参数", groups = {add.class, edit.class})
private String furnaceNumber;
/**
* 原材料
*/
@NotBlank(message = "原材料不能为空请检查rawMaterials参数", groups = {add.class, edit.class})
private String rawMaterials;
/**
* 用量
*/
@NotNull(message = "用量不能为空请检查consumption参数", groups = {add.class, edit.class})
private BigDecimal consumption;
}

View File

@ -0,0 +1,97 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrrawmaterials.service;
import com.baomidou.mybatisplus.extension.service.IService;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.modular.scrrawmaterials.entity.ScrRawMaterials;
import vip.xiaonuo.modular.scrrawmaterials.param.ScrRawMaterialsParam;
import java.util.List;
/**
* 原材料service接口
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
public interface ScrRawMaterialsService extends IService<ScrRawMaterials> {
/**
* 查询原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
PageResult<ScrRawMaterials> page(ScrRawMaterialsParam scrRawMaterialsParam);
/**
* 原材料列表
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
List<ScrRawMaterials> list(ScrRawMaterialsParam scrRawMaterialsParam);
/**
* 添加原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
void add(ScrRawMaterialsParam scrRawMaterialsParam);
/**
* 删除原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
void delete(List<ScrRawMaterialsParam> scrRawMaterialsParamList);
/**
* 编辑原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
void edit(ScrRawMaterialsParam scrRawMaterialsParam);
/**
* 查看原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
ScrRawMaterials detail(ScrRawMaterialsParam scrRawMaterialsParam);
/**
* 导出原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
void export(ScrRawMaterialsParam scrRawMaterialsParam);
}

View File

@ -0,0 +1,136 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrrawmaterials.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import vip.xiaonuo.core.consts.CommonConstant;
import vip.xiaonuo.core.enums.CommonStatusEnum;
import vip.xiaonuo.core.exception.ServiceException;
import vip.xiaonuo.core.factory.PageFactory;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.core.util.PoiUtil;
import vip.xiaonuo.modular.scrrawmaterials.entity.ScrRawMaterials;
import vip.xiaonuo.modular.scrrawmaterials.enums.ScrRawMaterialsExceptionEnum;
import vip.xiaonuo.modular.scrrawmaterials.mapper.ScrRawMaterialsMapper;
import vip.xiaonuo.modular.scrrawmaterials.param.ScrRawMaterialsParam;
import vip.xiaonuo.modular.scrrawmaterials.service.ScrRawMaterialsService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* 原材料service接口实现类
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
@Service
public class ScrRawMaterialsServiceImpl extends ServiceImpl<ScrRawMaterialsMapper, ScrRawMaterials> implements ScrRawMaterialsService {
@Override
public PageResult<ScrRawMaterials> page(ScrRawMaterialsParam scrRawMaterialsParam) {
QueryWrapper<ScrRawMaterials> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotNull(scrRawMaterialsParam)) {
// 根据日期 查询
if (ObjectUtil.isNotEmpty(scrRawMaterialsParam.getConsumptionDay())) {
queryWrapper.lambda().eq(ScrRawMaterials::getConsumptionDay, scrRawMaterialsParam.getConsumptionDay());
}
// 根据炉号 查询
if (ObjectUtil.isNotEmpty(scrRawMaterialsParam.getFurnaceNumber())) {
queryWrapper.lambda().eq(ScrRawMaterials::getFurnaceNumber, scrRawMaterialsParam.getFurnaceNumber());
}
// 根据原材料 查询
if (ObjectUtil.isNotEmpty(scrRawMaterialsParam.getRawMaterials())) {
queryWrapper.lambda().eq(ScrRawMaterials::getRawMaterials, scrRawMaterialsParam.getRawMaterials());
}
// 根据用量 查询
if (ObjectUtil.isNotEmpty(scrRawMaterialsParam.getConsumption())) {
queryWrapper.lambda().eq(ScrRawMaterials::getConsumption, scrRawMaterialsParam.getConsumption());
}
}
return new PageResult<>(this.page(PageFactory.defaultPage(), queryWrapper));
}
@Override
public List<ScrRawMaterials> list(ScrRawMaterialsParam scrRawMaterialsParam) {
return this.list();
}
@Override
public void add(ScrRawMaterialsParam scrRawMaterialsParam) {
ScrRawMaterials scrRawMaterials = new ScrRawMaterials();
BeanUtil.copyProperties(scrRawMaterialsParam, scrRawMaterials);
this.save(scrRawMaterials);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void delete(List<ScrRawMaterialsParam> scrRawMaterialsParamList) {
scrRawMaterialsParamList.forEach(scrRawMaterialsParam -> {
this.removeById(scrRawMaterialsParam.getId());
});
}
@Transactional(rollbackFor = Exception.class)
@Override
public void edit(ScrRawMaterialsParam scrRawMaterialsParam) {
ScrRawMaterials scrRawMaterials = this.queryScrRawMaterials(scrRawMaterialsParam);
BeanUtil.copyProperties(scrRawMaterialsParam, scrRawMaterials);
this.updateById(scrRawMaterials);
}
@Override
public ScrRawMaterials detail(ScrRawMaterialsParam scrRawMaterialsParam) {
return this.queryScrRawMaterials(scrRawMaterialsParam);
}
/**
* 获取原材料
*
* @author zyn
* @date 2025-09-10 10:03:02
*/
private ScrRawMaterials queryScrRawMaterials(ScrRawMaterialsParam scrRawMaterialsParam) {
ScrRawMaterials scrRawMaterials = this.getById(scrRawMaterialsParam.getId());
if (ObjectUtil.isNull(scrRawMaterials)) {
throw new ServiceException(ScrRawMaterialsExceptionEnum.NOT_EXIST);
}
return scrRawMaterials;
}
@Override
public void export(ScrRawMaterialsParam scrRawMaterialsParam) {
List<ScrRawMaterials> list = this.list(scrRawMaterialsParam);
PoiUtil.exportExcelWithStream("SnowyScrRawMaterials.xls", ScrRawMaterials.class, list);
}
}

View File

@ -0,0 +1,154 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrsecurity.controller;
import vip.xiaonuo.core.annotion.BusinessLog;
import vip.xiaonuo.core.annotion.Permission;
import vip.xiaonuo.core.enums.LogAnnotionOpTypeEnum;
import vip.xiaonuo.core.pojo.response.ResponseData;
import vip.xiaonuo.core.pojo.response.SuccessResponseData;
import vip.xiaonuo.modular.scrproduction.param.ScrProductionParam;
import vip.xiaonuo.modular.scrsecurity.param.ScrSecurityParam;
import vip.xiaonuo.modular.scrsecurity.service.ScrSecurityService;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource;
import java.util.List;
/**
* 安全异常事件控制器
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@RestController
public class ScrSecurityController {
@Resource
private ScrSecurityService scrSecurityService;
/**
* 查询安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@Permission
@GetMapping("/scrSecurity/page")
@BusinessLog(title = "安全异常事件_查询", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData page(ScrSecurityParam scrSecurityParam) {
return new SuccessResponseData(scrSecurityService.page(scrSecurityParam));
}
/**
* 添加安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@Permission
@PostMapping("/scrSecurity/add")
@BusinessLog(title = "安全异常事件_增加", opType = LogAnnotionOpTypeEnum.ADD)
public ResponseData add(@RequestBody @Validated(ScrSecurityParam.add.class) ScrSecurityParam scrSecurityParam) {
scrSecurityService.add(scrSecurityParam);
return new SuccessResponseData();
}
/**
* 删除安全异常事件可批量删除
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@Permission
@PostMapping("/scrSecurity/delete")
@BusinessLog(title = "安全异常事件_删除", opType = LogAnnotionOpTypeEnum.DELETE)
public ResponseData delete(@RequestBody @Validated(ScrSecurityParam.delete.class) List<ScrSecurityParam> scrSecurityParamList) {
scrSecurityService.delete(scrSecurityParamList);
return new SuccessResponseData();
}
/**
* 编辑安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@Permission
@PostMapping("/scrSecurity/edit")
@BusinessLog(title = "安全异常事件_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
public ResponseData edit(@RequestBody @Validated(ScrSecurityParam.edit.class) ScrSecurityParam scrSecurityParam) {
scrSecurityService.edit(scrSecurityParam);
return new SuccessResponseData();
}
/**
* 查看安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@Permission
@GetMapping("/scrSecurity/detail")
@BusinessLog(title = "安全异常事件_查看", opType = LogAnnotionOpTypeEnum.DETAIL)
public ResponseData detail(@Validated(ScrSecurityParam.detail.class) ScrSecurityParam scrSecurityParam) {
return new SuccessResponseData(scrSecurityService.detail(scrSecurityParam));
}
/**
* 安全异常事件列表
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@Permission
@GetMapping("/scrSecurity/list")
@BusinessLog(title = "安全异常事件_列表", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData list(ScrSecurityParam scrSecurityParam) {
return new SuccessResponseData(scrSecurityService.list(scrSecurityParam));
}
/**
* 导出系统用户
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@Permission
@GetMapping("/scrSecurity/export")
@BusinessLog(title = "安全异常事件_导出", opType = LogAnnotionOpTypeEnum.EXPORT)
public void export(ScrSecurityParam scrSecurityParam) {
scrSecurityService.export(scrSecurityParam);
}
@GetMapping("/scrSecurity/driQuery")
@BusinessLog(title = "安全异常事件_大屏查询", opType = LogAnnotionOpTypeEnum.QUERY)
public ResponseData driQuery(ScrSecurityParam scrSecurityParam) {
return new SuccessResponseData(scrSecurityService.driQuery(scrSecurityParam));
}
}

View File

@ -0,0 +1,87 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrsecurity.entity;
import com.baomidou.mybatisplus.annotation.*;
import vip.xiaonuo.core.pojo.base.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.*;
import cn.afterturn.easypoi.excel.annotation.Excel;
/**
* 安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("scr_security")
public class ScrSecurity extends BaseEntity {
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 发生时间
*/
@Excel(name = "发生时间", databaseFormat = "yyyy-MM-dd HH:mm:ss", format = "yyyy-MM-dd", width = 20)
private Date happenTime;
/**
* 事件类型
*/
@Excel(name = "事件类型")
private String eventType;
/**
* 标题
*/
@Excel(name = "标题")
private String title;
/**
* 内容
*/
@Excel(name = "内容")
private String content;
/**
* 应对处理
*/
@Excel(name = "应对处理")
private String cope;
/**
* 责任主体
*/
@Excel(name = "责任主体")
private String responsible;
}

View File

@ -0,0 +1,64 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrsecurity.enums;
import vip.xiaonuo.core.annotion.ExpEnumType;
import vip.xiaonuo.core.exception.enums.abs.AbstractBaseExceptionEnum;
import vip.xiaonuo.core.factory.ExpEnumCodeFactory;
import vip.xiaonuo.sys.core.consts.SysExpEnumConstant;
/**
* 安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@ExpEnumType(module = SysExpEnumConstant.SNOWY_SYS_MODULE_EXP_CODE)
public enum ScrSecurityExceptionEnum implements AbstractBaseExceptionEnum {
/**
* 数据不存在
*/
NOT_EXIST(1, "此数据不存在");
private final Integer code;
private final String message;
ScrSecurityExceptionEnum(Integer code, String message) {
this.code = code;
this.message = message;
}
@Override
public Integer getCode() {
return ExpEnumCodeFactory.getExpEnumCode(this.getClass(), code);
}
@Override
public String getMessage() {
return message;
}
}

View File

@ -0,0 +1,37 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrsecurity.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import vip.xiaonuo.modular.scrsecurity.entity.ScrSecurity;
/**
* 安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
public interface ScrSecurityMapper extends BaseMapper<ScrSecurity> {
}

View File

@ -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="vip.xiaonuo.modular.scrsecurity.mapper.ScrSecurityMapper">
</mapper>

View File

@ -0,0 +1,87 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrsecurity.param;
import vip.xiaonuo.core.pojo.base.param.BaseParam;
import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import java.util.*;
/**
* 安全异常事件参数类
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@Data
public class ScrSecurityParam extends BaseParam {
/**
* 主键
*/
@NotNull(message = "主键不能为空请检查id参数", groups = {edit.class, delete.class, detail.class})
private Long id;
/**
* 发生时间
*/
@NotNull(message = "发生时间不能为空请检查happenTime参数", groups = {add.class, edit.class})
private String happenTime;
/**
* 事件类型
*/
@NotBlank(message = "事件类型不能为空请检查eventType参数", groups = {add.class, edit.class})
private String eventType;
/**
* 标题
*/
@NotBlank(message = "标题不能为空请检查title参数", groups = {add.class, edit.class})
private String title;
/**
* 内容
*/
@NotBlank(message = "内容不能为空请检查content参数", groups = {add.class, edit.class})
private String content;
/**
* 应对处理
*/
@NotBlank(message = "应对处理不能为空请检查cope参数", groups = {add.class, edit.class})
private String cope;
/**
* 责任主体
*/
@NotBlank(message = "责任主体不能为空请检查responsible参数", groups = {add.class, edit.class})
private String responsible;
private Integer year;
private Integer month;
private Date startDate;
private Date endDate;
}

View File

@ -0,0 +1,98 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrsecurity.service;
import com.baomidou.mybatisplus.extension.service.IService;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.modular.scrsecurity.entity.ScrSecurity;
import vip.xiaonuo.modular.scrsecurity.param.ScrSecurityParam;
import java.util.List;
/**
* 安全异常事件service接口
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
public interface ScrSecurityService extends IService<ScrSecurity> {
/**
* 查询安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
PageResult<ScrSecurity> page(ScrSecurityParam scrSecurityParam);
/**
* 安全异常事件列表
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
List<ScrSecurity> list(ScrSecurityParam scrSecurityParam);
/**
* 添加安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
void add(ScrSecurityParam scrSecurityParam);
/**
* 删除安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
void delete(List<ScrSecurityParam> scrSecurityParamList);
/**
* 编辑安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
void edit(ScrSecurityParam scrSecurityParam);
/**
* 查看安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
ScrSecurity detail(ScrSecurityParam scrSecurityParam);
/**
* 导出安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
void export(ScrSecurityParam scrSecurityParam);
List<ScrSecurity> driQuery(ScrSecurityParam scrSecurityParam);
}

View File

@ -0,0 +1,185 @@
/*
Copyright [2020] [https://www.xiaonuo.vip]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Snowy采用APACHE LICENSE 2.0开源协议您在使用过程中需要注意以下几点
1.请不要删除和修改根目录下的LICENSE文件
2.请不要删除和修改Snowy源码头部的版权声明
3.请保留源码和相关描述文件的项目出处作者声明等
4.分发源码时候请注明软件出处 https://gitee.com/xiaonuobase/snowy
5.在修改包名模块名称项目代码等时请注明软件出处 https://gitee.com/xiaonuobase/snowy
6.若您的项目无法满足以上几点可申请商业授权获取Snowy商业授权许可请在官网购买授权地址为 https://www.xiaonuo.vip
*/
package vip.xiaonuo.modular.scrsecurity.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import vip.xiaonuo.core.consts.CommonConstant;
import vip.xiaonuo.core.enums.CommonStatusEnum;
import vip.xiaonuo.core.exception.ServiceException;
import vip.xiaonuo.core.factory.PageFactory;
import vip.xiaonuo.core.pojo.page.PageResult;
import vip.xiaonuo.core.util.PoiUtil;
import vip.xiaonuo.modular.scrsecurity.entity.ScrSecurity;
import vip.xiaonuo.modular.scrsecurity.enums.ScrSecurityExceptionEnum;
import vip.xiaonuo.modular.scrsecurity.mapper.ScrSecurityMapper;
import vip.xiaonuo.modular.scrsecurity.param.ScrSecurityParam;
import vip.xiaonuo.modular.scrsecurity.service.ScrSecurityService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**
* 安全异常事件service接口实现类
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
@Service
public class ScrSecurityServiceImpl extends ServiceImpl<ScrSecurityMapper, ScrSecurity> implements ScrSecurityService {
@Override
public PageResult<ScrSecurity> page(ScrSecurityParam scrSecurityParam) {
QueryWrapper<ScrSecurity> queryWrapper = new QueryWrapper<>();
if (ObjectUtil.isNotNull(scrSecurityParam)) {
// 根据发生时间 查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getHappenTime())) {
queryWrapper.lambda().eq(ScrSecurity::getHappenTime, scrSecurityParam.getHappenTime());
}
// 根据事件类型 查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getEventType())) {
queryWrapper.lambda().eq(ScrSecurity::getEventType, scrSecurityParam.getEventType());
}
// 根据标题 查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getTitle())) {
queryWrapper.lambda().eq(ScrSecurity::getTitle, scrSecurityParam.getTitle());
}
// 根据内容 查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getContent())) {
queryWrapper.lambda().eq(ScrSecurity::getContent, scrSecurityParam.getContent());
}
// 根据应对处理 查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getCope())) {
queryWrapper.lambda().eq(ScrSecurity::getCope, scrSecurityParam.getCope());
}
// 根据责任主体 查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getResponsible())) {
queryWrapper.lambda().eq(ScrSecurity::getResponsible, scrSecurityParam.getResponsible());
}
}
return new PageResult<>(this.page(PageFactory.defaultPage(), queryWrapper));
}
@Override
public List<ScrSecurity> list(ScrSecurityParam scrSecurityParam) {
return this.list();
}
@Override
public void add(ScrSecurityParam scrSecurityParam) {
ScrSecurity scrSecurity = new ScrSecurity();
BeanUtil.copyProperties(scrSecurityParam, scrSecurity);
this.save(scrSecurity);
}
@Transactional(rollbackFor = Exception.class)
@Override
public void delete(List<ScrSecurityParam> scrSecurityParamList) {
scrSecurityParamList.forEach(scrSecurityParam -> {
this.removeById(scrSecurityParam.getId());
});
}
@Transactional(rollbackFor = Exception.class)
@Override
public void edit(ScrSecurityParam scrSecurityParam) {
ScrSecurity scrSecurity = this.queryScrSecurity(scrSecurityParam);
BeanUtil.copyProperties(scrSecurityParam, scrSecurity);
this.updateById(scrSecurity);
}
@Override
public ScrSecurity detail(ScrSecurityParam scrSecurityParam) {
return this.queryScrSecurity(scrSecurityParam);
}
/**
* 获取安全异常事件
*
* @author zyn
* @date 2025-09-10 10:03:04
*/
private ScrSecurity queryScrSecurity(ScrSecurityParam scrSecurityParam) {
ScrSecurity scrSecurity = this.getById(scrSecurityParam.getId());
if (ObjectUtil.isNull(scrSecurity)) {
throw new ServiceException(ScrSecurityExceptionEnum.NOT_EXIST);
}
return scrSecurity;
}
@Override
public void export(ScrSecurityParam scrSecurityParam) {
List<ScrSecurity> list = this.list(scrSecurityParam);
PoiUtil.exportExcelWithStream("SnowyScrSecurity.xls", ScrSecurity.class, list);
}
@Override
public List<ScrSecurity> driQuery(ScrSecurityParam scrSecurityParam) {
LambdaQueryWrapper<ScrSecurity> queryWrapper = new LambdaQueryWrapper<>();
if (ObjectUtil.isNotNull(scrSecurityParam)) {
// 根据发生时间精确查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getHappenTime())) {
queryWrapper.apply("DATE(happen_time) = {0}", scrSecurityParam.getHappenTime());
}
// 根据年份查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getYear())) {
// 使用数据库函数提取年份进行比较
queryWrapper.apply("YEAR(happen_time) = {0}", scrSecurityParam.getYear());
}
// 根据年月查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getYear()) &&
ObjectUtil.isNotEmpty(scrSecurityParam.getMonth())) {
queryWrapper.apply("YEAR(happen_time) = {0} AND MONTH(happen_time) = {1}",
scrSecurityParam.getYear(), scrSecurityParam.getMonth());
}
// 根据日期范围查询
if (ObjectUtil.isNotEmpty(scrSecurityParam.getStartDate()) &&
ObjectUtil.isNotEmpty(scrSecurityParam.getEndDate())) {
queryWrapper.between(ScrSecurity::getHappenTime,
scrSecurityParam.getStartDate(), scrSecurityParam.getEndDate());
}
// 其他查询条件保持不变
if (ObjectUtil.isNotEmpty(scrSecurityParam.getEventType())) {
queryWrapper.eq(ScrSecurity::getEventType, scrSecurityParam.getEventType());
}
}
queryWrapper.orderByDesc(ScrSecurity::getHappenTime);
return this.list(queryWrapper);
}
}