From da9cc7cc76e7b295398ae15d7a87e6f308e01a1e Mon Sep 17 00:00:00 2001 From: dfdg <2710245601@qq.com> Date: Sun, 28 Sep 2025 20:06:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=90=E7=BB=B4-=E7=89=A9=E8=B5=84=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dromara/system/api/RemoteUserService.java | 2 + .../system/dubbo/RemoteUserServiceImpl.java | 5 + .../dromara/system/mapper/SysPostMapper.java | 7 + .../system/service/ISysPostService.java | 7 + .../service/impl/SysPostServiceImpl.java | 10 + .../resources/mapper/system/SysPostMapper.xml | 7 + .../controller/GinlongApiController.java | 71 ++ .../daping/domain/GinlongApiEntity.java | 14 + .../dromara/daping/domain/bo/GinlongBo.java | 38 + .../daping/service/IGinlongApiService.java | 36 + .../service/impl/GinlongApiServiceImpl.java | 834 ++++++++++++++++++ .../daping/utils/GinlongApiClient.java | 106 +++ .../OpsBeipinBeijianController.java | 106 +++ .../controller/OpsCaigouPlanController.java | 179 ++++ .../controller/OpsChurukudanController.java | 151 ++++ .../controller/OpsSchedulingController.java | 12 +- .../OpsTenderSupplierInputController.java | 131 +++ .../personnel/domain/OpsBeipinBeijian.java | 66 ++ .../personnel/domain/OpsCaigouPlan.java | 130 +++ .../domain/OpsCaigouPlanChanpin.java | 77 ++ .../personnel/domain/OpsCaigouPlanFiles.java | 51 ++ .../personnel/domain/OpsChurukudan.java | 81 ++ .../domain/OpsTenderSupplierInput.java | 188 ++++ .../domain/bo/OpsBeipinBeijianBo.java | 69 ++ .../personnel/domain/bo/OpsCaigouPlanBo.java | 151 ++++ .../domain/bo/OpsCaigouPlanChanpinBo.java | 83 ++ .../domain/bo/OpsCaigouPlanFilesBo.java | 53 ++ .../personnel/domain/bo/OpsCaigouPlanReq.java | 57 ++ .../personnel/domain/bo/OpsChurukudanBo.java | 83 ++ .../personnel/domain/bo/OpsChurukudanReq.java | 57 ++ .../domain/bo/OpsTenderSupplierInputBo.java | 216 +++++ .../domain/bo/SchedulingUserTypeBo.java | 3 +- .../domain/dto/OpsChurukudanCountDto.java | 42 + .../domain/dto/OpsChurukudanDayCountDto.java | 35 + .../domain/dto/SchedulingUserGroupDTO.java | 1 + .../personnel/domain/dto/UserTypePairDTO.java | 1 + .../domain/enums/OpsCaigouPlanEnum.java | 23 + .../domain/enums/OpsChurukuEnum.java | 19 + .../domain/vo/OpsBeipinBeijianVo.java | 81 ++ .../domain/vo/OpsCaigouPlanChanpinListVo.java | 41 + .../domain/vo/OpsCaigouPlanChanpinVo.java | 91 ++ .../domain/vo/OpsCaigouPlanCountVo.java | 37 + .../domain/vo/OpsCaigouPlanFilesVo.java | 62 ++ .../personnel/domain/vo/OpsCaigouPlanVo.java | 166 ++++ .../domain/vo/OpsChurukudanCountVo.java | 35 + .../domain/vo/OpsChurukudanDayCountVo.java | 34 + .../personnel/domain/vo/OpsChurukudanVo.java | 93 ++ .../domain/vo/OpsTenderSupplierInputVo.java | 226 +++++ .../mapper/OpsBeipinBeijianMapper.java | 15 + .../mapper/OpsCaigouPlanChanpinMapper.java | 15 + .../mapper/OpsCaigouPlanFilesMapper.java | 15 + .../personnel/mapper/OpsCaigouPlanMapper.java | 24 + .../personnel/mapper/OpsChurukudanMapper.java | 33 + .../mapper/OpsTenderSupplierInputMapper.java | 15 + .../service/IOpsBeipinBeijianService.java | 70 ++ .../service/IOpsCaigouPlanChanpinService.java | 78 ++ .../service/IOpsCaigouPlanFilesService.java | 77 ++ .../service/IOpsCaigouPlanService.java | 110 +++ .../service/IOpsChurukudanService.java | 87 ++ .../service/IOpsEquipmentService.java | 3 +- .../service/IOpsSchedulingDateService.java | 3 +- .../service/IOpsSchedulingService.java | 6 +- .../IOpsTenderSupplierInputService.java | 75 ++ .../impl/OpsBeipinBeijianServiceImpl.java | 139 +++ .../impl/OpsCaigouPlanChanpinServiceImpl.java | 145 +++ .../impl/OpsCaigouPlanFilesServiceImpl.java | 141 +++ .../impl/OpsCaigouPlanServiceImpl.java | 303 +++++++ .../impl/OpsChurukudanServiceImpl.java | 220 +++++ .../service/impl/OpsEquipmentServiceImpl.java | 3 +- .../impl/OpsSchedulingDateServiceImpl.java | 3 +- .../impl/OpsSchedulingServiceImpl.java | 50 +- .../OpsTenderSupplierInputServiceImpl.java | 251 ++++++ .../personnel/utils/CglxdIdGenerator.java | 44 + .../personnel/OpsBeipinBeijianMapper.xml | 7 + .../personnel/OpsCaigouPlanChanpinMapper.xml | 7 + .../personnel/OpsCaigouPlanFilesMapper.xml | 7 + .../mapper/personnel/OpsCaigouPlanMapper.xml | 30 + .../mapper/personnel/OpsChurukudanMapper.xml | 66 ++ .../OpsTenderSupplierInputMapper.xml | 7 + 79 files changed, 6094 insertions(+), 23 deletions(-) create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/controller/GinlongApiController.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/domain/GinlongApiEntity.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/domain/bo/GinlongBo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/service/IGinlongApiService.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/service/impl/GinlongApiServiceImpl.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/utils/GinlongApiClient.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsBeipinBeijianController.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsCaigouPlanController.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsChurukudanController.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsTenderSupplierInputController.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsBeipinBeijian.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlan.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlanChanpin.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlanFiles.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsChurukudan.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsTenderSupplierInput.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsBeipinBeijianBo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanBo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanChanpinBo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanFilesBo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanReq.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsChurukudanBo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsChurukudanReq.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsTenderSupplierInputBo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/OpsChurukudanCountDto.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/OpsChurukudanDayCountDto.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/enums/OpsCaigouPlanEnum.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/enums/OpsChurukuEnum.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsBeipinBeijianVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanChanpinListVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanChanpinVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanCountVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanFilesVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanCountVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanDayCountVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsTenderSupplierInputVo.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsBeipinBeijianMapper.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanChanpinMapper.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanFilesMapper.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanMapper.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsChurukudanMapper.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsTenderSupplierInputMapper.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsBeipinBeijianService.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanChanpinService.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanFilesService.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanService.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsChurukudanService.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsTenderSupplierInputService.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsBeipinBeijianServiceImpl.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanChanpinServiceImpl.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanFilesServiceImpl.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanServiceImpl.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsChurukudanServiceImpl.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsTenderSupplierInputServiceImpl.java create mode 100644 ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/utils/CglxdIdGenerator.java create mode 100644 ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsBeipinBeijianMapper.xml create mode 100644 ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanChanpinMapper.xml create mode 100644 ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanFilesMapper.xml create mode 100644 ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanMapper.xml create mode 100644 ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsChurukudanMapper.xml create mode 100644 ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsTenderSupplierInputMapper.xml diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteUserService.java b/ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteUserService.java index 6d66549..e2d6faa 100644 --- a/ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteUserService.java +++ b/ruoyi-api/ruoyi-api-system/src/main/java/org/dromara/system/api/RemoteUserService.java @@ -190,4 +190,6 @@ public interface RemoteUserService { Map selectPostNamesByIds(List postIds); RemoteUserVo selectUserByPhonenumber(String phone); + + String getPostNameByUserId(Long userId); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteUserServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteUserServiceImpl.java index f497531..2e47d31 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteUserServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/dubbo/RemoteUserServiceImpl.java @@ -494,4 +494,9 @@ public class RemoteUserServiceImpl implements RemoteUserService { return BeanUtil.copyProperties(sysUserVo, RemoteUserVo.class); } + @Override + public String getPostNameByUserId(Long userId) { + return postService.selectPostNameByUserId(userId); + } + } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysPostMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysPostMapper.java index 2efa5c8..3985a17 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysPostMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/mapper/SysPostMapper.java @@ -2,6 +2,7 @@ package org.dromara.system.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Param; import org.dromara.common.mybatis.annotation.DataColumn; import org.dromara.common.mybatis.annotation.DataPermission; import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; @@ -33,4 +34,10 @@ public interface SysPostMapper extends BaseMapperPlus { */ List selectPostsByUserId(Long userId); + /** + * 根据用户id获取岗位名称 + * @param userId + * @return + */ + String selectPostNameByUserId(@Param("userId") Long userId); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysPostService.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysPostService.java index a760d49..ad36c8e 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysPostService.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/ISysPostService.java @@ -127,4 +127,11 @@ public interface ISysPostService { * @return 结果 */ int updatePost(SysPostBo bo); + + /** + * 根据用户id获取岗位名 + * @param userId + * @return + */ + String selectPostNameByUserId(Long userId); } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java index 942b045..8d9b92d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java @@ -249,4 +249,14 @@ public class SysPostServiceImpl implements ISysPostService { SysPost post = MapstructUtils.convert(bo, SysPost.class); return baseMapper.updateById(post); } + + /** + * 根据用户id获取岗位名 + * @param userId + * @return + */ + @Override + public String selectPostNameByUserId(Long userId) { + return baseMapper.selectPostNameByUserId(userId); + } } diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml index 3c79918..347166f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml @@ -14,5 +14,12 @@ left join sys_user u on u.user_id = up.user_id where u.user_id = #{userId} + diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/controller/GinlongApiController.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/controller/GinlongApiController.java new file mode 100644 index 0000000..4c62312 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/controller/GinlongApiController.java @@ -0,0 +1,71 @@ +package org.dromara.daping.controller; + + +import cn.dev33.satoken.annotation.SaCheckPermission; +import lombok.RequiredArgsConstructor; +import org.dromara.common.core.domain.R; +import org.dromara.common.web.core.BaseController; +import org.dromara.daping.domain.bo.GinlongBo; +import org.dromara.daping.service.IGinlongApiService; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/ginlong/api") +public class GinlongApiController extends BaseController { + + private final IGinlongApiService ginlongApiService; + + + /** + * 查询手续办理清单模板列表 + */ + @SaCheckPermission("formalities:listOfFormalities:list") + @GetMapping("/getPowerStationOverview") + public R> getPowerStationOverview() { + HashMap map = ginlongApiService.getPowerStationOverview(); + return R.ok(map); + } + + /** + * 查询手续办理清单模板列表 + */ + @SaCheckPermission("formalities:listOfFormalities:list") + @GetMapping("/getInverterListOverview") + public R> getInverterListOverview(GinlongBo bo) { + HashMap map = ginlongApiService.getInverterListOverview(bo); + return R.ok(map); + } + + /** + * 能源收益分析 + */ + @SaCheckPermission("formalities:listOfFormalities:list") + @GetMapping("/getStationMonthOverview") + public R> getStationMonthOverview(GinlongBo bo) { + HashMap map = ginlongApiService.getStationMonthOverview(bo); + return R.ok(map); + } + + + /** + * 告警信息 + */ + @SaCheckPermission("formalities:listOfFormalities:list") + @GetMapping("/getAlarmListOverview") + public R>> getAlarmListOverview() { + return R.ok(ginlongApiService.getAlarmListOverview()); + } + + + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/domain/GinlongApiEntity.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/domain/GinlongApiEntity.java new file mode 100644 index 0000000..3144e48 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/domain/GinlongApiEntity.java @@ -0,0 +1,14 @@ +package org.dromara.daping.domain; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Data +@Component // 注册为Spring Bean +@ConfigurationProperties(prefix = "ginlong.api") // 绑定配置文件中前缀为"ginlong.api"的属性 +public class GinlongApiEntity { + private String url; + private String key; + private String secret; +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/domain/bo/GinlongBo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/domain/bo/GinlongBo.java new file mode 100644 index 0000000..579afb1 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/domain/bo/GinlongBo.java @@ -0,0 +1,38 @@ +package org.dromara.daping.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.mybatis.core.domain.BaseEntity; + +import java.io.Serializable; + +/** + * 测试单表业务对象 test_demo + * + * @author Lion Li + * @date 2021-07-26 + */ + +@Data +//@EqualsAndHashCode(callSuper = true) +public class GinlongBo implements Serializable { + + + + /** + * 年月日 + */ + private Integer type; + + /** + * 用户id + */ + private String date; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/service/IGinlongApiService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/service/IGinlongApiService.java new file mode 100644 index 0000000..b2153f6 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/service/IGinlongApiService.java @@ -0,0 +1,36 @@ +package org.dromara.daping.service; + +import org.dromara.daping.domain.bo.GinlongBo; + +import java.util.HashMap; +import java.util.List; + +public interface IGinlongApiService { + + String test(); + + /** + * 查询电站数据 + * @return + */ + HashMap getPowerStationOverview(); + + /** + * 查询逆变器数据 + * @return + */ + HashMap getInverterListOverview(GinlongBo bo); + + + /** + * 查询能源收益分析 + * @param bo + * @return + */ + HashMap getStationMonthOverview(GinlongBo bo); + + /** + * 查询全部设备报警信息 + */ + List> getAlarmListOverview(); +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/service/impl/GinlongApiServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/service/impl/GinlongApiServiceImpl.java new file mode 100644 index 0000000..c4c078b --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/service/impl/GinlongApiServiceImpl.java @@ -0,0 +1,834 @@ +package org.dromara.daping.service.impl; + +import cn.hutool.json.JSONArray; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import lombok.val; +import org.dromara.common.core.exception.ServiceException; +import org.dromara.common.redis.utils.RedisUtils; +import org.dromara.daping.domain.GinlongApiEntity; +import org.dromara.daping.domain.bo.GinlongBo; +import org.dromara.daping.service.IGinlongApiService; +import org.dromara.daping.utils.GinlongApiClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.YearMonth; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +@Slf4j +@RequiredArgsConstructor +@Service +public class GinlongApiServiceImpl implements IGinlongApiService { + + @Autowired + private GinlongApiClient apiClient; + + @Autowired + private StringRedisTemplate stringRedisTemplate; + + public GinlongApiEntity getGinlongApiEntity(){ + + + GinlongApiEntity apiEntity = new GinlongApiEntity(); + apiEntity.setUrl("https://api.ginlong.com:13333"); + apiEntity.setKey("1300386381676987116"); + apiEntity.setSecret("511045d99416484cb93acc2f16a5c149"); + + return apiEntity; + } + + + @Override + public String test() { +// AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(GinlongApiTest.class); + + // 验证GinlongApiEntity是否正确加载 + GinlongApiEntity apiEntity = new GinlongApiEntity(); +// GinlongApiEntity apiEntity = context.getBean(GinlongApiEntity.class); +// System.out.println("加载的配置信息:"+apiEntity.toString()); +// System.out.println("url: " + apiEntity.getUrl()); +// System.out.println("key: " + apiEntity.getKey()); +// System.out.println("secret: " + apiEntity.getSecret()); // 重点检查是否为null + +// apiEntity.setUrl("https://api.ginlong.com:13333"); +// apiEntity.setKey("1300386381676987116"); +// apiEntity.setSecret("511045d99416484cb93acc2f16a5c149"); + + if (apiEntity.getSecret() == null) { + System.err.println("错误:secret未加载,请检查配置文件!"); +// context.close(); + return ""; + } + + // 调用API(原有逻辑) +// GinlongApiClient apiClient = context.getBean(GinlongApiClient.class); + try { + Map params = new HashMap<>(); + params.put("pageNo", 1); + params.put("pageSize", 100); + params.put("nmiCode",null); + params.put("idList",new ArrayList<>()); + String s = apiClient.callApi("/v1/api/userStationList", params,apiEntity); + System.out.println("!!!! " +s); + } catch (Exception e) { + e.printStackTrace(); + } finally { +// context.close(); + } + return ""; + } + + /** + * 获取账号下电站列表 + * @param apiEntity + * @return + */ + public String userStationList(GinlongApiEntity apiEntity){ + try { + Map params = new HashMap<>(); + params.put("pageNo", 1); + params.put("pageSize", 100); + params.put("nmiCode",null); + params.put("idList",new ArrayList<>()); + return apiClient.callApi("/v1/api/userStationList", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 获取多个电站详情 + */ + public String stationDetailList(GinlongApiEntity apiEntity, List idList){ + try { + Map params = new HashMap<>(); + params.put("pageNo", 1); + params.put("pageSize", 100); + params.put("idList",idList); + return apiClient.callApi("/v1/api/stationDetailList", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 获取所有逆变器详情 + */ + public String inverterList(GinlongApiEntity apiEntity){ + try { + Map params = new HashMap<>(); + params.put("pageNo", 1); + params.put("pageSize", 100); + return apiClient.callApi("/v1/api/inverterList", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 获取账号下设备报警列表 + */ + public String alarmList(GinlongApiEntity apiEntity){ + try { + Map params = new HashMap<>(); + params.put("pageNo", 1); + params.put("pageSize", 100); + return apiClient.callApi("/v1/api/alarmList", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 获取单台逆变器某月的日数据 + */ + public String inverterMonth(GinlongApiEntity apiEntity, Long id, String date){ + try { + Map params = new HashMap<>(); + params.put("id", id); + params.put("money", "元"); + params.put("month", date); + + return apiClient.callApi("/v1/api/inverterMonth", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + /** + * 获取单台逆变器某年的月数据 + */ + public String inverterYear(GinlongApiEntity apiEntity, Long id, String date){ + try { + Map params = new HashMap<>(); + params.put("id", id); + params.put("money", "元"); + params.put("year", date); + + return apiClient.callApi("/v1/api/inverterYear", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 获取单台逆变器某日的实时数据 + */ + public String inverterDay(GinlongApiEntity apiEntity, Long id, String date){ + try { + Map params = new HashMap<>(); + params.put("id", id); + params.put("money", "元"); + params.put("time", date); + params.put("timeZone", 8); + + return apiClient.callApi("/v1/api/inverterDay", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 获取单个电站某日的实时数据 + */ + public String stationDay(GinlongApiEntity apiEntity, Long id, String date){ + try { + Map params = new HashMap<>(); + params.put("id", id); + params.put("money", "CNY"); + params.put("time", date); + return apiClient.callApi("/v1/api/stationDay", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + /** + * 获取单个电站某月的日数据 + */ + public String stationMonth(GinlongApiEntity apiEntity, Long id, String date){ + try { + Map params = new HashMap<>(); + params.put("id", id); + params.put("money", "CNY"); + params.put("month", date); + return apiClient.callApi("/v1/api/stationMonth", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + /** + * 获取单个电站某年的月数据 + */ + public String stationYear(GinlongApiEntity apiEntity, Long id, String date){ + try { + Map params = new HashMap<>(); + params.put("id", id); + params.put("money", "CNY"); + params.put("year", date); + return apiClient.callApi("/v1/api/stationYear", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + +// /** +// * 获取多个电站某日的实时数据 +// */ +// public String stationDayEnergyList(GinlongApiEntity apiEntity, List idList, String date){ +// try { +// Map params = new HashMap<>(); +// params.put("idList", idList); +// params.put("time", date); +// return apiClient.callApi("/v1/api/stationDayEnergyList", params,apiEntity); +// } catch (Exception e) { +// throw new ServiceException(e.getMessage()); +// } +// } +// /** +// * 获取多个电站的月数据 +// */ +// public String stationMonthEnergyList(GinlongApiEntity apiEntity, List idList, String date){ +// try { +// Map params = new HashMap<>(); +// params.put("idList", idList); +// params.put("time", date); +// return apiClient.callApi("/v1/api/stationMonthEnergyList", params,apiEntity); +// } catch (Exception e) { +// throw new ServiceException(e.getMessage()); +// } +// } +// /** +// * 获取多个电站的年数据 +// */ +// public String stationYearEnergyList(GinlongApiEntity apiEntity, List idList, String date){ +// try { +// Map params = new HashMap<>(); +// params.put("idList", idList); +// params.put("time", date); +// return apiClient.callApi("/v1/api/stationYearEnergyList", params,apiEntity); +// } catch (Exception e) { +// throw new ServiceException(e.getMessage()); +// } +// } + + + + + + /** + * 获取单个电站详情 + */ + public String stationDetail(GinlongApiEntity apiEntity, Long id){ + try { + Map params = new HashMap<>(); + params.put("id", id); + return apiClient.callApi("/v1/api/stationDetail", params,apiEntity); + } catch (Exception e) { + throw new ServiceException(e.getMessage()); + } + } + + + /** + * 获取电站总览数据信息 + * @return + */ + @Override + public HashMap getPowerStationOverview() { + + HashMap map = new HashMap<>(); + GinlongApiEntity apiEntity = getGinlongApiEntity(); + + double dayEnergy = 0.0; //今日总发电量 + + List idList = new ArrayList<>(); + //使用获取账号下电站列表接口获取数据 + String s = userStationList(apiEntity); + String s2 = inverterList(apiEntity); + getInverterList(s2, map); + getUserStationList(s, idList, map); + + //使用获取多个电站详情接口获取数据 + String s1 = stationDetailList(apiEntity, idList); +// System.out.println(s1); + getStationDetailList(s1, dayEnergy, map); + + + System.out.println(map); + + + return map; + } + + private void getInverterList(String s2, HashMap map) { + JSONObject jsonObject = JSONUtil.parseObj(s2); + JSONObject data = jsonObject.getJSONObject("data"); + JSONObject inverterStatusVo = data.getJSONObject("inverterStatusVo"); +// Object obj = RedisUtils.getCacheObject("health"); +// RedisUtils.getCacheObject() +// String username = redisTemplate.get("username"); +// Double healthOld = redisTemplate.opsForValue().get("health"); + String healthOld = stringRedisTemplate.opsForValue().get("health"); + map.put("healthOld", healthOld != null ? Double.parseDouble(healthOld) : 0.0); +// if (obj != null) { +// double healthOld = Double.parseDouble(String.valueOf(obj)); +// // 使用 value +// map.put("healthOld",healthOld ); +// }else { +// map.put("healthOld",0.0 ); +// +// } + if (inverterStatusVo.getInt("all") >0){ + double health = (double) (inverterStatusVo.getInt("all") - inverterStatusVo.getInt("fault")) /inverterStatusVo.getInt("all") * 100;//健康度 + map.put("health", health);//健康度 + }else { + map.put("health", 0);//健康度 + } + } + private static void getInverterList1(String s2) { + JSONObject jsonObject = JSONUtil.parseObj(s2); + JSONObject data = jsonObject.getJSONObject("data"); + JSONObject inverterStatusVo = data.getJSONObject("inverterStatusVo"); + if (inverterStatusVo.getInt("all") >0){ + double health = (double) (inverterStatusVo.getInt("all") - inverterStatusVo.getInt("fault")) /inverterStatusVo.getInt("all") * 100;//健康度 + RedisUtils.setCacheObject("health",health); + }else { + RedisUtils.setCacheObject("health",0); + } + RedisUtils.expire("health",86400); + } + + /** + * 获取逆电器数据 + * @param bo + * @return + */ + @Override + public HashMap getInverterListOverview(GinlongBo bo) { + HashMap map = new HashMap<>(); + GinlongApiEntity apiEntity = getGinlongApiEntity(); + String s = inverterList(apiEntity); + JSONObject jsonObject = JSONUtil.parseObj(s); + JSONObject data = jsonObject.getJSONObject("data"); + JSONObject inverterStatusVo = data.getJSONObject("inverterStatusVo"); + map.put("all",inverterStatusVo.getInt("all"));//全部 + map.put("normal",inverterStatusVo.getInt("normal"));//正常 + map.put("offline",inverterStatusVo.getInt("offline"));//离线 + map.put("fault",inverterStatusVo.getInt("fault"));//异常 + JSONObject page = data.getJSONObject("page"); + JSONArray records = page.getJSONArray("records"); + List ids = new ArrayList<>(); + if (!records.isEmpty()) { + for (Object record : records) { + JSONObject object = JSONUtil.parseObj(record); + ids.add(object.getLong("id")); + } + } + + + List> hashMaps = new ArrayList<>(); + switch (bo.getType()) { + case 1: + String s1 = inverterDay(apiEntity, ids.getFirst(), bo.getDate()); + JSONObject jsonObject1 = JSONUtil.parseObj(s1); + JSONArray data1 = jsonObject1.getJSONArray("data"); + int a = 0; + for (int i = 0; i < 12; i++) { + double count = 0.0; + HashMap map1 = new HashMap<>(); + String time = i*2+2<10?"0"+i*2+2:(i*2+2)+""; + map1.put("time", i*2<10?"0"+i*2+":00":i*2+":00"); + if (data1 != null && !data1.isEmpty()){ + for (int x = a; x < data1.size(); x++) { + Object obj = data1.get(x); // 通过索引获取元素 + JSONObject object = JSONUtil.parseObj(obj); + if (object.getStr("time").substring(0, 2).compareTo(time) >0){ + break; + } + count += object.getDouble("pac"); + a++; + } + map1.put("content", count); + hashMaps.add(map1); + continue; + }else { + map1.put("content", 0); + } + hashMaps.add(map1); + } + System.out.println(hashMaps); + break; + case 2: + String s2 = inverterMonth(apiEntity, ids.getFirst(), bo.getDate()); + JSONObject jsonObject2 = JSONUtil.parseObj(s2); + JSONArray data2 = jsonObject2.getJSONArray("data"); + if (data2 != null && !data2.isEmpty()){ + for (Object obj : data2) { + HashMap map2 = new HashMap<>(); + JSONObject object = JSONUtil.parseObj(obj); + map2.put("time", object.getStr("dateStr")); + map2.put("content", object.get("energy")); + hashMaps.add(map2); + } + }else { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); + YearMonth yearMonth = YearMonth.parse(bo.getDate(), formatter); + + int year = yearMonth.getYear(); // 2025 + int monthValue = yearMonth.getMonthValue(); + int day = LocalDate.of(year, monthValue, 1).lengthOfMonth(); + String month = monthValue<10?"0"+monthValue:monthValue+""; + for (int i = 1; i <= day; i++){ + HashMap map1 = new HashMap<>(); + map1.put("time", i<10?month+"-0"+i:month+"-"+i); + map1.put("content", 0); + hashMaps.add(map1); + } + } + break; + case 3: + String s3 = inverterYear(apiEntity, ids.getFirst(), bo.getDate()); + JSONObject jsonObject3 = JSONUtil.parseObj(s3); + JSONArray data3 = jsonObject3.getJSONArray("data"); + System.out.println(data3); + if (data3 != null && !data3.isEmpty()) { + for (Object obj : data3) { + HashMap map3 = new HashMap<>(); + JSONObject object = JSONUtil.parseObj(obj); + map3.put("time", object.getStr("dateStr")); + map3.put("content", object.get("energy")); + hashMaps.add(map3); + } + }else { + for (int i = 1; i <= 12; i++){ + HashMap map1 = new HashMap<>(); + map1.put("time", i<10?bo.getDate()+"-0"+i:bo.getDate()+"-"+i); + map1.put("content", 0); + hashMaps.add(map1); + } + } + break; + default: + break; + } + map.put("data",hashMaps); + System.out.println(map); + return map; + } + + /** + * 能源收益分析 + * @param bo + * @return + */ + @Override + public HashMap getStationMonthOverview(GinlongBo bo) { + HashMap map = new HashMap<>(); + GinlongApiEntity apiEntity = getGinlongApiEntity(); + List idList = new ArrayList<>(); + //使用获取账号下电站列表接口获取数据 + String s = userStationList(apiEntity); + JSONObject jsonObject = JSONUtil.parseObj(s); + JSONObject data = jsonObject.getJSONObject("data"); + JSONObject page = data.getJSONObject("page"); + JSONArray records = page.getJSONArray("records"); + if (!records.isEmpty()){ + for (Object record : records) { + JSONObject object = JSONUtil.parseObj(record); + idList.add(object.getLong("id")); + } + } + List> hashMaps = new ArrayList<>(); + switch (bo.getType()){ + case 1: +// String s1 = stationDay(apiEntity, idList.getFirst(), bo.getDate()); +// System.out.println(s1); +// JSONObject jsonObject1 = JSONUtil.parseObj(s1); +// JSONArray data1 = jsonObject1.getJSONArray("data"); +// int a = 0; +// for (int i = 0; i < 12; i++) { +// double count = 0.0; +// HashMap map1 = new HashMap<>(); +// String time = i * 2 + 2 < 10 ? "0" + i * 2 + 2 : (i * 2 + 2) + ""; +// map1.put("time", i * 2 < 10 ? "0" + i * 2 + ":00" : i * 2 + ":00"); +// if (data1 != null && !data1.isEmpty()) { +// for (int x = a; x < data1.size(); x++) { +// Object obj = data1.get(x); // 通过索引获取元素 +// JSONObject object = JSONUtil.parseObj(obj); +// if (object.getStr("timeStr").substring(0, 2).compareTo(time) > 0) { +// break; +// } +// count += object.getDouble("power"); +// a++; +// } +// map1.put("content", count); +// +// hashMaps.add(map1); +// continue; +// } else { +// map1.put("content", 0); +// } +// hashMaps.add(map1); +// } +// int y = 0; +// for (Long id : idList) { +// String s1 = stationDay(apiEntity, id, bo.getDate()); +// System.out.println(s1); +// JSONObject jsonObject1 = JSONUtil.parseObj(s1); +// JSONArray data1 = jsonObject1.getJSONArray("data"); +// int a = 0; +// for (int i = 0; i < 12; i++) { +// double count = 0.0; +// HashMap map1 = new HashMap<>(); +// String time = i*2+2<10?"0"+i*2+2:(i*2+2)+""; +// if (y == 0){ +// map1.put("time", i*2<10?"0"+i*2+":00":i*2+":00"); +// } +// if (data1 != null && !data1.isEmpty()){ +// for (int x = a; x < data1.size(); x++) { +// Object obj = data1.get(x); // 通过索引获取元素 +// JSONObject object = JSONUtil.parseObj(obj); +// if (object.getStr("timeStr").substring(0, 2).compareTo(time) >0){ +// break; +// } +// count += object.getDouble("power"); +// a++; +// } +// map1.put("content", y == 0 ? count: (hashMaps.get(y).get(time) == null) ? 0.0 : (Double) hashMaps.get(y).get(time) + count); +// +// hashMaps.add(map1); +// continue; +// }else { +// map1.put("content", y == 0 ? 0: (hashMaps.get(y).get(time) == null) ? 0.0 : (Double) hashMaps.get(y).get(time) + 0); +// } +// hashMaps.add(map1); +// } +// y++; +// } + break; + case 2: + String s2 = stationMonth(apiEntity, idList.getFirst(), bo.getDate()); + JSONObject jsonObject2 = JSONUtil.parseObj(s2); + JSONArray data2 = jsonObject2.getJSONArray("data"); + + if (data2 != null && !data2.isEmpty()){ + for (Object obj : data2) { + HashMap map1 = new HashMap<>(); + JSONObject object = JSONUtil.parseObj(obj); + map1.put("time", object.getStr("dateStr")); + map1.put("content", object.get("money")); + hashMaps.add(map1); + } + }else { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM"); + YearMonth yearMonth = YearMonth.parse(bo.getDate(), formatter); + + int year = yearMonth.getYear(); // 2025 + int monthValue = yearMonth.getMonthValue(); + int day = LocalDate.of(year, monthValue, 1).lengthOfMonth(); + String month = monthValue<10?"0"+monthValue:monthValue+""; + for (int i = 1; i <= day; i++){ + HashMap map1 = new HashMap<>(); + map1.put("time", i<10?month+"-0"+i:month+"-"+i); + map1.put("content", 0); + hashMaps.add(map1); + } + } + break; + + case 3: + String s3 = stationYear(apiEntity, idList.getFirst(), bo.getDate()); + JSONObject jsonObject3 = JSONUtil.parseObj(s3); + JSONArray data3 = jsonObject3.getJSONArray("data"); + System.out.println(data3); + if (data3 != null && !data3.isEmpty()) { + for (Object obj : data3) { + HashMap map3 = new HashMap<>(); + JSONObject object = JSONUtil.parseObj(obj); + map3.put("time", object.getStr("dateStr").substring(0, 7)); + map3.put("content", object.get("money")); + hashMaps.add(map3); + } + }else { + for (int i = 1; i <= 12; i++){ + HashMap map1 = new HashMap<>(); + map1.put("time", i<10?bo.getDate()+"-0"+i:bo.getDate()+"-"+i); + map1.put("content", 0); + hashMaps.add(map1); + } + } + break; + + default: + break; + } + + map.put("data",hashMaps); + + String s2 = stationDetail(apiEntity, idList.getFirst()); + JSONObject jsonObject2 = JSONUtil.parseObj(s2); + JSONObject data2 = jsonObject2.getJSONObject("data"); + map.put("allInCome",data2.get("allInCome"));//累计收益 + map.put("monthInCome",data2.get("monthInCome"));//本月收益 + map.put("yearInCome",data2.get("yearInCome"));//本年收益 + map.put("price",data2.get("price"));//每度电收益 + + System.out.println(map); + return map; + } + + /** + * 查询全部设备报警信息 + * @return + */ + @Override + public List> getAlarmListOverview() { + List> list = new ArrayList<>(); + GinlongApiEntity apiEntity = getGinlongApiEntity(); + String s = alarmList(apiEntity); + System.out.println(s); + JSONObject jsonObject = JSONUtil.parseObj(s); + JSONObject data = jsonObject.getJSONObject("data"); + JSONArray records = data.getJSONArray("records"); + for (Object record : records) { + HashMap map = new HashMap<>(); + JSONObject obj = JSONUtil.parseObj(record); + map.put("stationName", obj.get("stationName"));//电站名称 + map.put("alarmLevel", obj.get("alarmLevel")); // 报警等级:1 = 提示,2 = 一般,3 = 紧急 + map.put("alarmBeginTime", obj.get("alarmBeginTime")); //报警开始时间 + map.put("alarmMsg", obj.get("alarmMsg")); //报警内容 + map.put("advice", obj.get("advice")); //报警处理建议 + map.put("state", obj.get("state")); //报警状态:0 = 未处理,1 = 已处理,2 = 已恢复 + if ("1".equals(obj.getStr("state")) || "2".equals(obj.getStr("state"))){ + continue; + } + list.add(map); + } + return list; +// return list.stream().filter(map -> { +// Object statusObj = map.get("state"); +// if (statusObj instanceof Integer) { +// int status = (Integer) statusObj; +// return status == 1 || status == 2; +// } +// return false; +// }).collect(Collectors.toList()); + } + + private void getStationDetailList(String s1, double dayEnergy, HashMap map) { + JSONObject jsonObject = JSONUtil.parseObj(s1); + String dayEnergyOld = stringRedisTemplate.opsForValue().get("dayEnergy"); + map.put("dayEnergyOld", dayEnergyOld != null ? Double.parseDouble(dayEnergyOld) : 0.0); + String powerStationAvoidedCo2Old = stringRedisTemplate.opsForValue().get("powerStationAvoidedCo2"); + map.put("powerStationAvoidedCo2Old", powerStationAvoidedCo2Old != null ? Double.parseDouble(powerStationAvoidedCo2Old) : 0.0); + JSONObject data = jsonObject.getJSONObject("data"); + JSONArray records = data.getJSONArray("records"); + double powerStationAvoidedCo2 = 0.0; + for (Object record : records) { + JSONObject object = JSONUtil.parseObj(record); + dayEnergy += object.getDouble("dayEnergy"); + powerStationAvoidedCo2 += object.getDouble("powerStationAvoidedCo2"); + } + map.put("dayEnergy", dayEnergy);//今日总发电量 + map.put("powerStationAvoidedCo2", powerStationAvoidedCo2);//碳排放量 + } + private static void getStationDetailList1(String s1, double dayEnergy) { + JSONObject jsonObject = JSONUtil.parseObj(s1); + JSONObject data = jsonObject.getJSONObject("data"); + JSONArray records = data.getJSONArray("records"); + double powerStationAvoidedCo2 = 0.0; + for (Object record : records) { + JSONObject object = JSONUtil.parseObj(record); + dayEnergy += object.getDouble("dayEnergy"); + powerStationAvoidedCo2 += object.getDouble("powerStationAvoidedCo2"); + } + RedisUtils.setCacheObject("dayEnergy",dayEnergy);//今日总发电量 + RedisUtils.setCacheObject("powerStationAvoidedCo2",powerStationAvoidedCo2);//碳排放量 + + RedisUtils.expire("dayEnergy",86400); + RedisUtils.expire("powerStationAvoidedCo2",86400); + + } + + private void getUserStationList(String s, List idList, HashMap map) { + JSONObject jsonObject = JSONUtil.parseObj(s); + double capacity = 0.0; // 总装机容量 + int module = 0;//光伏板数量 + double generateElectricity = 0.0;//发电效率 + double batteryTodayDischargeEnergy = 0.0;//放电效率 + double batteryTodayChargeEnergy = 0.0;//充电效率 + String capacityOld = stringRedisTemplate.opsForValue().get("capacity"); + map.put("capacityOld", capacityOld != null ? Double.parseDouble(capacityOld) : 0.0); + String moduleOld = stringRedisTemplate.opsForValue().get("module"); + map.put("moduleOld", moduleOld != null ? Double.parseDouble(moduleOld) : 0.0); + String generateElectricityOld = stringRedisTemplate.opsForValue().get("generateElectricity"); + map.put("generateElectricityOld", generateElectricityOld != null ? Double.parseDouble(generateElectricityOld) : 0.0); + String operatingRateOld = stringRedisTemplate.opsForValue().get("operatingRate"); + map.put("operatingRateOld", operatingRateOld != null ? Double.parseDouble(operatingRateOld) : 0.0); + + JSONObject data = jsonObject.getJSONObject("data"); + JSONObject stationStatusVo = data.getJSONObject("stationStatusVo"); + if (stationStatusVo.getInt("all") >0){ + JSONObject page = data.getJSONObject("page"); + JSONArray records = page.getJSONArray("records"); + int all = stationStatusVo.getInt("all");//全部电站 + if (!records.isEmpty()){ + for (Object record : records) { + JSONObject object = JSONUtil.parseObj(record); + capacity += object.getDouble("capacity"); + batteryTodayDischargeEnergy += object.getDouble("batteryTodayDischargeEnergy"); + batteryTodayChargeEnergy += object.getDouble("batteryTodayChargeEnergy"); + module += object.getInt("module"); + idList.add(object.getLong("id")); + + } + } + if (batteryTodayDischargeEnergy >0){ + generateElectricity = (1-(batteryTodayChargeEnergy/batteryTodayDischargeEnergy))*100; + }else { + generateElectricity = 0; + } + map.put("operatingRate", all);//电站总数 + }else { + map.put("operatingRate", 0.0);//运行率 + } + map.put("capacity", capacity);//总装机容量 + map.put("module", module);//光伏板数量 + map.put("generateElectricity", generateElectricity);//发电效率 + } + + private static void getUserStationList1(String s, List idList) { + JSONObject jsonObject = JSONUtil.parseObj(s); + double capacity = 0.0; // 总装机容量 + int module = 0;//光伏板数量 + double generateElectricity = 0.0;//发电效率 + double batteryTodayDischargeEnergy = 0.0;//放电效率 + double batteryTodayChargeEnergy = 0.0;//充电效率 + JSONObject data = jsonObject.getJSONObject("data"); + JSONObject stationStatusVo = data.getJSONObject("stationStatusVo"); + if (stationStatusVo.getInt("all") >0){ + JSONObject page = data.getJSONObject("page"); + JSONArray records = page.getJSONArray("records"); + int all = stationStatusVo.getInt("all");//全部电站 + int normal = stationStatusVo.getInt("normal");//正常电站 + + if (!records.isEmpty()){ + for (Object record : records) { + JSONObject object = JSONUtil.parseObj(record); + capacity += object.getDouble("capacity"); + batteryTodayDischargeEnergy += object.getDouble("batteryTodayDischargeEnergy"); + batteryTodayChargeEnergy += object.getDouble("batteryTodayChargeEnergy"); + module += object.getInt("module"); + idList.add(object.getLong("id")); + + } + } + if (batteryTodayDischargeEnergy >0){ + generateElectricity = (1-(batteryTodayChargeEnergy/batteryTodayDischargeEnergy))*100; + }else { + generateElectricity = 0; + } + RedisUtils.setCacheObject("operatingRate",all); + }else { + RedisUtils.setCacheObject("operatingRate",0); + } + RedisUtils.setCacheObject("capacity",capacity);//总装机容量 + RedisUtils.setCacheObject("module",module);//光伏板数量 + RedisUtils.setCacheObject("generateElectricity",generateElectricity);//发电效率 + RedisUtils.expire("capacity",86400); + RedisUtils.expire("module",86400); + RedisUtils.expire("generateElectricity",86400); + } + +// @Scheduled(cron = "0 59 23 * * ?") + @Scheduled(initialDelay = 5000) + public void redisSetData(){ + GinlongApiEntity apiEntity = getGinlongApiEntity(); + + double dayEnergy = 0.0; //今日总发电量 + + List idList = new ArrayList<>(); + String s = userStationList(apiEntity); + String s2 = inverterList(apiEntity); + getInverterList1(s2); + getUserStationList1(s, idList); + + //使用获取多个电站详情接口获取数据 + String s1 = stationDetailList(apiEntity, idList); +// System.out.println(s1); + getStationDetailList1(s1, dayEnergy); + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/utils/GinlongApiClient.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/utils/GinlongApiClient.java new file mode 100644 index 0000000..b92512a --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/daping/utils/GinlongApiClient.java @@ -0,0 +1,106 @@ +package org.dromara.daping.utils; + +import cn.hutool.crypto.digest.HMac; +import cn.hutool.crypto.digest.HmacAlgorithm; +import cn.hutool.http.HttpRequest; +import cn.hutool.http.HttpResponse; +import cn.hutool.json.JSONUtil; +import org.dromara.daping.domain.GinlongApiEntity; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.text.SimpleDateFormat; +import java.util.*; + +@Component +public class GinlongApiClient { + + private static final String CONTENT_TYPE = "application/json"; + + // 直接注入从配置文件绑定的实体类 + @Autowired + private GinlongApiEntity apiEntity; + + /** + * 通用API调用方法 + * + * @param path 接口路径(如:/v1/api/userStationList) + * @param params 请求参数(无参数时传null) + * @param apiEntity + * @return 接口返回的JSON字符串 + * @throws Exception 可能的异常(签名失败、网络错误等) + */ + public String callApi(String path, Map params, GinlongApiEntity apiEntity) throws Exception { + // 1. 处理请求体(转为JSON字符串) + String body = (params != null) ? JSONUtil.toJsonStr(params) : "{}"; + // 2. 计算Content-MD5 + String contentMd5 = calcContentMD5(body); + // 3. 获取GMT时间(需在当前时间±15分钟内) + String gmtDate = getGMTDate(); + // 4. 计算签名 + String signature = buildSignature(path, contentMd5, gmtDate,apiEntity); + // 5. 构建完整请求URL + String url = apiEntity.getUrl() + path; + + // 6. 发送POST请求并返回结果 + HttpResponse response = HttpRequest.post(url) + .header("Content-Type", CONTENT_TYPE) + .header("Content-MD5", contentMd5) + .header("Date", gmtDate) + .header("Authorization", "API " + apiEntity.getKey() + ":" + signature) // 使用实体类的key + .body(body) + .execute(); + + return response.body(); + } + + + /** + * 计算Content-MD5(按文档规范) + */ + private String calcContentMD5(String body) { + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(body.getBytes(StandardCharsets.UTF_8)); + byte[] digest = md.digest(); + return Base64.getEncoder().encodeToString(digest); + } catch (Exception e) { + throw new RuntimeException("计算Content-MD5失败", e); + } + } + + /** + * 获取符合格式的GMT时间 + */ + private String getGMTDate() { + //1、获取GMT时区下的当前时间; + Calendar calendar = Calendar.getInstance(); + //2、将当前时间按以下格式转换为字符串。 格式:EEE, d MMM yyyy HH:mm:ss 'GMT'注意:Date 时间不能超出当前时间的正负15分钟,否则会出现调用失败。 + SimpleDateFormat sdf = new SimpleDateFormat( + "EEE, d MMM yyyy HH:mm:ss 'GMT'", + Locale.US + ); + sdf.setTimeZone(TimeZone.getTimeZone("GMT")); + return sdf.format(calendar.getTime()); + } + + + /** + * 构建签名(按文档规范) + */ + private String buildSignature(String path, String contentMd5, String gmtDate, GinlongApiEntity apiEntity) { + // 拼接签名原文 + String signatureText = "POST" + "\n" + + contentMd5 + "\n" + + CONTENT_TYPE + "\n" + + gmtDate + "\n" + + path; + // 计算HmacSHA1并Base64编码 + HMac hmac = new HMac( + HmacAlgorithm.HmacSHA1, + apiEntity.getSecret().getBytes(StandardCharsets.UTF_8)); // 使用实体类的secret + return hmac.digestBase64(signatureText, false); + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsBeipinBeijianController.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsBeipinBeijianController.java new file mode 100644 index 0000000..8c6a3b9 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsBeipinBeijianController.java @@ -0,0 +1,106 @@ +package org.dromara.personnel.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.personnel.domain.vo.OpsBeipinBeijianVo; +import org.dromara.personnel.domain.bo.OpsBeipinBeijianBo; +import org.dromara.personnel.service.IOpsBeipinBeijianService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 运维-物资-备品配件 + * 前端访问路由地址为:/personnel/beipinBeijian + * + * @author LionLi + * @date 2025-09-24 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/beipinBeijian") +public class OpsBeipinBeijianController extends BaseController { + + private final IOpsBeipinBeijianService opsBeipinBeijianService; + + /** + * 查询运维-物资-备品配件列表 + */ + @SaCheckPermission("personnel:beipinBeijian:list") + @GetMapping("/list") + public TableDataInfo list(OpsBeipinBeijianBo bo, PageQuery pageQuery) { + return opsBeipinBeijianService.queryPageList(bo, pageQuery); + } + + /** + * 导出运维-物资-备品配件列表 + */ + @SaCheckPermission("personnel:beipinBeijian:export") + @Log(title = "运维-物资-备品配件", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(OpsBeipinBeijianBo bo, HttpServletResponse response) { + List list = opsBeipinBeijianService.queryList(bo); + ExcelUtil.exportExcel(list, "运维-物资-备品配件", OpsBeipinBeijianVo.class, response); + } + + /** + * 获取运维-物资-备品配件详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("personnel:beipinBeijian:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return R.ok(opsBeipinBeijianService.queryById(id)); + } + + /** + * 新增运维-物资-备品配件 + */ + @SaCheckPermission("personnel:beipinBeijian:add") + @Log(title = "运维-物资-备品配件", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody OpsBeipinBeijianBo bo) { + return toAjax(opsBeipinBeijianService.insertByBo(bo)); + } + + /** + * 修改运维-物资-备品配件 + */ + @SaCheckPermission("personnel:beipinBeijian:edit") + @Log(title = "运维-物资-备品配件", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody OpsBeipinBeijianBo bo) { + return toAjax(opsBeipinBeijianService.updateByBo(bo)); + } + + /** + * 删除运维-物资-备品配件 + * + * @param ids 主键串 + */ + @SaCheckPermission("personnel:beipinBeijian:remove") + @Log(title = "运维-物资-备品配件", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable("ids") Long[] ids) { + return toAjax(opsBeipinBeijianService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsCaigouPlanController.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsCaigouPlanController.java new file mode 100644 index 0000000..1f14f81 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsCaigouPlanController.java @@ -0,0 +1,179 @@ +package org.dromara.personnel.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.dromara.common.core.exception.ServiceException; +import org.dromara.personnel.domain.bo.OpsCaigouPlanReq; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinListVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanCountVo; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.personnel.domain.vo.OpsCaigouPlanVo; +import org.dromara.personnel.domain.bo.OpsCaigouPlanBo; +import org.dromara.personnel.service.IOpsCaigouPlanService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 运维-物资-采购计划单 + * 前端访问路由地址为:/personnel/caigouPlan + * + * @author LionLi + * @date 2025-09-24 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/caigouPlan") +public class OpsCaigouPlanController extends BaseController { + + private final IOpsCaigouPlanService opsCaigouPlanService; + + /** + * 查询运维-物资-采购计划单列表 + */ + @SaCheckPermission("personnel:caigouPlan:list") + @GetMapping("/list") + public TableDataInfo list(OpsCaigouPlanReq bo, PageQuery pageQuery) { + return opsCaigouPlanService.queryPageList(bo, pageQuery); + } + + /** + * 出入库表单新增修改获取产品列表 + */ + @SaCheckPermission("personnel:caigouPlan:list") + @GetMapping("/getChanpinList") + public R> getChanpinList(OpsCaigouPlanReq bo) { + return R.ok(opsCaigouPlanService.getChanpinList(bo)); + } + + + /** + * 查询运维-物资-采购计划单数量统计 + */ + @SaCheckPermission("personnel:caigouPlan:getCount") + @GetMapping("/getCount") + public R> getCount(Long projectId) { + if (projectId == null) { + throw new ServiceException("项目id不能为空!!!"); + } + return R.ok(opsCaigouPlanService.getCountVo(projectId)); + } + + /** + * 查询运维-物资-采购计划单年度金额 + */ + @SaCheckPermission("personnel:caigouPlan:getJinE") + @GetMapping("/getJinE") + public R getJinE(Long projectId) { + if (projectId == null) { + throw new ServiceException("项目id不能为空!!!"); + } + return R.ok(opsCaigouPlanService.getJinE(projectId)); + } + + + + /** + * 导出运维-物资-采购计划单列表 + */ + @SaCheckPermission("personnel:caigouPlan:export") + @Log(title = "运维-物资-采购计划单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(OpsCaigouPlanReq bo, HttpServletResponse response) { + List list = opsCaigouPlanService.queryList(bo); + ExcelUtil.exportExcel(list, "运维-物资-采购计划单", OpsCaigouPlanVo.class, response); + } + + /** + * 获取运维-物资-采购计划单详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("personnel:caigouPlan:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return R.ok(opsCaigouPlanService.queryById(id)); + } + + /** + * 新增运维-物资-采购计划单 + */ + @SaCheckPermission("personnel:caigouPlan:add") + @Log(title = "运维-物资-采购计划单", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody OpsCaigouPlanBo bo) { + return toAjax(opsCaigouPlanService.insertByBo(bo)); + } + + /** + * 修改运维-物资-采购计划单 + */ + @SaCheckPermission("personnel:caigouPlan:edit") + @Log(title = "运维-物资-采购计划单", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody OpsCaigouPlanBo bo) { + return toAjax(opsCaigouPlanService.updateByBo(bo)); + } + + /** + * 修改运维-物资-采购计划单设置采购金额 + */ + @SaCheckPermission("personnel:caigouPlan:edit") + @Log(title = "运维-物资-采购计划单", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("/setJinE") + public R setJinE(@RequestBody OpsCaigouPlanBo bo) { + if (bo.getId() == null) { + throw new ServiceException("id不能为空"); + } + if (bo.getShijiJine() == null) { + throw new ServiceException("采购金额不能为空"); + } + + return toAjax(opsCaigouPlanService.setJinE(bo)); + } + + /** + * 修改运维-物资-采购计划单确认采购完成 + */ + @SaCheckPermission("personnel:caigouPlan:edit") + @Log(title = "运维-物资-采购计划单", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping("/editStatus") + public R editStatus(@RequestBody OpsCaigouPlanBo bo) { + if (bo.getId() == null) { + throw new ServiceException("id不能为空"); + } + return toAjax(opsCaigouPlanService.editStatus(bo)); + } + + /** + * 删除运维-物资-采购计划单 + * + * @param ids 主键串 + */ + @SaCheckPermission("personnel:caigouPlan:remove") + @Log(title = "运维-物资-采购计划单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable("ids") Long[] ids) { + return toAjax(opsCaigouPlanService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsChurukudanController.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsChurukudanController.java new file mode 100644 index 0000000..b4501e1 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsChurukudanController.java @@ -0,0 +1,151 @@ +package org.dromara.personnel.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.dromara.common.core.exception.ServiceException; +import org.dromara.personnel.domain.bo.OpsChurukudanReq; +import org.dromara.personnel.domain.dto.OpsChurukudanCountDto; +import org.dromara.personnel.domain.dto.OpsChurukudanDayCountDto; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.personnel.domain.vo.OpsChurukudanVo; +import org.dromara.personnel.domain.bo.OpsChurukudanBo; +import org.dromara.personnel.service.IOpsChurukudanService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 运维-物资-出入库单管理 + * 前端访问路由地址为:/personnel/churukudan + * + * @author LionLi + * @date 2025-09-24 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/churukudan") +public class OpsChurukudanController extends BaseController { + + private final IOpsChurukudanService opsChurukudanService; + + /** + * 查询运维-物资-出入库单管理列表 + */ + @SaCheckPermission("personnel:churukudan:list") + @GetMapping("/list") + public TableDataInfo list(OpsChurukudanReq bo, PageQuery pageQuery) { + if (bo.getProjectId() == null) { + throw new ServiceException("项目id不能为空!!!"); + } + return opsChurukudanService.queryPageList(bo, pageQuery); + } + + /** + * 查询本月出入库类型 + */ + @SaCheckPermission("personnel:churukudan:list") + @GetMapping("/getChuRuKuCount") + public R getChuRuKuCount(OpsChurukudanReq bo) { + if (bo.getProjectId() == null) { + throw new ServiceException("项目id不能为空!!!"); + } + if (bo.getStartDate() == null || bo.getEndDate() == null) { + throw new ServiceException("查询时间范围不能为空!!!"); + } + if (bo.getStartDate().isAfter(bo.getEndDate())) { + throw new ServiceException("查询开始时间不能大于结束时间!!!"); + } + return R.ok(opsChurukudanService.getChuRuKuCount(bo)); + } + /** + * 查询出入库月中每天的出入库数量 + */ + @SaCheckPermission("personnel:churukudan:list") + @GetMapping("/getChuRuKuDayCount") + public R getChuRuKuDayCount(OpsChurukudanReq bo) { + if (bo.getProjectId() == null) { + throw new ServiceException("项目id不能为空!!!"); + } + if (bo.getStartDate() == null || bo.getEndDate() == null) { + throw new ServiceException("查询时间范围不能为空!!!"); + } + if (bo.getStartDate().isAfter(bo.getEndDate())) { + throw new ServiceException("查询开始时间不能大于结束时间!!!"); + } + return R.ok(opsChurukudanService.getChuRuKuDayCount(bo)); + } + + /** + * 导出运维-物资-出入库单管理列表 + */ + @SaCheckPermission("personnel:churukudan:export") + @Log(title = "运维-物资-出入库单管理", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(OpsChurukudanReq bo, HttpServletResponse response) { + if (bo.getProjectId() == null) { + throw new ServiceException("项目id不能为空!!!"); + } + List list = opsChurukudanService.queryList(bo); + ExcelUtil.exportExcel(list, "运维-物资-出入库单管理", OpsChurukudanVo.class, response); + } + + /** + * 获取运维-物资-出入库单管理详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("personnel:churukudan:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable("id") Long id) { + return R.ok(opsChurukudanService.queryById(id)); + } + + /** + * 新增运维-物资-出入库单管理 + */ + @SaCheckPermission("personnel:churukudan:add") + @Log(title = "运维-物资-出入库单管理", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody OpsChurukudanBo bo) { + return toAjax(opsChurukudanService.insertByBo(bo)); + } + + /** + * 修改运维-物资-出入库单管理 + */ + @SaCheckPermission("personnel:churukudan:edit") + @Log(title = "运维-物资-出入库单管理", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody OpsChurukudanBo bo) { + return toAjax(opsChurukudanService.updateByBo(bo)); + } + + /** + * 删除运维-物资-出入库单管理 + * + * @param ids 主键串 + */ + @SaCheckPermission("personnel:churukudan:remove") + @Log(title = "运维-物资-出入库单管理", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable("ids") Long[] ids) { + return toAjax(opsChurukudanService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsSchedulingController.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsSchedulingController.java index 09a5de3..722049e 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsSchedulingController.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsSchedulingController.java @@ -81,6 +81,16 @@ public class OpsSchedulingController extends BaseController { return R.ok(opsSchedulingService.queryById(id)); } + /** + * 新增运维-人员排班 + */ + @SaCheckPermission("personnel:scheduling:add") + @Log(title = "运维-人员排班", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping("/all") + public R addAll(@Validated(AddGroup.class) @RequestBody OpsSchedulingBo bo) { + return toAjax(opsSchedulingService.insertByBo(bo)); + } /** * 新增运维-人员排班 */ @@ -89,7 +99,7 @@ public class OpsSchedulingController extends BaseController { @RepeatSubmit() @PostMapping() public R add(@Validated(AddGroup.class) @RequestBody OpsSchedulingBo bo) { - return toAjax(opsSchedulingService.insertByBo(bo)); + return toAjax(opsSchedulingService.insertOneByBo(bo)); } /** diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsTenderSupplierInputController.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsTenderSupplierInputController.java new file mode 100644 index 0000000..02bcd3f --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/controller/OpsTenderSupplierInputController.java @@ -0,0 +1,131 @@ +package org.dromara.personnel.controller; + +import java.io.IOException; +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.personnel.domain.vo.OpsTenderSupplierInputVo; +import org.dromara.personnel.domain.bo.OpsTenderSupplierInputBo; +import org.dromara.personnel.service.IOpsTenderSupplierInputService; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.springframework.web.multipart.MultipartFile; + +/** + * 供应商入库 + * 前端访问路由地址为:/personnel/tenderSupplierInput + * + * @author LionLi + * @date 2025-09-24 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/tenderSupplierInput") +public class OpsTenderSupplierInputController extends BaseController { + + private final IOpsTenderSupplierInputService tenderSupplierInputService; + + /** + * 查询供应商入库列表 + */ + @SaCheckPermission("supplierInput:supplierInput:list") + @GetMapping("/list") + public TableDataInfo list(OpsTenderSupplierInputBo bo, PageQuery pageQuery) { + return tenderSupplierInputService.queryPageList(bo, pageQuery); + } + + /** + * 查询供应商入库列表 + */ + @SaCheckPermission("supplierInput:supplierInput:getList") + @GetMapping("/getList") + public R> list(OpsTenderSupplierInputBo bo) { + return R.ok(tenderSupplierInputService.getList(bo)); + } + + /** + * 导出供应商入库列表 + */ + @SaCheckPermission("supplierInput:supplierInput:export") + @Log(title = "供应商入库", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(OpsTenderSupplierInputBo bo, HttpServletResponse response) { + List list = tenderSupplierInputService.queryList(bo); + ExcelUtil.exportExcel(list, "供应商入库", OpsTenderSupplierInputVo.class, response); + } + + /** + * 导入供应商入库 入库资料文件只有导入后修改进行上传 + */ + @SaCheckPermission("supplierInput:supplierInput:import") + @Log(title = "供应商入库", businessType = BusinessType.IMPORT) + @PostMapping("/import") + public R importData(Long projectId,@RequestParam("file") MultipartFile file) throws IOException { + List tenderSupplierInputVos = ExcelUtil.importExcel(file.getInputStream(), OpsTenderSupplierInputVo.class); + + return toAjax(tenderSupplierInputService.importData(tenderSupplierInputVos,projectId)); + } + + /** + * 获取供应商入库详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("supplierInput:supplierInput:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(tenderSupplierInputService.queryById(id)); + } + + /** + * 新增供应商入库 + */ + @SaCheckPermission("supplierInput:supplierInput:add") + @Log(title = "供应商入库", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(OpsTenderSupplierInputBo bo) { + return toAjax(tenderSupplierInputService.insertByBo(bo)); + } + + /** + * 修改供应商入库 + */ + @Transactional + @SaCheckPermission("supplierInput:supplierInput:edit") + @Log(title = "供应商入库", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(OpsTenderSupplierInputBo bo) { + return toAjax(tenderSupplierInputService.updateByBo(bo)); + } + + /** + * 删除供应商入库 + * + * @param ids 主键串 + */ + @SaCheckPermission("supplierInput:supplierInput:remove") + @Log(title = "供应商入库", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + return toAjax(tenderSupplierInputService.deleteWithValidByIds(List.of(ids), true)); + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsBeipinBeijian.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsBeipinBeijian.java new file mode 100644 index 0000000..67d17d9 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsBeipinBeijian.java @@ -0,0 +1,66 @@ +package org.dromara.personnel.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 运维-物资-备品配件对象 ops_beipin_beijian + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("ops_beipin_beijian") +public class OpsBeipinBeijian extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + /** + * 项目id + */ + private Long projectId; + + /** + * 备件编号 + */ + private String beijianNumber; + + /** + * 备件名称 + */ + private String beijianName; + + /** + * 设备类型 + */ + private String shebeiType; + + /** + * 规格型号 + */ + private String guigexinghao; + + /** + * 库存状态(待定) + */ + private String kucunStatus; + + /** + * 库存数量 + */ + private Long kucunCount; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlan.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlan.java new file mode 100644 index 0000000..bfdfffa --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlan.java @@ -0,0 +1,130 @@ +package org.dromara.personnel.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 运维-物资-采购计划单对象 ops_caigou_plan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("ops_caigou_plan") +public class OpsCaigouPlan extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + /** + * 项目id + */ + private Long projectId; + + /** + * 计划名称 + */ + private String jihuaName; + + /** + * 计划编号 + */ + private String jihuaBianhao; + + /** + * 采购单位(当前登录人部门) + */ + private Long caigouDanwei; + private String caigouDanweiName; + + /** + * 经办人 + */ + private Long jingbanren; + + /** + * 经办人名称 + */ + private String jingbanrenName; + + /** + * 合同类型 + */ + private String hetonType; + + /** + * 采购类型 + */ + private String caigouType; + + /** + * 仓库地址 + */ + private String cangkuUrl; + + /** + * 合同名称 + */ + private String hetonName; + + /** + * 供应商id + */ + private Long gonyingshangId; + + /** + * 出货时间 + */ + private Date chuhuoTime; + + /** + * 付款条件 + */ + private String fukuantiaojian; + + /** + * 发票开具方式 + */ + private String fapiaoKjfs; + + /** + * 提交状态(1、草稿,2、已提交) + */ + private String status; + + /** + * 审核状态 + */ + private String shenheStatus; + + /** + * 预计金额 + */ + private BigDecimal yujiJine; + /** + * 实际已采购金额 + */ + private BigDecimal shijiJine; + + /** + * 申请原因 + */ + private String reason; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlanChanpin.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlanChanpin.java new file mode 100644 index 0000000..9dd0f4e --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlanChanpin.java @@ -0,0 +1,77 @@ +package org.dromara.personnel.domain; + +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; +import java.math.BigDecimal; + +/** + * 运维-物资-采购申请计划-产品信息对象 ops_caigou_plan_chanpin + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("ops_caigou_plan_chanpin") +public class OpsCaigouPlanChanpin extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + /** + * 采购申请计划id + */ + private Long caigouPlanId; + + /** + * 设备类型 + */ + private String shebeiType; + + /** + * 产品名称 + */ + private String chanpinName; + + /** + * 产品型号 + */ + private String chanpinType; + + /** + * 产品单价 + */ + private BigDecimal chanpinMonovalent; + /** + * 总价 + */ + private BigDecimal totalPrice; + + /** + * 购买数量 + */ + private Long goumaiNumber; + + /** + * 单位 + */ + private String danwei; + + /** + * 用途 + */ + private String yontu; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlanFiles.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlanFiles.java new file mode 100644 index 0000000..ee47cd9 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsCaigouPlanFiles.java @@ -0,0 +1,51 @@ +package org.dromara.personnel.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 运维-物资-采购申请计划文件对象 ops_caigou_plan_files + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("ops_caigou_plan_files") +public class OpsCaigouPlanFiles extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + /** + * 采购申请计划id + */ + private Long caigouPlanId; + + /** + * 文件id + */ + private Long fileId; + + /** + * 文件地址 + */ + private String fileUrl; + + /** + * 文件名称 + */ + private String fileName; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsChurukudan.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsChurukudan.java new file mode 100644 index 0000000..d80a4dc --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsChurukudan.java @@ -0,0 +1,81 @@ +package org.dromara.personnel.domain; + +import jakarta.validation.constraints.NotBlank; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serial; + +/** + * 运维-物资-出入库单管理对象 ops_churukudan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("ops_churukudan") +public class OpsChurukudan extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id") + private Long id; + + private Long projectId; + + /** + * 单据编号 + */ + private String danjvNumber; + + /** + * 产品id + */ + private Long chanpinId; + + /** + * 产品名称 + */ + private String chanpinName; + + /** + * 经手人id + */ + private Long jingshourenId; + + /** + * 经手人 + */ + private String jingshourenName; + + /** + * 联系电话 + */ + private String contactNumber; + + /** + * 总数量 + */ + private Long zonNumber; + + /** + * 审核状态 + */ + private String shenheStatus; + + /** + * 单据状态(1、出库单,2入库单) + */ + private String danjvType; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsTenderSupplierInput.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsTenderSupplierInput.java new file mode 100644 index 0000000..bff871d --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/OpsTenderSupplierInput.java @@ -0,0 +1,188 @@ +package org.dromara.personnel.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 供应商入库对象 ops_tender_supplier_input + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("ops_tender_supplier_input") +public class OpsTenderSupplierInput extends BaseEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + + /** + * 项目id + */ + private Long projectId; + + /** + * 企业登记注册类型 + */ + private String supplierType; + + /** + * 企业名称 + */ + private String supplierName; + + /** + * 企业法定代表人 + */ + private String supplierPerson; + + /** + * 统一社会信用代码 + */ + private String supplierCode; + + /** + * 企业注册地址 + */ + private String supplierAddres; + + /** + * 负责人姓名 + */ + private String personName; + + /** + * 负责人联系电话 + */ + private String personPhone; + + /** + * 开户行户名 + */ + private String bankPersonName; + + /** + * 开户银行 + */ + private String bankName; + + /** + * 开户行账号 + */ + private String bankAccount; + + /** + * 纳税规模 + */ + private String taxScale; + + /** + * 经营范围 + */ + private String scope; + + /** + * 企业资质等级 + */ + private String supplierLivel; + + /** + * 发证日期 + */ + private Date issueDate; + + /** + * 证书有效期 + */ + private Date certificateValidity; + + /** + * 近三年营业额 + */ + private String pastThreeYears; + + /** + * 安全生产许可证编号 + */ + private String safeCode; + + /** + * 安全生产许可证发证日期 + */ + private String safeCodeData; + + /** + * 安全证书有效期 + */ + private String safeCertificateValidity; + + /** + * 注册造价工程师数量 + */ + private Long registeredEngineerNumber; + + /** + * 一级建造工程师数量 + */ + private Long firstBuildingNumber; + + /** + * 二级建造工程师数量 + */ + private Long secondBuildingNumber; + + /** + * 其他建造师数量 + */ + private Long otherBuildingNumber; + + /** + * 高级工程师数量 + */ + private Long seniorEngineerNumber; + + /** + * 工程师数量 + */ + private Long engineerNumber; + + /** + * 助理工程师数量 + */ + private Long assistantEngineerNumber; + + /** + * 其他人员数量 + */ + private Long otherPersonnelNumber; + + /** + * 存储文件ID + */ + private Long fileId; + + /** + * 入库资料 + */ + private String inputFile; + + /** + * 审核状态 + */ + private String state; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsBeipinBeijianBo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsBeipinBeijianBo.java new file mode 100644 index 0000000..18786fb --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsBeipinBeijianBo.java @@ -0,0 +1,69 @@ +package org.dromara.personnel.domain.bo; + +import org.dromara.personnel.domain.OpsBeipinBeijian; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 运维-物资-备品配件业务对象 ops_beipin_beijian + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = OpsBeipinBeijian.class, reverseConvertGenerate = false) +public class OpsBeipinBeijianBo extends BaseEntity { + + /** + * id + */ + private Long id; + + /** + * 项目id + */ + private Long projectId; + + /** + * 备件编号 + */ + private String beijianNumber; + + /** + * 备件名称 + */ + @NotBlank(message = "备件名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String beijianName; + + /** + * 设备类型 + */ + @NotBlank(message = "设备类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private String shebeiType; + + /** + * 规格型号 + */ + @NotBlank(message = "规格型号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String guigexinghao; + + /** + * 库存状态(待定) + */ + @NotBlank(message = "库存状态(待定)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String kucunStatus; + + /** + * 库存数量 + */ + @NotNull(message = "库存数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long kucunCount; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanBo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanBo.java new file mode 100644 index 0000000..5728c4b --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanBo.java @@ -0,0 +1,151 @@ +package org.dromara.personnel.domain.bo; + +import org.dromara.personnel.domain.OpsCaigouPlan; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 运维-物资-采购计划单业务对象 ops_caigou_plan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = OpsCaigouPlan.class, reverseConvertGenerate = false) +public class OpsCaigouPlanBo extends BaseEntity { + + /** + * id + */ + private Long id; + + /** + * 项目id + */ + private Long projectId; + + /** + * 计划名称 + */ + @NotBlank(message = "计划名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String jihuaName; + + /** + * 计划编号 + */ +// @NotBlank(message = "计划编号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String jihuaBianhao; + + /** + * 采购单位(当前登录人部门) + */ +// @NotNull(message = "采购单位(当前登录人部门)不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long caigouDanwei; + + private String caigouDanweiName; + + /** + * 经办人 + */ +// @NotNull(message = "经办人不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long jingbanren; + + /** + * 经办人名称 + */ +// @NotBlank(message = "经办人名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String jingbanrenName; + + /** + * 合同类型 + */ + @NotBlank(message = "合同类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private String hetonType; + + /** + * 采购类型 + */ + @NotBlank(message = "采购类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private String caigouType; + + /** + * 仓库地址 + */ +// @NotBlank(message = "仓库地址不能为空", groups = { AddGroup.class, EditGroup.class }) + private String cangkuUrl; + + /** + * 合同名称 + */ + @NotBlank(message = "合同名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String hetonName; + + /** + * 供应商id + */ + @NotNull(message = "供应商id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long gonyingshangId; + + /** + * 出货时间 + */ + @NotNull(message = "出货时间不能为空", groups = { AddGroup.class, EditGroup.class }) + private Date chuhuoTime; + + /** + * 付款条件 + */ + @NotBlank(message = "付款条件不能为空", groups = { AddGroup.class, EditGroup.class }) + private String fukuantiaojian; + + /** + * 发票开具方式 + */ + @NotBlank(message = "发票开具方式不能为空", groups = { AddGroup.class, EditGroup.class }) + private String fapiaoKjfs; + + /** + * 提交状态(1、草稿,2、已提交) + */ +// @NotBlank(message = "提交状态(1、草稿,2、已提交)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String status; + + /** + * 预计金额 + */ + private BigDecimal yujiJine; + /** + * 实际已采购金额 + */ + private BigDecimal shijiJine; + + /** + * 申请原因 + */ + private String reason; + + /** + * 附件 + */ + private List opsCaigouPlanFilesBos; + /** + * 产品信息 + */ + private List opsCaigouPlanChanpinBos; + + + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanChanpinBo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanChanpinBo.java new file mode 100644 index 0000000..f592323 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanChanpinBo.java @@ -0,0 +1,83 @@ +package org.dromara.personnel.domain.bo; + +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.personnel.domain.OpsCaigouPlanChanpin; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +import java.math.BigDecimal; + +/** + * 运维-物资-采购申请计划-产品信息业务对象 ops_caigou_plan_chanpin + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = OpsCaigouPlanChanpin.class, reverseConvertGenerate = false) +public class OpsCaigouPlanChanpinBo extends BaseEntity { + + /** + * id + */ + private Long id; + + /** + * 采购申请计划id + */ +// @NotNull(message = "采购申请计划id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long caigouPlanId; + + /** + * 设备类型 + */ + private String shebeiType; + + /** + * 产品名称 + */ + @NotBlank(message = "产品名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String chanpinName; + + /** + * 产品型号 + */ + @NotBlank(message = "产品型号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String chanpinType; + + /** + * 产品单价 + */ + @NotNull(message = "产品单价不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal chanpinMonovalent; + /** + * 总价 + */ + private BigDecimal totalPrice; + + /** + * 购买数量 + */ + @NotNull(message = "购买数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long goumaiNumber; + + /** + * 单位 + */ + @NotBlank(message = "单位不能为空", groups = { AddGroup.class, EditGroup.class }) + private String danwei; + + /** + * 用途 + */ + @NotBlank(message = "用途不能为空", groups = { AddGroup.class, EditGroup.class }) + private String yontu; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanFilesBo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanFilesBo.java new file mode 100644 index 0000000..2701eef --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanFilesBo.java @@ -0,0 +1,53 @@ +package org.dromara.personnel.domain.bo; + +import org.dromara.personnel.domain.OpsCaigouPlanFiles; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 运维-物资-采购申请计划文件业务对象 ops_caigou_plan_files + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = OpsCaigouPlanFiles.class, reverseConvertGenerate = false) +public class OpsCaigouPlanFilesBo extends BaseEntity { + + /** + * id + */ + private Long id; + + /** + * 采购申请计划id + */ +// @NotNull(message = "采购申请计划id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long caigouPlanId; + + /** + * 文件id + */ + @NotNull(message = "文件id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long fileId; + + /** + * 文件地址 + */ + @NotBlank(message = "文件地址不能为空", groups = { AddGroup.class, EditGroup.class }) + private String fileUrl; + + /** + * 文件名称 + */ + @NotBlank(message = "文件名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String fileName; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanReq.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanReq.java new file mode 100644 index 0000000..036ad0b --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsCaigouPlanReq.java @@ -0,0 +1,57 @@ +package org.dromara.personnel.domain.bo; + +import io.github.linpeilie.annotations.AutoMapper; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.personnel.domain.OpsCaigouPlan; + +import java.util.Date; +import java.util.List; + +/** + * 运维-物资-采购计划单业务对象 ops_caigou_plan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = OpsCaigouPlan.class, reverseConvertGenerate = false) +public class OpsCaigouPlanReq extends BaseEntity { + + /** + * id + */ + private Long id; + + /** + * 项目id + */ + private Long projectId; + + /** + * 计划名称 + */ + private String jihuaName; + + /** + * 计划编号 + */ + private String jihuaBianhao; + + /** + * 提交状态(1、草稿,2、已提交) + */ + private String status; + + + + + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsChurukudanBo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsChurukudanBo.java new file mode 100644 index 0000000..fdb836c --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsChurukudanBo.java @@ -0,0 +1,83 @@ +package org.dromara.personnel.domain.bo; + +import org.dromara.personnel.domain.OpsChurukudan; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; + +/** + * 运维-物资-出入库单管理业务对象 ops_churukudan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = OpsChurukudan.class, reverseConvertGenerate = false) +public class OpsChurukudanBo extends BaseEntity { + + /** + * id + */ + private Long id; + + private Long projectId; + + /** + * 单据编号 + */ + @NotBlank(message = "单据编号不能为空", groups = { EditGroup.class }) + private String danjvNumber; + + /** + * 产品id + */ + @NotBlank(message = "产品不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long chanpinId; + + /** + * 产品名称 + */ + private String chanpinName; + + /** + * 经手人id + */ + @NotNull(message = "经手人id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long jingshourenId; + + /** + * 经手人 + */ + @NotBlank(message = "经手人不能为空", groups = { AddGroup.class, EditGroup.class }) + private String jingshourenName; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class }) + private String contactNumber; + + /** + * 总数量 + */ + @NotNull(message = "总数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long zonNumber; + + /** + * 审核状态 + */ + private String shenheStatus; + + /** + * 单据状态(1、出库单,2入库单) + */ + @NotBlank(message = "单据状态(1、出库单,2入库单)不能为空", groups = { AddGroup.class, EditGroup.class }) + private String danjvType; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsChurukudanReq.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsChurukudanReq.java new file mode 100644 index 0000000..6a3d486 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsChurukudanReq.java @@ -0,0 +1,57 @@ +package org.dromara.personnel.domain.bo; + + +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDate; + +/** + * 运维-物资-出入库单管理业务对象 ops_churukudan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +public class OpsChurukudanReq implements Serializable { + + /** + * id + */ + private Long id; + + private Long projectId; + + /** + * 单据编号 + */ + private String danjvNumber; + + /** + * 设备类型 + */ + private String shebeiType; + + + + /** + * 审核状态 + */ + private String shenheStatus; + + /** + * 单据状态(1、出库单,2入库单) + */ + private String danjvType; + /** + * 查询开始时间 + */ + private LocalDate startDate; + /** + * + * 查询结束时间 + */ + private LocalDate endDate; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsTenderSupplierInputBo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsTenderSupplierInputBo.java new file mode 100644 index 0000000..254bbf8 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/OpsTenderSupplierInputBo.java @@ -0,0 +1,216 @@ +package org.dromara.personnel.domain.bo; + +import org.dromara.personnel.domain.OpsTenderSupplierInput; +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +/** + * 供应商入库业务对象 ops_tender_supplier_input + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = OpsTenderSupplierInput.class, reverseConvertGenerate = false) +public class OpsTenderSupplierInputBo extends BaseEntity { + + /** + * + */ + private Long id; + + /** + * 项目id + */ + private Long projectId; + + /** + * 企业登记注册类型 + */ + @NotBlank(message = "企业登记注册类型不能为空", groups = { AddGroup.class, EditGroup.class }) + private String supplierType; + + /** + * 企业名称 + */ + @NotBlank(message = "企业名称不能为空", groups = { AddGroup.class, EditGroup.class }) + private String supplierName; + + /** + * 企业法定代表人 + */ + @NotBlank(message = "企业法定代表人不能为空", groups = { AddGroup.class, EditGroup.class }) + private String supplierPerson; + + /** + * 统一社会信用代码 + */ + @NotBlank(message = "统一社会信用代码不能为空", groups = { AddGroup.class, EditGroup.class }) + private String supplierCode; + + /** + * 企业注册地址 + */ + @NotBlank(message = "企业注册地址不能为空", groups = { AddGroup.class, EditGroup.class }) + private String supplierAddres; + + /** + * 负责人姓名 + */ + @NotBlank(message = "负责人姓名不能为空", groups = { AddGroup.class, EditGroup.class }) + private String personName; + + /** + * 负责人联系电话 + */ + @NotBlank(message = "负责人联系电话不能为空", groups = { AddGroup.class, EditGroup.class }) + private String personPhone; + + /** + * 开户行户名 + */ + @NotBlank(message = "开户行户名不能为空", groups = { AddGroup.class, EditGroup.class }) + private String bankPersonName; + + /** + * 开户银行 + */ + @NotBlank(message = "开户银行不能为空", groups = { AddGroup.class, EditGroup.class }) + private String bankName; + + /** + * 开户行账号 + */ + @NotBlank(message = "开户行账号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String bankAccount; + + /** + * 纳税规模 + */ + @NotBlank(message = "纳税规模不能为空", groups = { AddGroup.class, EditGroup.class }) + private String taxScale; + + /** + * 经营范围 + */ + @NotBlank(message = "经营范围不能为空", groups = { AddGroup.class, EditGroup.class }) + private String scope; + + /** + * 企业资质等级 + */ + @NotBlank(message = "企业资质等级不能为空", groups = { AddGroup.class, EditGroup.class }) + private String supplierLivel; + + /** + * 发证日期 + */ + @NotNull(message = "发证日期不能为空", groups = { AddGroup.class, EditGroup.class }) + private Date issueDate; + + /** + * 证书有效期 + */ + @NotNull(message = "证书有效期不能为空", groups = { AddGroup.class, EditGroup.class }) + private Date certificateValidity; + + /** + * 近三年营业额 + */ + @NotBlank(message = "近三年营业额不能为空", groups = { AddGroup.class, EditGroup.class }) + private String pastThreeYears; + + /** + * 安全生产许可证编号 + */ + @NotBlank(message = "安全生产许可证编号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String safeCode; + + /** + * 安全生产许可证发证日期 + */ + @NotBlank(message = "安全生产许可证发证日期不能为空", groups = { AddGroup.class, EditGroup.class }) + private String safeCodeData; + + /** + * 安全证书有效期 + */ + @NotBlank(message = "安全证书有效期不能为空", groups = { AddGroup.class, EditGroup.class }) + private String safeCertificateValidity; + + /** + * 注册造价工程师数量 + */ + @NotNull(message = "注册造价工程师数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long registeredEngineerNumber; + + /** + * 一级建造工程师数量 + */ + @NotNull(message = "一级建造工程师数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long firstBuildingNumber; + + /** + * 二级建造工程师数量 + */ + @NotNull(message = "二级建造工程师数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long secondBuildingNumber; + + /** + * 其他建造师数量 + */ + @NotNull(message = "其他建造师数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long otherBuildingNumber; + + /** + * 高级工程师数量 + */ + @NotNull(message = "高级工程师数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long seniorEngineerNumber; + + /** + * 工程师数量 + */ + @NotNull(message = "工程师数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long engineerNumber; + + /** + * 助理工程师数量 + */ + @NotNull(message = "助理工程师数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long assistantEngineerNumber; + + /** + * 其他人员数量 + */ + @NotNull(message = "其他人员数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long otherPersonnelNumber; + + /** + * 存储文件ID + */ + @NotNull(message = "存储文件ID不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long fileId; + + /** + * 入库资料 + */ + @NotBlank(message = "入库资料不能为空", groups = { AddGroup.class, EditGroup.class }) + private String inputFile; + + /** + * 审核状态 + */ + @NotBlank(message = "审核状态不能为空", groups = { AddGroup.class, EditGroup.class }) + private String state; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/SchedulingUserTypeBo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/SchedulingUserTypeBo.java index 5887b09..fd930e4 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/SchedulingUserTypeBo.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/bo/SchedulingUserTypeBo.java @@ -12,6 +12,7 @@ import org.dromara.personnel.domain.OpsSchedulingDate; import java.io.Serializable; import java.time.LocalTime; +import java.util.List; /** * 运维-排班时间类型业务对象 ops_scheduling_date @@ -24,7 +25,7 @@ public class SchedulingUserTypeBo implements Serializable { /** * 运维人员id */ - private Long opsUserId; + private List opsUserId; /** * 排班类型id diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/OpsChurukudanCountDto.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/OpsChurukudanCountDto.java new file mode 100644 index 0000000..1c3b60f --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/OpsChurukudanCountDto.java @@ -0,0 +1,42 @@ +package org.dromara.personnel.domain.dto; + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import org.dromara.personnel.domain.OpsChurukudan; + +import java.io.Serial; +import java.io.Serializable; +import java.util.List; + + +/** + * 运维-物资-出入库单管理视图对象 ops_churukudan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +public class OpsChurukudanCountDto implements Serializable { + + + /** + * 设备类型 + */ + private List shebeiType; + /** + * 入库数量 + */ + private List rukuCounnt; + /** + * 出库数量 + */ + private List chukuCounnt; + + + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/OpsChurukudanDayCountDto.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/OpsChurukudanDayCountDto.java new file mode 100644 index 0000000..21aa2ad --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/OpsChurukudanDayCountDto.java @@ -0,0 +1,35 @@ +package org.dromara.personnel.domain.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 运维-物资-出入库单管理视图对象 ops_churukudan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +public class OpsChurukudanDayCountDto implements Serializable { + + + /** + * 设备类型 + */ + private List days; + /** + * 入库数量 + */ + private List rukuCounnts; + /** + * 出库数量 + */ + private List chukuCounnts; + + + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/SchedulingUserGroupDTO.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/SchedulingUserGroupDTO.java index d18dbf7..68528f3 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/SchedulingUserGroupDTO.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/SchedulingUserGroupDTO.java @@ -11,6 +11,7 @@ import java.util.List; public class SchedulingUserGroupDTO implements Serializable { private Long opsUserId; // 运维人员ID private String opsUserName; // 运维人员ID + private String postName; /** * 总时长 */ diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/UserTypePairDTO.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/UserTypePairDTO.java index 6c35ae6..b62d1cb 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/UserTypePairDTO.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/dto/UserTypePairDTO.java @@ -10,6 +10,7 @@ import java.time.LocalDate; */ @Data public class UserTypePairDTO implements Serializable { + private Long id; private LocalDate schedulingDate; // 排班日期 private Long schedulingType; // 对应的排班类型ID private String schedulingTypeName; // 对应的排班类型ID diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/enums/OpsCaigouPlanEnum.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/enums/OpsCaigouPlanEnum.java new file mode 100644 index 0000000..0a38a82 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/enums/OpsCaigouPlanEnum.java @@ -0,0 +1,23 @@ +package org.dromara.personnel.domain.enums; + +import lombok.Getter; + +@Getter +public enum OpsCaigouPlanEnum { + + CAOGAO("草稿", "1"), + DAISHENPI("待审批", "3"), + SHENPIZHON("审批中", "5"), + WEITONGUO("未通过", "7"), + CAIGOUZHON("采购中", "9"), + YIWANCHENG("已完成", "11"); + + private final String text; + + private final String value; + + OpsCaigouPlanEnum(String text, String value) { + this.text = text; + this.value = value; + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/enums/OpsChurukuEnum.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/enums/OpsChurukuEnum.java new file mode 100644 index 0000000..6843fb8 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/enums/OpsChurukuEnum.java @@ -0,0 +1,19 @@ +package org.dromara.personnel.domain.enums; + +import lombok.Getter; + +@Getter +public enum OpsChurukuEnum { + + CHUKU("出库", "1"), + RUKU("入库", "2"); + + private final String text; + + private final String value; + + OpsChurukuEnum(String text, String value) { + this.text = text; + this.value = value; + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsBeipinBeijianVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsBeipinBeijianVo.java new file mode 100644 index 0000000..f30e68b --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsBeipinBeijianVo.java @@ -0,0 +1,81 @@ +package org.dromara.personnel.domain.vo; + +import org.dromara.personnel.domain.OpsBeipinBeijian; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 运维-物资-备品配件视图对象 ops_beipin_beijian + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = OpsBeipinBeijian.class) +public class OpsBeipinBeijianVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 项目id + */ + @ExcelProperty(value = "项目id") + private Long projectId; + + /** + * 备件编号 + */ + @ExcelProperty(value = "备件编号") + private String beijianNumber; + + /** + * 备件名称 + */ + @ExcelProperty(value = "备件名称") + private String beijianName; + + /** + * 设备类型 + */ + @ExcelProperty(value = "设备类型") + private String shebeiType; + + /** + * 规格型号 + */ + @ExcelProperty(value = "规格型号") + private String guigexinghao; + + /** + * 库存状态(待定) + */ + @ExcelProperty(value = "库存状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "待=定") + private String kucunStatus; + + /** + * 库存数量 + */ + @ExcelProperty(value = "库存数量") + private Long kucunCount; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanChanpinListVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanChanpinListVo.java new file mode 100644 index 0000000..14c8209 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanChanpinListVo.java @@ -0,0 +1,41 @@ +package org.dromara.personnel.domain.vo; + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.personnel.domain.OpsCaigouPlanChanpin; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; + + +/** + * 运维-物资-采购申请计划-产品信息视图对象 ops_caigou_plan_chanpin + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +public class OpsCaigouPlanChanpinListVo implements Serializable { + + + + /** + * id + */ + private Long id; + + /** + * 计划名称 + */ + private String caigouPlanName; + + /** + * 产品名称 + */ + private String chanpinName; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanChanpinVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanChanpinVo.java new file mode 100644 index 0000000..3e963a1 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanChanpinVo.java @@ -0,0 +1,91 @@ +package org.dromara.personnel.domain.vo; + +import org.dromara.personnel.domain.OpsCaigouPlanChanpin; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + + + +/** + * 运维-物资-采购申请计划-产品信息视图对象 ops_caigou_plan_chanpin + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = OpsCaigouPlanChanpin.class) +public class OpsCaigouPlanChanpinVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 采购申请计划id + */ + @ExcelProperty(value = "采购申请计划id") + private Long caigouPlanId; + + /** + * 设备类型 + */ + @ExcelProperty(value = "设备类型") + private String shebeiType; + + /** + * 产品名称 + */ + @ExcelProperty(value = "产品名称") + private String chanpinName; + + /** + * 产品型号 + */ + @ExcelProperty(value = "产品型号") + private String chanpinType; + + /** + * 产品单价 + */ + @ExcelProperty(value = "产品单价") + private BigDecimal chanpinMonovalent; + /** + * 总价 + */ + private BigDecimal totalPrice; + + /** + * 购买数量 + */ + @ExcelProperty(value = "购买数量") + private Long goumaiNumber; + + /** + * 单位 + */ + @ExcelProperty(value = "单位") + private String danwei; + + /** + * 用途 + */ + @ExcelProperty(value = "用途") + private String yontu; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanCountVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanCountVo.java new file mode 100644 index 0000000..c6476ae --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanCountVo.java @@ -0,0 +1,37 @@ +package org.dromara.personnel.domain.vo; + +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import org.dromara.personnel.domain.OpsCaigouPlan; + +import java.io.Serial; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + + +/** + * 运维-物资-采购计划单视图对象 ops_caigou_plan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +public class OpsCaigouPlanCountVo implements Serializable { + + + /** + * 状态 + */ + private String planType; + /** + * 数量统计 + */ + private Long palnCount; + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanFilesVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanFilesVo.java new file mode 100644 index 0000000..d99a2f9 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanFilesVo.java @@ -0,0 +1,62 @@ +package org.dromara.personnel.domain.vo; + +import org.dromara.personnel.domain.OpsCaigouPlanFiles; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 运维-物资-采购申请计划文件视图对象 ops_caigou_plan_files + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = OpsCaigouPlanFiles.class) +public class OpsCaigouPlanFilesVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 采购申请计划id + */ + @ExcelProperty(value = "采购申请计划id") + private Long caigouPlanId; + + /** + * 文件id + */ + @ExcelProperty(value = "文件id") + private Long fileId; + + /** + * 文件地址 + */ + @ExcelProperty(value = "文件地址") + private String fileUrl; + + /** + * 文件名称 + */ + @ExcelProperty(value = "文件名称") + private String fileName; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanVo.java new file mode 100644 index 0000000..7a75ad7 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsCaigouPlanVo.java @@ -0,0 +1,166 @@ +package org.dromara.personnel.domain.vo; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.personnel.domain.OpsCaigouPlan; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.personnel.domain.bo.OpsCaigouPlanChanpinBo; +import org.dromara.personnel.domain.bo.OpsCaigouPlanFilesBo; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 运维-物资-采购计划单视图对象 ops_caigou_plan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = OpsCaigouPlan.class) +public class OpsCaigouPlanVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + + /** + * 项目id + */ + @ExcelProperty(value = "项目id") + private Long projectId; + + /** + * 计划名称 + */ + @ExcelProperty(value = "计划名称") + private String jihuaName; + + /** + * 计划编号 + */ + @ExcelProperty(value = "计划编号") + private String jihuaBianhao; + + /** + * 采购单位(当前登录人部门) + */ + private Long caigouDanwei; + @ExcelProperty(value = "采购单位", converter = ExcelDictConvert.class) + private String caigouDanweiName; + + /** + * 经办人 + */ + @ExcelProperty(value = "经办人") + private Long jingbanren; + + /** + * 经办人名称 + */ + @ExcelProperty(value = "经办人名称") + private String jingbanrenName; + + /** + * 合同类型 + */ + @ExcelProperty(value = "合同类型") + private String hetonType; + + /** + * 采购类型 + */ + @ExcelProperty(value = "采购类型") + private String caigouType; + + /** + * 仓库地址 + */ + @ExcelProperty(value = "仓库地址") + private String cangkuUrl; + + /** + * 合同名称 + */ + @ExcelProperty(value = "合同名称") + private String hetonName; + + /** + * 供应商id + */ + @ExcelProperty(value = "供应商id") + private Long gonyingshangId; + + /** + * 出货时间 + */ + @ExcelProperty(value = "出货时间") + private Date chuhuoTime; + + /** + * 付款条件 + */ + @ExcelProperty(value = "付款条件") + private String fukuantiaojian; + + /** + * 发票开具方式 + */ + @ExcelProperty(value = "发票开具方式") + private String fapiaoKjfs; + + /** + * 提交状态(1、草稿,2、已提交) + */ + @ExcelProperty(value = "提交状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "1=、草稿,2、已提交") + private String status; + + /** + * 审核状态 + */ + @ExcelProperty(value = "审核状态") + private String shenheStatus; + + /** + * 预计金额 + */ + private BigDecimal yujiJine; + /** + * 实际已采购金额 + */ + private BigDecimal shijiJine; + + private Date createTime; + + /** + * 申请原因 + */ + private String reason; + + + /** + * 附件 + */ + private List opsCaigouPlanFilesVos; + /** + * 产品信息 + */ + private List opsCaigouPlanChanpinVos; + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanCountVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanCountVo.java new file mode 100644 index 0000000..1bb20d9 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanCountVo.java @@ -0,0 +1,35 @@ +package org.dromara.personnel.domain.vo; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 运维-物资-出入库单管理视图对象 ops_churukudan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +public class OpsChurukudanCountVo implements Serializable { + + + /** + * 设备类型 + */ + private String shebeiType; + /** + * 入库数量 + */ + private Long rukuCounnt; + /** + * 出库数量 + */ + private Long chukuCounnt; + + + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanDayCountVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanDayCountVo.java new file mode 100644 index 0000000..97557c2 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanDayCountVo.java @@ -0,0 +1,34 @@ +package org.dromara.personnel.domain.vo; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 运维-物资-出入库单管理视图对象 ops_churukudan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +public class OpsChurukudanDayCountVo implements Serializable { + + + /** + * 设备类型 + */ + private String statDay; + /** + * 入库数量 + */ + private Long rukuCounnt; + /** + * 出库数量 + */ + private Long chukuCounnt; + + + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanVo.java new file mode 100644 index 0000000..c80d5e2 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsChurukudanVo.java @@ -0,0 +1,93 @@ +package org.dromara.personnel.domain.vo; + +import org.dromara.personnel.domain.OpsChurukudan; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 运维-物资-出入库单管理视图对象 ops_churukudan + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = OpsChurukudan.class) +public class OpsChurukudanVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * id + */ + @ExcelProperty(value = "id") + private Long id; + private Long projectId; + + /** + * 单据编号 + */ + @ExcelProperty(value = "单据编号") + private String danjvNumber; + + /** + * 产品id + */ + private Long chanpinId; + /** + * 产品名称 + */ + private String chanpinName; + + /** + * 经手人id + */ + @ExcelProperty(value = "经手人id") + private Long jingshourenId; + + /** + * 经手人 + */ + @ExcelProperty(value = "经手人") + private String jingshourenName; + + /** + * 联系电话 + */ + @ExcelProperty(value = "联系电话") + private String contactNumber; + + /** + * 总数量 + */ + @ExcelProperty(value = "总数量") + private Long zonNumber; + + /** + * 审核状态 + */ + @ExcelProperty(value = "审核状态") + private String shenheStatus; + + /** + * 单据状态(1、出库单,2入库单) + */ + @ExcelProperty(value = "单据状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "1=、出库单,2入库单") + private String danjvType; + + private Date updateTime; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsTenderSupplierInputVo.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsTenderSupplierInputVo.java new file mode 100644 index 0000000..8530244 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/domain/vo/OpsTenderSupplierInputVo.java @@ -0,0 +1,226 @@ +package org.dromara.personnel.domain.vo; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.personnel.domain.OpsTenderSupplierInput; +import cn.idev.excel.annotation.ExcelIgnoreUnannotated; +import cn.idev.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 供应商入库视图对象 ops_tender_supplier_input + * + * @author LionLi + * @date 2025-09-24 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = OpsTenderSupplierInput.class) +public class OpsTenderSupplierInputVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 项目id + */ + @ExcelProperty(value = "项目id") + private Long projectId; + + /** + * 企业登记注册类型 + */ + @ExcelProperty(value = "企业登记注册类型") + private String supplierType; + + /** + * 企业名称 + */ + @ExcelProperty(value = "企业名称") + private String supplierName; + + /** + * 企业法定代表人 + */ + @ExcelProperty(value = "企业法定代表人") + private String supplierPerson; + + /** + * 统一社会信用代码 + */ + @ExcelProperty(value = "统一社会信用代码") + private String supplierCode; + + /** + * 企业注册地址 + */ + @ExcelProperty(value = "企业注册地址") + private String supplierAddres; + + /** + * 负责人姓名 + */ + @ExcelProperty(value = "负责人姓名") + private String personName; + + /** + * 负责人联系电话 + */ + @ExcelProperty(value = "负责人联系电话") + private String personPhone; + + /** + * 开户行户名 + */ + @ExcelProperty(value = "开户行户名") + private String bankPersonName; + + /** + * 开户银行 + */ + @ExcelProperty(value = "开户银行") + private String bankName; + + /** + * 开户行账号 + */ + @ExcelProperty(value = "开户行账号") + private String bankAccount; + + /** + * 纳税规模 + */ + @ExcelProperty(value = "纳税规模") + private String taxScale; + + /** + * 经营范围 + */ + @ExcelProperty(value = "经营范围") + private String scope; + + /** + * 企业资质等级 + */ + @ExcelProperty(value = "企业资质等级") + private String supplierLivel; + + /** + * 发证日期 + */ + @ExcelProperty(value = "发证日期") + private Date issueDate; + + /** + * 证书有效期 + */ + @ExcelProperty(value = "证书有效期") + private Date certificateValidity; + + /** + * 近三年营业额 + */ + @ExcelProperty(value = "近三年营业额") + private String pastThreeYears; + + /** + * 安全生产许可证编号 + */ + @ExcelProperty(value = "安全生产许可证编号") + private String safeCode; + + /** + * 安全生产许可证发证日期 + */ + @ExcelProperty(value = "安全生产许可证发证日期") + private String safeCodeData; + + /** + * 安全证书有效期 + */ + @ExcelProperty(value = "安全证书有效期") + private String safeCertificateValidity; + + /** + * 注册造价工程师数量 + */ + @ExcelProperty(value = "注册造价工程师数量") + private Long registeredEngineerNumber; + + /** + * 一级建造工程师数量 + */ + @ExcelProperty(value = "一级建造工程师数量") + private Long firstBuildingNumber; + + /** + * 二级建造工程师数量 + */ + @ExcelProperty(value = "二级建造工程师数量") + private Long secondBuildingNumber; + + /** + * 其他建造师数量 + */ + @ExcelProperty(value = "其他建造师数量") + private Long otherBuildingNumber; + + /** + * 高级工程师数量 + */ + @ExcelProperty(value = "高级工程师数量") + private Long seniorEngineerNumber; + + /** + * 工程师数量 + */ + @ExcelProperty(value = "工程师数量") + private Long engineerNumber; + + /** + * 助理工程师数量 + */ + @ExcelProperty(value = "助理工程师数量") + private Long assistantEngineerNumber; + + /** + * 其他人员数量 + */ + @ExcelProperty(value = "其他人员数量") + private Long otherPersonnelNumber; + + /** + * 存储文件ID + */ + @ExcelProperty(value = "存储文件ID") + private Long fileId; + + /** + * 入库资料 + */ + @ExcelProperty(value = "入库资料") + private String inputFile; + + /** + * 审核状态 + */ + @ExcelProperty(value = "审核状态") + private String state; + + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsBeipinBeijianMapper.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsBeipinBeijianMapper.java new file mode 100644 index 0000000..1611fd8 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsBeipinBeijianMapper.java @@ -0,0 +1,15 @@ +package org.dromara.personnel.mapper; + +import org.dromara.personnel.domain.OpsBeipinBeijian; +import org.dromara.personnel.domain.vo.OpsBeipinBeijianVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 运维-物资-备品配件Mapper接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface OpsBeipinBeijianMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanChanpinMapper.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanChanpinMapper.java new file mode 100644 index 0000000..9226fa8 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanChanpinMapper.java @@ -0,0 +1,15 @@ +package org.dromara.personnel.mapper; + +import org.dromara.personnel.domain.OpsCaigouPlanChanpin; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 运维-物资-采购申请计划-产品信息Mapper接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface OpsCaigouPlanChanpinMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanFilesMapper.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanFilesMapper.java new file mode 100644 index 0000000..cf749c4 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanFilesMapper.java @@ -0,0 +1,15 @@ +package org.dromara.personnel.mapper; + +import org.dromara.personnel.domain.OpsCaigouPlanFiles; +import org.dromara.personnel.domain.vo.OpsCaigouPlanFilesVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 运维-物资-采购申请计划文件Mapper接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface OpsCaigouPlanFilesMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanMapper.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanMapper.java new file mode 100644 index 0000000..a00d4da --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsCaigouPlanMapper.java @@ -0,0 +1,24 @@ +package org.dromara.personnel.mapper; + +import org.apache.ibatis.annotations.Param; +import org.dromara.personnel.domain.OpsCaigouPlan; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinListVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanCountVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +import java.util.List; + +/** + * 运维-物资-采购计划单Mapper接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface OpsCaigouPlanMapper extends BaseMapperPlus { + + List getCountVo(@Param("projectId") Long projectId); + + List getChanpinList(@Param("projectId") Long projectId); +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsChurukudanMapper.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsChurukudanMapper.java new file mode 100644 index 0000000..e008e7e --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsChurukudanMapper.java @@ -0,0 +1,33 @@ +package org.dromara.personnel.mapper; + +import org.apache.ibatis.annotations.Param; +import org.dromara.personnel.domain.OpsChurukudan; +import org.dromara.personnel.domain.bo.OpsChurukudanReq; +import org.dromara.personnel.domain.vo.OpsChurukudanCountVo; +import org.dromara.personnel.domain.vo.OpsChurukudanDayCountVo; +import org.dromara.personnel.domain.vo.OpsChurukudanVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +import java.util.List; + +/** + * 运维-物资-出入库单管理Mapper接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface OpsChurukudanMapper extends BaseMapperPlus { + + List getChuRuKuCount(@Param("bo") OpsChurukudanReq bo); + + List getChuRuKuDayCount(@Param("bo") OpsChurukudanReq bo); + + /** + * 查询产品出入库数量和 + * @param projectId + * @param chanpinId + * @param type + * @return + */ + Long getChuRuKuZonCount(@Param("projectId") Long projectId, @Param("chanpinId") Long chanpinId, @Param("type") String type); +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsTenderSupplierInputMapper.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsTenderSupplierInputMapper.java new file mode 100644 index 0000000..e637fa3 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/mapper/OpsTenderSupplierInputMapper.java @@ -0,0 +1,15 @@ +package org.dromara.personnel.mapper; + +import org.dromara.personnel.domain.OpsTenderSupplierInput; +import org.dromara.personnel.domain.vo.OpsTenderSupplierInputVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 供应商入库Mapper接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface OpsTenderSupplierInputMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsBeipinBeijianService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsBeipinBeijianService.java new file mode 100644 index 0000000..4df2eb4 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsBeipinBeijianService.java @@ -0,0 +1,70 @@ +package org.dromara.personnel.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.personnel.domain.OpsBeipinBeijian; +import org.dromara.personnel.domain.vo.OpsBeipinBeijianVo; +import org.dromara.personnel.domain.bo.OpsBeipinBeijianBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 运维-物资-备品配件Service接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface IOpsBeipinBeijianService extends IService { + + /** + * 查询运维-物资-备品配件 + * + * @param id 主键 + * @return 运维-物资-备品配件 + */ + OpsBeipinBeijianVo queryById(Long id); + + /** + * 分页查询运维-物资-备品配件列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-备品配件分页列表 + */ + TableDataInfo queryPageList(OpsBeipinBeijianBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的运维-物资-备品配件列表 + * + * @param bo 查询条件 + * @return 运维-物资-备品配件列表 + */ + List queryList(OpsBeipinBeijianBo bo); + + /** + * 新增运维-物资-备品配件 + * + * @param bo 运维-物资-备品配件 + * @return 是否新增成功 + */ + Boolean insertByBo(OpsBeipinBeijianBo bo); + + /** + * 修改运维-物资-备品配件 + * + * @param bo 运维-物资-备品配件 + * @return 是否修改成功 + */ + Boolean updateByBo(OpsBeipinBeijianBo bo); + + /** + * 校验并批量删除运维-物资-备品配件信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanChanpinService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanChanpinService.java new file mode 100644 index 0000000..45e3d34 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanChanpinService.java @@ -0,0 +1,78 @@ +package org.dromara.personnel.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.personnel.domain.OpsCaigouPlanChanpin; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinVo; +import org.dromara.personnel.domain.bo.OpsCaigouPlanChanpinBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 运维-物资-采购申请计划-产品信息Service接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface IOpsCaigouPlanChanpinService extends IService { + + /** + * 查询运维-物资-采购申请计划-产品信息 + * + * @param id 主键 + * @return 运维-物资-采购申请计划-产品信息 + */ + OpsCaigouPlanChanpinVo queryById(Long id); + + /** + * 分页查询运维-物资-采购申请计划-产品信息列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-采购申请计划-产品信息分页列表 + */ + TableDataInfo queryPageList(OpsCaigouPlanChanpinBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的运维-物资-采购申请计划-产品信息列表 + * + * @param bo 查询条件 + * @return 运维-物资-采购申请计划-产品信息列表 + */ + List queryList(OpsCaigouPlanChanpinBo bo); + + /** + * 新增运维-物资-采购申请计划-产品信息 + * + * @param bo 运维-物资-采购申请计划-产品信息 + * @return 是否新增成功 + */ + Boolean insertByBo(OpsCaigouPlanChanpinBo bo); + + /** + * 修改运维-物资-采购申请计划-产品信息 + * + * @param bo 运维-物资-采购申请计划-产品信息 + * @return 是否修改成功 + */ + Boolean updateByBo(OpsCaigouPlanChanpinBo bo); + + /** + * 校验并批量删除运维-物资-采购申请计划-产品信息信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + + /** + * 根据采购计划id获取产品信息 + * @param id + * @return + */ + List getVoByCaiGouPlanId(Long caigouId); +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanFilesService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanFilesService.java new file mode 100644 index 0000000..ef8dddd --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanFilesService.java @@ -0,0 +1,77 @@ +package org.dromara.personnel.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.personnel.domain.OpsCaigouPlanFiles; +import org.dromara.personnel.domain.vo.OpsCaigouPlanFilesVo; +import org.dromara.personnel.domain.bo.OpsCaigouPlanFilesBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 运维-物资-采购申请计划文件Service接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface IOpsCaigouPlanFilesService extends IService { + + /** + * 查询运维-物资-采购申请计划文件 + * + * @param id 主键 + * @return 运维-物资-采购申请计划文件 + */ + OpsCaigouPlanFilesVo queryById(Long id); + + /** + * 分页查询运维-物资-采购申请计划文件列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-采购申请计划文件分页列表 + */ + TableDataInfo queryPageList(OpsCaigouPlanFilesBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的运维-物资-采购申请计划文件列表 + * + * @param bo 查询条件 + * @return 运维-物资-采购申请计划文件列表 + */ + List queryList(OpsCaigouPlanFilesBo bo); + + /** + * 新增运维-物资-采购申请计划文件 + * + * @param bo 运维-物资-采购申请计划文件 + * @return 是否新增成功 + */ + Boolean insertByBo(OpsCaigouPlanFilesBo bo); + + /** + * 修改运维-物资-采购申请计划文件 + * + * @param bo 运维-物资-采购申请计划文件 + * @return 是否修改成功 + */ + Boolean updateByBo(OpsCaigouPlanFilesBo bo); + + /** + * 校验并批量删除运维-物资-采购申请计划文件信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 根据采购计划id获取采购计划附件数据 + * @param id + * @return + */ + List getVoByCaiGouPlanId(Long caigouId); +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanService.java new file mode 100644 index 0000000..9e94bde --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsCaigouPlanService.java @@ -0,0 +1,110 @@ +package org.dromara.personnel.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.common.core.domain.R; +import org.dromara.personnel.domain.OpsCaigouPlan; +import org.dromara.personnel.domain.bo.OpsCaigouPlanReq; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinListVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanCountVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanVo; +import org.dromara.personnel.domain.bo.OpsCaigouPlanBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 运维-物资-采购计划单Service接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface IOpsCaigouPlanService extends IService { + + /** + * 查询运维-物资-采购计划单 + * + * @param id 主键 + * @return 运维-物资-采购计划单 + */ + OpsCaigouPlanVo queryById(Long id); + + /** + * 分页查询运维-物资-采购计划单列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-采购计划单分页列表 + */ + TableDataInfo queryPageList(OpsCaigouPlanReq bo, PageQuery pageQuery); + + /** + * 查询符合条件的运维-物资-采购计划单列表 + * + * @param bo 查询条件 + * @return 运维-物资-采购计划单列表 + */ + List queryList(OpsCaigouPlanReq bo); + + /** + * 新增运维-物资-采购计划单 + * + * @param bo 运维-物资-采购计划单 + * @return 是否新增成功 + */ + Boolean insertByBo(OpsCaigouPlanBo bo); + + /** + * 修改运维-物资-采购计划单 + * + * @param bo 运维-物资-采购计划单 + * @return 是否修改成功 + */ + Boolean updateByBo(OpsCaigouPlanBo bo); + + /** + * 校验并批量删除运维-物资-采购计划单信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 统计各个状态数量 + * @param projectId + * @return + */ + List getCountVo(Long projectId); + + /** + * 填写修改实际采购金额 + * @param bo + * @return + */ + Boolean setJinE(OpsCaigouPlanBo bo); + + /** + * 获取本年度金额统计 + * @param projectId + * @return + */ + OpsCaigouPlanVo getJinE(Long projectId); + + /** + * 确认采购单完成 + * @param bo + * @return + */ + Boolean editStatus(OpsCaigouPlanBo bo); + + /** + * 出入库表单新增修改获取产品列表 + * @param bo + * @return + */ + List getChanpinList(OpsCaigouPlanReq bo); +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsChurukudanService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsChurukudanService.java new file mode 100644 index 0000000..c22e8e2 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsChurukudanService.java @@ -0,0 +1,87 @@ +package org.dromara.personnel.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.personnel.domain.OpsChurukudan; +import org.dromara.personnel.domain.bo.OpsChurukudanReq; +import org.dromara.personnel.domain.dto.OpsChurukudanCountDto; +import org.dromara.personnel.domain.dto.OpsChurukudanDayCountDto; +import org.dromara.personnel.domain.vo.OpsChurukudanVo; +import org.dromara.personnel.domain.bo.OpsChurukudanBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 运维-物资-出入库单管理Service接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface IOpsChurukudanService extends IService { + + /** + * 查询运维-物资-出入库单管理 + * + * @param id 主键 + * @return 运维-物资-出入库单管理 + */ + OpsChurukudanVo queryById(Long id); + + /** + * 分页查询运维-物资-出入库单管理列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-出入库单管理分页列表 + */ + TableDataInfo queryPageList(OpsChurukudanReq bo, PageQuery pageQuery); + + /** + * 查询符合条件的运维-物资-出入库单管理列表 + * + * @param bo 查询条件 + * @return 运维-物资-出入库单管理列表 + */ + List queryList(OpsChurukudanReq bo); + + /** + * 新增运维-物资-出入库单管理 + * + * @param bo 运维-物资-出入库单管理 + * @return 是否新增成功 + */ + Boolean insertByBo(OpsChurukudanBo bo); + + /** + * 修改运维-物资-出入库单管理 + * + * @param bo 运维-物资-出入库单管理 + * @return 是否修改成功 + */ + Boolean updateByBo(OpsChurukudanBo bo); + + /** + * 校验并批量删除运维-物资-出入库单管理信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + /** + * 查询本月出入库类型 + * @param bo + * @return + */ + OpsChurukudanCountDto getChuRuKuCount(OpsChurukudanReq bo); + + /** + * 查询出入库月中每天的出入库数量 + * @param bo + * @return + */ + OpsChurukudanDayCountDto getChuRuKuDayCount(OpsChurukudanReq bo); +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsEquipmentService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsEquipmentService.java index aa132d2..ab06e84 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsEquipmentService.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsEquipmentService.java @@ -1,5 +1,6 @@ package org.dromara.personnel.service; +import com.baomidou.mybatisplus.extension.service.IService; import org.dromara.personnel.domain.OpsEquipment; import org.dromara.personnel.domain.vo.OpsEquipmentVo; import org.dromara.personnel.domain.bo.OpsEquipmentBo; @@ -15,7 +16,7 @@ import java.util.List; * @author LionLi * @date 2025-09-19 */ -public interface IOpsEquipmentService { +public interface IOpsEquipmentService extends IService { /** * 查询运维-设备 diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsSchedulingDateService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsSchedulingDateService.java index 5bd1e46..af8e449 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsSchedulingDateService.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsSchedulingDateService.java @@ -1,5 +1,6 @@ package org.dromara.personnel.service; +import com.baomidou.mybatisplus.extension.service.IService; import org.dromara.personnel.domain.OpsSchedulingDate; import org.dromara.personnel.domain.vo.OpsSchedulingDateVo; import org.dromara.personnel.domain.bo.OpsSchedulingDateBo; @@ -15,7 +16,7 @@ import java.util.List; * @author LionLi * @date 2025-09-19 */ -public interface IOpsSchedulingDateService { +public interface IOpsSchedulingDateService extends IService { /** * 查询运维-排班时间类型 diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsSchedulingService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsSchedulingService.java index 04f8261..7596d14 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsSchedulingService.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsSchedulingService.java @@ -1,5 +1,7 @@ package org.dromara.personnel.service; +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.personnel.domain.OpsScheduling; import org.dromara.personnel.domain.bo.OpsSchedulingReq; import org.dromara.personnel.domain.dto.SchedulingUserGroupDTO; import org.dromara.personnel.domain.vo.OpsSchedulingVo; @@ -16,7 +18,7 @@ import java.util.List; * @author LionLi * @date 2025-09-19 */ -public interface IOpsSchedulingService { +public interface IOpsSchedulingService extends IService { /** * 查询运维-人员排班 @@ -76,4 +78,6 @@ public interface IOpsSchedulingService { List getRiLiList(OpsSchedulingReq req); Boolean allEdit(OpsSchedulingBo bo); + + Boolean insertOneByBo(OpsSchedulingBo bo); } diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsTenderSupplierInputService.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsTenderSupplierInputService.java new file mode 100644 index 0000000..4e9695c --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/IOpsTenderSupplierInputService.java @@ -0,0 +1,75 @@ +package org.dromara.personnel.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.dromara.personnel.domain.OpsTenderSupplierInput; +import org.dromara.personnel.domain.vo.OpsTenderSupplierInputVo; +import org.dromara.personnel.domain.bo.OpsTenderSupplierInputBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.springframework.web.multipart.MultipartFile; + +import java.util.Collection; +import java.util.List; + +/** + * 供应商入库Service接口 + * + * @author LionLi + * @date 2025-09-24 + */ +public interface IOpsTenderSupplierInputService extends IService { + + /** + * 查询供应商入库 + * + * @param id 主键 + * @return 供应商入库 + */ + OpsTenderSupplierInputVo queryById(Long id); + + /** + * 分页查询供应商入库列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 供应商入库分页列表 + */ + TableDataInfo queryPageList(OpsTenderSupplierInputBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的供应商入库列表 + * + * @param bo 查询条件 + * @return 供应商入库列表 + */ + List queryList(OpsTenderSupplierInputBo bo); + + /** + * 新增供应商入库 + * + * @param bo 供应商入库 + * @return 是否新增成功 + */ + Boolean insertByBo(OpsTenderSupplierInputBo bo); + + /** + * 修改供应商入库 + * + * @param bo 供应商入库 + * @return 是否修改成功 + */ + Boolean updateByBo(OpsTenderSupplierInputBo bo); + + /** + * 校验并批量删除供应商入库信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + List getList(OpsTenderSupplierInputBo bo); + + boolean importData(List tenderSupplierInputVos, Long projectId); +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsBeipinBeijianServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsBeipinBeijianServiceImpl.java new file mode 100644 index 0000000..e366bf7 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsBeipinBeijianServiceImpl.java @@ -0,0 +1,139 @@ +package org.dromara.personnel.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.dromara.personnel.domain.bo.OpsBeipinBeijianBo; +import org.dromara.personnel.domain.vo.OpsBeipinBeijianVo; +import org.dromara.personnel.domain.OpsBeipinBeijian; +import org.dromara.personnel.mapper.OpsBeipinBeijianMapper; +import org.dromara.personnel.service.IOpsBeipinBeijianService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 运维-物资-备品配件Service业务层处理 + * + * @author LionLi + * @date 2025-09-24 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class OpsBeipinBeijianServiceImpl extends ServiceImpl implements IOpsBeipinBeijianService { + + private final OpsBeipinBeijianMapper baseMapper; + + /** + * 查询运维-物资-备品配件 + * + * @param id 主键 + * @return 运维-物资-备品配件 + */ + @Override + public OpsBeipinBeijianVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询运维-物资-备品配件列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-备品配件分页列表 + */ + @Override + public TableDataInfo queryPageList(OpsBeipinBeijianBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的运维-物资-备品配件列表 + * + * @param bo 查询条件 + * @return 运维-物资-备品配件列表 + */ + @Override + public List queryList(OpsBeipinBeijianBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(OpsBeipinBeijianBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(OpsBeipinBeijian::getId); + lqw.eq(bo.getProjectId() != null, OpsBeipinBeijian::getProjectId, bo.getProjectId()); + lqw.eq(StringUtils.isNotBlank(bo.getBeijianNumber()), OpsBeipinBeijian::getBeijianNumber, bo.getBeijianNumber()); + lqw.like(StringUtils.isNotBlank(bo.getBeijianName()), OpsBeipinBeijian::getBeijianName, bo.getBeijianName()); + lqw.eq(StringUtils.isNotBlank(bo.getShebeiType()), OpsBeipinBeijian::getShebeiType, bo.getShebeiType()); + lqw.eq(StringUtils.isNotBlank(bo.getGuigexinghao()), OpsBeipinBeijian::getGuigexinghao, bo.getGuigexinghao()); + lqw.eq(StringUtils.isNotBlank(bo.getKucunStatus()), OpsBeipinBeijian::getKucunStatus, bo.getKucunStatus()); + lqw.eq(bo.getKucunCount() != null, OpsBeipinBeijian::getKucunCount, bo.getKucunCount()); + return lqw; + } + + /** + * 新增运维-物资-备品配件 + * + * @param bo 运维-物资-备品配件 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(OpsBeipinBeijianBo bo) { + OpsBeipinBeijian add = MapstructUtils.convert(bo, OpsBeipinBeijian.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改运维-物资-备品配件 + * + * @param bo 运维-物资-备品配件 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(OpsBeipinBeijianBo bo) { + OpsBeipinBeijian update = MapstructUtils.convert(bo, OpsBeipinBeijian.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(OpsBeipinBeijian entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除运维-物资-备品配件信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanChanpinServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanChanpinServiceImpl.java new file mode 100644 index 0000000..a071ede --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanChanpinServiceImpl.java @@ -0,0 +1,145 @@ +package org.dromara.personnel.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.dromara.personnel.domain.bo.OpsCaigouPlanChanpinBo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinVo; +import org.dromara.personnel.domain.OpsCaigouPlanChanpin; +import org.dromara.personnel.mapper.OpsCaigouPlanChanpinMapper; +import org.dromara.personnel.service.IOpsCaigouPlanChanpinService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 运维-物资-采购申请计划-产品信息Service业务层处理 + * + * @author LionLi + * @date 2025-09-24 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class OpsCaigouPlanChanpinServiceImpl extends ServiceImpl implements IOpsCaigouPlanChanpinService { + + private final OpsCaigouPlanChanpinMapper baseMapper; + + /** + * 查询运维-物资-采购申请计划-产品信息 + * + * @param id 主键 + * @return 运维-物资-采购申请计划-产品信息 + */ + @Override + public OpsCaigouPlanChanpinVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询运维-物资-采购申请计划-产品信息列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-采购申请计划-产品信息分页列表 + */ + @Override + public TableDataInfo queryPageList(OpsCaigouPlanChanpinBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的运维-物资-采购申请计划-产品信息列表 + * + * @param bo 查询条件 + * @return 运维-物资-采购申请计划-产品信息列表 + */ + @Override + public List queryList(OpsCaigouPlanChanpinBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(OpsCaigouPlanChanpinBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(OpsCaigouPlanChanpin::getId); + lqw.eq(bo.getCaigouPlanId() != null, OpsCaigouPlanChanpin::getCaigouPlanId, bo.getCaigouPlanId()); + lqw.like(StringUtils.isNotBlank(bo.getChanpinName()), OpsCaigouPlanChanpin::getChanpinName, bo.getChanpinName()); + lqw.eq(StringUtils.isNotBlank(bo.getChanpinType()), OpsCaigouPlanChanpin::getChanpinType, bo.getChanpinType()); + lqw.eq(bo.getChanpinMonovalent() != null, OpsCaigouPlanChanpin::getChanpinMonovalent, bo.getChanpinMonovalent()); + lqw.eq(bo.getGoumaiNumber() != null, OpsCaigouPlanChanpin::getGoumaiNumber, bo.getGoumaiNumber()); + lqw.eq(StringUtils.isNotBlank(bo.getDanwei()), OpsCaigouPlanChanpin::getDanwei, bo.getDanwei()); + lqw.eq(StringUtils.isNotBlank(bo.getYontu()), OpsCaigouPlanChanpin::getYontu, bo.getYontu()); + return lqw; + } + + /** + * 新增运维-物资-采购申请计划-产品信息 + * + * @param bo 运维-物资-采购申请计划-产品信息 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(OpsCaigouPlanChanpinBo bo) { + OpsCaigouPlanChanpin add = MapstructUtils.convert(bo, OpsCaigouPlanChanpin.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改运维-物资-采购申请计划-产品信息 + * + * @param bo 运维-物资-采购申请计划-产品信息 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(OpsCaigouPlanChanpinBo bo) { + OpsCaigouPlanChanpin update = MapstructUtils.convert(bo, OpsCaigouPlanChanpin.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(OpsCaigouPlanChanpin entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除运维-物资-采购申请计划-产品信息信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } + + @Override + public List getVoByCaiGouPlanId(Long caigouId) { + return baseMapper.selectVoList(new LambdaQueryWrapper().eq(OpsCaigouPlanChanpin::getCaigouPlanId, caigouId)); + } + +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanFilesServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanFilesServiceImpl.java new file mode 100644 index 0000000..916c180 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanFilesServiceImpl.java @@ -0,0 +1,141 @@ +package org.dromara.personnel.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.dromara.personnel.domain.bo.OpsCaigouPlanFilesBo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanFilesVo; +import org.dromara.personnel.domain.OpsCaigouPlanFiles; +import org.dromara.personnel.mapper.OpsCaigouPlanFilesMapper; +import org.dromara.personnel.service.IOpsCaigouPlanFilesService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 运维-物资-采购申请计划文件Service业务层处理 + * + * @author LionLi + * @date 2025-09-24 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class OpsCaigouPlanFilesServiceImpl extends ServiceImpl implements IOpsCaigouPlanFilesService { + + private final OpsCaigouPlanFilesMapper baseMapper; + + /** + * 查询运维-物资-采购申请计划文件 + * + * @param id 主键 + * @return 运维-物资-采购申请计划文件 + */ + @Override + public OpsCaigouPlanFilesVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询运维-物资-采购申请计划文件列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-采购申请计划文件分页列表 + */ + @Override + public TableDataInfo queryPageList(OpsCaigouPlanFilesBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的运维-物资-采购申请计划文件列表 + * + * @param bo 查询条件 + * @return 运维-物资-采购申请计划文件列表 + */ + @Override + public List queryList(OpsCaigouPlanFilesBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(OpsCaigouPlanFilesBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(OpsCaigouPlanFiles::getId); + lqw.eq(bo.getCaigouPlanId() != null, OpsCaigouPlanFiles::getCaigouPlanId, bo.getCaigouPlanId()); + lqw.eq(bo.getFileId() != null, OpsCaigouPlanFiles::getFileId, bo.getFileId()); + lqw.eq(StringUtils.isNotBlank(bo.getFileUrl()), OpsCaigouPlanFiles::getFileUrl, bo.getFileUrl()); + lqw.like(StringUtils.isNotBlank(bo.getFileName()), OpsCaigouPlanFiles::getFileName, bo.getFileName()); + return lqw; + } + + /** + * 新增运维-物资-采购申请计划文件 + * + * @param bo 运维-物资-采购申请计划文件 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(OpsCaigouPlanFilesBo bo) { + OpsCaigouPlanFiles add = MapstructUtils.convert(bo, OpsCaigouPlanFiles.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改运维-物资-采购申请计划文件 + * + * @param bo 运维-物资-采购申请计划文件 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(OpsCaigouPlanFilesBo bo) { + OpsCaigouPlanFiles update = MapstructUtils.convert(bo, OpsCaigouPlanFiles.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(OpsCaigouPlanFiles entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除运维-物资-采购申请计划文件信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } + + @Override + public List getVoByCaiGouPlanId(Long caigouId) { + return baseMapper.selectVoList(new LambdaQueryWrapper().eq(OpsCaigouPlanFiles::getCaigouPlanId, caigouId)); + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanServiceImpl.java new file mode 100644 index 0000000..c0ce096 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsCaigouPlanServiceImpl.java @@ -0,0 +1,303 @@ +package org.dromara.personnel.service.impl; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.toolkit.BeanUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.exception.ServiceException; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.dromara.common.satoken.utils.LoginHelper; +import org.dromara.personnel.domain.OpsCaigouPlanChanpin; +import org.dromara.personnel.domain.OpsCaigouPlanFiles; +import org.dromara.personnel.domain.bo.OpsCaigouPlanChanpinBo; +import org.dromara.personnel.domain.bo.OpsCaigouPlanFilesBo; +import org.dromara.personnel.domain.bo.OpsCaigouPlanReq; +import org.dromara.personnel.domain.enums.OpsCaigouPlanEnum; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinListVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinVo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanCountVo; +import org.dromara.personnel.service.IOpsCaigouPlanChanpinService; +import org.dromara.personnel.service.IOpsCaigouPlanFilesService; +import org.dromara.personnel.utils.CglxdIdGenerator; +import org.dromara.system.api.model.LoginUser; +import org.springframework.stereotype.Service; +import org.dromara.personnel.domain.bo.OpsCaigouPlanBo; +import org.dromara.personnel.domain.vo.OpsCaigouPlanVo; +import org.dromara.personnel.domain.OpsCaigouPlan; +import org.dromara.personnel.mapper.OpsCaigouPlanMapper; +import org.dromara.personnel.service.IOpsCaigouPlanService; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.*; + +/** + * 运维-物资-采购计划单Service业务层处理 + * + * @author LionLi + * @date 2025-09-24 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class OpsCaigouPlanServiceImpl extends ServiceImpl implements IOpsCaigouPlanService { + + private final OpsCaigouPlanMapper baseMapper; + + private final IOpsCaigouPlanFilesService caigouPlanFilesService; + + private final IOpsCaigouPlanChanpinService caigouPlanChanpinService; + + + + /** + * 查询运维-物资-采购计划单 + * + * @param id 主键 + * @return 运维-物资-采购计划单 + */ + @Override + public OpsCaigouPlanVo queryById(Long id){ + OpsCaigouPlanVo opsCaigouPlanVo = baseMapper.selectVoById(id); + opsCaigouPlanVo.setOpsCaigouPlanChanpinVos(caigouPlanChanpinService.getVoByCaiGouPlanId(id)); + opsCaigouPlanVo.setOpsCaigouPlanFilesVos(caigouPlanFilesService.getVoByCaiGouPlanId(id)); + return opsCaigouPlanVo; + } + + /** + * 分页查询运维-物资-采购计划单列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-采购计划单分页列表 + */ + @Override + public TableDataInfo queryPageList(OpsCaigouPlanReq bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的运维-物资-采购计划单列表 + * + * @param bo 查询条件 + * @return 运维-物资-采购计划单列表 + */ + @Override + public List queryList(OpsCaigouPlanReq bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(OpsCaigouPlanReq bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(OpsCaigouPlan::getCreateTime); + lqw.eq(bo.getProjectId() != null, OpsCaigouPlan::getProjectId, bo.getProjectId()); + lqw.like(StringUtils.isNotBlank(bo.getJihuaName()), OpsCaigouPlan::getJihuaName, bo.getJihuaName()); + lqw.eq(StringUtils.isNotBlank(bo.getJihuaBianhao()), OpsCaigouPlan::getJihuaBianhao, bo.getJihuaBianhao()); + lqw.eq(StringUtils.isNotBlank(bo.getStatus()), OpsCaigouPlan::getStatus, bo.getStatus()); + return lqw; + } + + /** + * 新增运维-物资-采购计划单 + * + * @param bo 运维-物资-采购计划单 + * @return 是否新增成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean insertByBo(OpsCaigouPlanBo bo) { + LoginUser loginUser = LoginHelper.getLoginUser(); + OpsCaigouPlan add = MapstructUtils.convert(bo, OpsCaigouPlan.class); + add.setJingbanren(loginUser.getUserId()); + add.setJingbanrenName(loginUser.getUsername()); + add.setCaigouDanwei(loginUser.getDeptId()); + add.setCaigouDanweiName(loginUser.getDeptName()); + add.setJihuaBianhao(CglxdIdGenerator.generateId("CGLXD")); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + List opsCaigouPlanChanpinBos = bo.getOpsCaigouPlanChanpinBos(); + BigDecimal yujiJine = opsCaigouPlanChanpinBos.stream() + // 步骤1:设置 caigouPlanId(副作用,也可单独处理) + .peek(chanpin -> chanpin.setCaigouPlanId(add.getId())) + // 步骤2:提取要累加的 totalPrice + .map(OpsCaigouPlanChanpinBo::getTotalPrice) + // 步骤3:过滤 null(避免 NPE) + .filter(Objects::nonNull) + // 步骤4:累加所有 BigDecimal(初始值为 BigDecimal.ZERO) + .reduce(BigDecimal.ZERO, BigDecimal::add); + add.setYujiJine(yujiJine); + baseMapper.updateById(add); + List planChanpinList = BeanUtil.copyToList(opsCaigouPlanChanpinBos, OpsCaigouPlanChanpin.class); + caigouPlanChanpinService.saveBatch(planChanpinList); + List opsCaigouPlanFilesBos = bo.getOpsCaigouPlanFilesBos(); + opsCaigouPlanFilesBos.forEach(fileBo -> { + fileBo.setCaigouPlanId(add.getId()); + }); + List planFilesList = MapstructUtils.convert(opsCaigouPlanFilesBos, OpsCaigouPlanFiles.class); + caigouPlanFilesService.saveBatch(planFilesList); + } + return flag; + } + + /** + * 修改运维-物资-采购计划单 + * + * @param bo 运维-物资-采购计划单 + * @return 是否修改成功 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean updateByBo(OpsCaigouPlanBo bo) { + if (!OpsCaigouPlanEnum.CAOGAO.getValue().equals(bo.getStatus()) && !OpsCaigouPlanEnum.WEITONGUO.getValue().equals(bo.getStatus())) { + throw new ServiceException("已开始审核,不允许修改"); + } + caigouPlanChanpinService.getBaseMapper().delete(new LambdaQueryWrapper().eq(OpsCaigouPlanChanpin::getCaigouPlanId, bo.getId())); + caigouPlanFilesService.getBaseMapper().delete(new LambdaQueryWrapper().eq(OpsCaigouPlanFiles::getCaigouPlanId, bo.getId())); + OpsCaigouPlan update = MapstructUtils.convert(bo, OpsCaigouPlan.class); + validEntityBeforeSave(update); + List opsCaigouPlanChanpinBos = bo.getOpsCaigouPlanChanpinBos(); + BigDecimal yujiJine = opsCaigouPlanChanpinBos.stream() + // 步骤1:设置 caigouPlanId(副作用,也可单独处理) + .peek(chanpin -> chanpin.setCaigouPlanId(update.getId())) + // 步骤2:提取要累加的 totalPrice + .map(OpsCaigouPlanChanpinBo::getTotalPrice) + // 步骤3:过滤 null(避免 NPE) + .filter(Objects::nonNull) + // 步骤4:累加所有 BigDecimal(初始值为 BigDecimal.ZERO) + .reduce(BigDecimal.ZERO, BigDecimal::add); + update.setYujiJine(yujiJine); + List planChanpinList = MapstructUtils.convert(opsCaigouPlanChanpinBos, OpsCaigouPlanChanpin.class); + caigouPlanChanpinService.saveBatch(planChanpinList); + List opsCaigouPlanFilesBos = bo.getOpsCaigouPlanFilesBos(); + opsCaigouPlanFilesBos.forEach(fileBo -> { + fileBo.setCaigouPlanId(update.getId()); + }); + List planFilesList = MapstructUtils.convert(opsCaigouPlanFilesBos, OpsCaigouPlanFiles.class); + caigouPlanFilesService.saveBatch(planFilesList); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(OpsCaigouPlan entity){ + //TODO 做一些数据校验,如唯一约束 + Long count = baseMapper.selectCount(new LambdaQueryWrapper() + .eq(OpsCaigouPlan::getProjectId, entity.getProjectId()) + .eq(OpsCaigouPlan::getJihuaName, entity.getJihuaName()) + .ne(entity.getId() != null,OpsCaigouPlan::getId, entity.getId())); + if (count > 0) { + throw new ServiceException("计划名称已存在!"); + } + } + + /** + * 校验并批量删除运维-物资-采购计划单信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + baseMapper.selectVoByIds(ids).forEach(vo -> { + if (!OpsCaigouPlanEnum.CAOGAO.getValue().equals(vo.getStatus())) { + throw new ServiceException("已开始审核,不允许修改"); + } + }); + } + return baseMapper.deleteByIds(ids) > 0; + } + + /** + * 统计各个状态数量 + * @param projectId + * @return + */ + @Override + public List getCountVo(Long projectId) { + return baseMapper.getCountVo(projectId); + } + + /** + * 填写修改实际采购金额 + * @param bo + * @return + */ + @Override + public Boolean setJinE(OpsCaigouPlanBo bo) { + OpsCaigouPlan opsCaigouPlan = baseMapper.selectById(bo.getId()); + if (opsCaigouPlan == null) { + throw new ServiceException("修改对象不存在"); + } + if (!OpsCaigouPlanEnum.CAIGOUZHON.getValue().equals(opsCaigouPlan.getStatus())){ + throw new ServiceException("只有处于采购中时才能填写实际采购金额!!"); + } + if (opsCaigouPlan.getYujiJine().compareTo(bo.getShijiJine()) < 0){ + throw new ServiceException("实际金额不能超过预计采购金额"); + } + opsCaigouPlan.setShijiJine(bo.getShijiJine()); + return baseMapper.updateById(opsCaigouPlan) > 0; + } + + @Override + public OpsCaigouPlanVo getJinE(Long projectId) { + LocalDateTime now = LocalDateTime.now(); + // 重置为当年1月1日0时0分0秒 + LocalDateTime startTime = now.withMonth(1) // 月份设为1月(1-12) + .withDayOfMonth(1) // 日期设为1日 + .withHour(0) // 小时设为0 + .withMinute(0) // 分钟设为0 + .withSecond(0) // 秒设为0 + .withNano(0); + List opsCaigouPlanVos = baseMapper.selectVoList(new LambdaQueryWrapper() + .eq(OpsCaigouPlan::getProjectId, projectId) + .between(OpsCaigouPlan::getCreateTime, startTime, now)); + BigDecimal shijiJine = opsCaigouPlanVos.stream() + // 步骤2:提取要累加的 totalPrice + .map(OpsCaigouPlanVo::getShijiJine) + // 步骤3:过滤 null(避免 NPE) + .filter(Objects::nonNull) + // 步骤4:累加所有 BigDecimal(初始值为 BigDecimal.ZERO) + .reduce(BigDecimal.ZERO, BigDecimal::add); + BigDecimal yujiJine = opsCaigouPlanVos.stream() + // 步骤2:提取要累加的 totalPrice + .map(OpsCaigouPlanVo::getYujiJine) + // 步骤3:过滤 null(避免 NPE) + .filter(Objects::nonNull) + // 步骤4:累加所有 BigDecimal(初始值为 BigDecimal.ZERO) + .reduce(BigDecimal.ZERO, BigDecimal::add); + OpsCaigouPlanVo opsCaigouPlanVo = new OpsCaigouPlanVo(); + opsCaigouPlanVo.setShijiJine(shijiJine); + opsCaigouPlanVo.setYujiJine(yujiJine); + return opsCaigouPlanVo; + } + + @Override + public Boolean editStatus(OpsCaigouPlanBo bo) { + OpsCaigouPlan opsCaigouPlan = baseMapper.selectById(bo.getId()); + opsCaigouPlan.setStatus(OpsCaigouPlanEnum.YIWANCHENG.getValue()); + return baseMapper.updateById(opsCaigouPlan) > 0; + } + + @Override + public List getChanpinList(OpsCaigouPlanReq bo) { + return baseMapper.getChanpinList(bo.getProjectId()); + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsChurukudanServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsChurukudanServiceImpl.java new file mode 100644 index 0000000..5cf1dea --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsChurukudanServiceImpl.java @@ -0,0 +1,220 @@ +package org.dromara.personnel.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.exception.ServiceException; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.dromara.personnel.domain.OpsCaigouPlan; +import org.dromara.personnel.domain.OpsCaigouPlanChanpin; +import org.dromara.personnel.domain.bo.OpsChurukudanReq; +import org.dromara.personnel.domain.dto.OpsChurukudanCountDto; +import org.dromara.personnel.domain.dto.OpsChurukudanDayCountDto; +import org.dromara.personnel.domain.enums.OpsChurukuEnum; +import org.dromara.personnel.domain.vo.OpsChurukudanCountVo; +import org.dromara.personnel.domain.vo.OpsChurukudanDayCountVo; +import org.dromara.personnel.service.IOpsCaigouPlanChanpinService; +import org.dromara.personnel.service.IOpsCaigouPlanService; +import org.dromara.personnel.utils.CglxdIdGenerator; +import org.springframework.stereotype.Service; +import org.dromara.personnel.domain.bo.OpsChurukudanBo; +import org.dromara.personnel.domain.vo.OpsChurukudanVo; +import org.dromara.personnel.domain.OpsChurukudan; +import org.dromara.personnel.mapper.OpsChurukudanMapper; +import org.dromara.personnel.service.IOpsChurukudanService; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 运维-物资-出入库单管理Service业务层处理 + * + * @author LionLi + * @date 2025-09-24 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class OpsChurukudanServiceImpl extends ServiceImpl implements IOpsChurukudanService { + + private final OpsChurukudanMapper baseMapper; + + private final IOpsCaigouPlanChanpinService caigouPlanChanpinService; + private final IOpsCaigouPlanService caigouPlanService; + + /** + * 查询运维-物资-出入库单管理 + * + * @param id 主键 + * @return 运维-物资-出入库单管理 + */ + @Override + public OpsChurukudanVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询运维-物资-出入库单管理列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 运维-物资-出入库单管理分页列表 + */ + @Override + public TableDataInfo queryPageList(OpsChurukudanReq bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的运维-物资-出入库单管理列表 + * + * @param bo 查询条件 + * @return 运维-物资-出入库单管理列表 + */ + @Override + public List queryList(OpsChurukudanReq bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(OpsChurukudanReq bo) { + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByAsc(OpsChurukudan::getId); + lqw.eq(OpsChurukudan::getProjectId, bo.getProjectId()); + lqw.eq(StringUtils.isNotBlank(bo.getDanjvNumber()), OpsChurukudan::getDanjvNumber, bo.getDanjvNumber()); + lqw.eq(StringUtils.isNotBlank(bo.getShenheStatus()), OpsChurukudan::getShenheStatus, bo.getShenheStatus()); + lqw.eq(StringUtils.isNotBlank(bo.getDanjvType()), OpsChurukudan::getDanjvType, bo.getDanjvType()); + lqw.between(bo.getStartDate()!=null && bo.getEndDate()!=null,OpsChurukudan::getCreateTime,bo.getStartDate(),bo.getEndDate()); + return lqw; + } + + /** + * 新增运维-物资-出入库单管理 + * + * @param bo 运维-物资-出入库单管理 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(OpsChurukudanBo bo) { + OpsCaigouPlanChanpin planChanpin = caigouPlanChanpinService.getBaseMapper().selectById(bo.getChanpinId()); + if (planChanpin == null) { + throw new ServiceException("产品不存在,请重新核对后提交"); + } + OpsChurukudan add = MapstructUtils.convert(bo, OpsChurukudan.class); + String generated = ""; + Long count = baseMapper.getChuRuKuZonCount(bo.getProjectId(),bo.getChanpinId(),"2"); + if (OpsChurukuEnum.RUKU.getValue().equals(bo.getDanjvType())){ + generated = CglxdIdGenerator.generateId("RUKU"); + if (count+bo.getZonNumber() > planChanpin.getGoumaiNumber()){ + throw new ServiceException("超出计划总量,请核对后再提交"); + } + }else { + Long chuKuZonCount = baseMapper.getChuRuKuZonCount(bo.getProjectId(), bo.getChanpinId(), "1"); + if (chuKuZonCount+bo.getZonNumber() > count){ + throw new ServiceException("出库数量超出入库总量,请核对后再提交"); + } + generated = CglxdIdGenerator.generateId("CHUKU"); + } + OpsCaigouPlan opsCaigouPlan = caigouPlanService.getBaseMapper().selectById(planChanpin.getCaigouPlanId()); + add.setChanpinName(opsCaigouPlan.getJihuaName()+"-"+planChanpin.getChanpinName()); + add.setDanjvNumber(generated); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改运维-物资-出入库单管理 + * + * @param bo 运维-物资-出入库单管理 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(OpsChurukudanBo bo) { + OpsChurukudan update = MapstructUtils.convert(bo, OpsChurukudan.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(OpsChurukudan entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除运维-物资-出入库单管理信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } + + /** + * 出入库类型分布 + * @param bo + * @return + */ + @Override + public OpsChurukudanCountDto getChuRuKuCount(OpsChurukudanReq bo) { + OpsChurukudanCountDto dto = new OpsChurukudanCountDto(); + + List shebeiType = new ArrayList<>(); + List rukuCounnt = new ArrayList<>(); + List chukuCounnt = new ArrayList<>(); + List countVoList = baseMapper.getChuRuKuCount(bo); + for (OpsChurukudanCountVo count : countVoList) { + shebeiType.add(count.getShebeiType()); + rukuCounnt.add(count.getRukuCounnt()); + chukuCounnt.add(count.getChukuCounnt()); + } + dto.setShebeiType(shebeiType); + dto.setRukuCounnt(rukuCounnt); + dto.setChukuCounnt(chukuCounnt); + return dto; + } + + /** + * 查询出入库月中每天的出入库数量 + * @param bo + * @return + */ + @Override + public OpsChurukudanDayCountDto getChuRuKuDayCount(OpsChurukudanReq bo) { + OpsChurukudanDayCountDto dto = new OpsChurukudanDayCountDto(); + List days = new ArrayList<>(); + List rukuCounnt = new ArrayList<>(); + List chukuCounnt = new ArrayList<>(); + List churukudanDayCountVos = baseMapper.getChuRuKuDayCount(bo); + for (OpsChurukudanDayCountVo count : churukudanDayCountVos) { + days.add(count.getStatDay()); + rukuCounnt.add(count.getRukuCounnt()); + chukuCounnt.add(count.getChukuCounnt()); + } + dto.setDays(days); + dto.setRukuCounnts(rukuCounnt); + dto.setChukuCounnts(chukuCounnt); + return dto; + } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsEquipmentServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsEquipmentServiceImpl.java index 2169ef5..11b56a1 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsEquipmentServiceImpl.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsEquipmentServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.personnel.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -29,7 +30,7 @@ import java.util.Collection; @Slf4j @RequiredArgsConstructor @Service -public class OpsEquipmentServiceImpl implements IOpsEquipmentService { +public class OpsEquipmentServiceImpl extends ServiceImpl implements IOpsEquipmentService { private final OpsEquipmentMapper baseMapper; diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsSchedulingDateServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsSchedulingDateServiceImpl.java index 8a6a150..9654d8c 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsSchedulingDateServiceImpl.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsSchedulingDateServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.personnel.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -31,7 +32,7 @@ import java.util.Collection; @Slf4j @RequiredArgsConstructor @Service -public class OpsSchedulingDateServiceImpl implements IOpsSchedulingDateService { +public class OpsSchedulingDateServiceImpl extends ServiceImpl implements IOpsSchedulingDateService { private final OpsSchedulingDateMapper baseMapper; diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsSchedulingServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsSchedulingServiceImpl.java index 402edf5..850f11d 100644 --- a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsSchedulingServiceImpl.java +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsSchedulingServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.personnel.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -37,7 +38,7 @@ import java.util.stream.Collectors; @Slf4j @RequiredArgsConstructor @Service -public class OpsSchedulingServiceImpl implements IOpsSchedulingService { +public class OpsSchedulingServiceImpl extends ServiceImpl implements IOpsSchedulingService { private final OpsSchedulingMapper baseMapper; private final IOpsSchedulingDateService schedulingDateService; @@ -106,22 +107,25 @@ public class OpsSchedulingServiceImpl implements IOpsSchedulingService { if (opsSchedulingDateVo == null) { throw new ServiceException("排班类型不存在"); } - OpsScheduling opsScheduling = new OpsScheduling(); - if (userTypeBo.getOpsUserId() == null) { - throw new ServiceException("运维人员不能为空"); + for (Long userId : userTypeBo.getOpsUserId()) { + OpsScheduling opsScheduling = new OpsScheduling(); + if (userTypeBo.getOpsUserId() == null) { + throw new ServiceException("运维人员不能为空"); + } + if (userTypeBo.getSchedulingType() == null) { + throw new ServiceException("排班类型不能为空"); + } + if (bo.getSchedulingDate().isBefore(LocalDate.now())){ + throw new ServiceException("排班日期应大于等于当前日期"); + } + opsScheduling.setOpsUserId(userId); + opsScheduling.setSchedulingType(userTypeBo.getSchedulingType()); + opsScheduling.setSchedulingDate(bo.getSchedulingDate()); + opsScheduling.setProjectId(bo.getProjectId()); + opsScheduling.setSchedulingStartTime(bo.getSchedulingDate().atTime(opsSchedulingDateVo.getStartTime())); + opsScheduling.setSchedulingEndTime(bo.getSchedulingDate().atTime(opsSchedulingDateVo.getEndTime())); + opsSchedulings.add(opsScheduling); } - if (userTypeBo.getSchedulingType() == null) { - throw new ServiceException("排班类型不能为空"); - } - opsScheduling.setOpsUserId(userTypeBo.getOpsUserId()); - opsScheduling.setSchedulingType(userTypeBo.getSchedulingType()); - opsScheduling.setSchedulingDate(bo.getSchedulingDate()); - if (bo.getSchedulingDate().isBefore(LocalDate.now())){ - throw new ServiceException("排班日期应大于等于当前日期"); - } - opsScheduling.setSchedulingStartTime(bo.getSchedulingDate().atTime(opsSchedulingDateVo.getStartTime())); - opsScheduling.setSchedulingEndTime(bo.getSchedulingDate().atTime(opsSchedulingDateVo.getEndTime())); - opsSchedulings.add(opsScheduling); } return baseMapper.insertBatch(opsSchedulings); } @@ -140,6 +144,17 @@ public class OpsSchedulingServiceImpl implements IOpsSchedulingService { return insertByBo(bo); } + @Override + public Boolean insertOneByBo(OpsSchedulingBo bo) { + OpsScheduling add = MapstructUtils.convert(bo, OpsScheduling.class); + validEntityBeforeSave(add); + boolean falt = baseMapper.insert(add) > 0; + if (falt) { + bo.setId(add.getId()); + } + return falt; + } + @Override @Transactional(rollbackFor = Exception.class) @@ -193,13 +208,16 @@ public class OpsSchedulingServiceImpl implements IOpsSchedulingService { List userTypePairDTOS = new ArrayList<>(); dto.setOpsUserId(entry.getKey()); dto.setOpsUserName(remoteUserService.selectNicknameById(entry.getKey())); + dto.setPostName(remoteUserService .getPostNameByUserId(entry.getKey())); double durationCount = 0.0; for (OpsSchedulingVo schedulingDate : entry.getValue()) { UserTypePairDTO pairDTO = new UserTypePairDTO(); + pairDTO.setId(schedulingDate.getId()); pairDTO.setSchedulingDate(schedulingDate.getSchedulingDate()); pairDTO.setSchedulingType(schedulingDate.getSchedulingType()); pairDTO.setSchedulingTypeName(schedulingDate.getSchedulingTypeName()); durationCount += schedulingDate.getDuration(); + userTypePairDTOS.add(pairDTO); } dto.setDurationCount(durationCount); dto.setUserTypePairs(userTypePairDTOS); diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsTenderSupplierInputServiceImpl.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsTenderSupplierInputServiceImpl.java new file mode 100644 index 0000000..a5c4be0 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/service/impl/OpsTenderSupplierInputServiceImpl.java @@ -0,0 +1,251 @@ +package org.dromara.personnel.service.impl; + +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.dromara.common.core.enums.BusinessStatusEnum; +import org.dromara.common.core.exception.ServiceException; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.dromara.personnel.domain.OpsTenderSupplierInput; +import org.dromara.personnel.domain.bo.OpsTenderSupplierInputBo; +import org.dromara.personnel.domain.vo.OpsTenderSupplierInputVo; +import org.dromara.personnel.mapper.OpsTenderSupplierInputMapper; +import org.dromara.personnel.service.IOpsTenderSupplierInputService; +import org.dromara.resource.api.RemoteFileService; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 供应商入库Service业务层处理 + * + * @author LionLi + * @date 2025-09-24 + */ +@Slf4j +@RequiredArgsConstructor +@Service +public class OpsTenderSupplierInputServiceImpl extends ServiceImpl implements IOpsTenderSupplierInputService { + + private final OpsTenderSupplierInputMapper baseMapper; + private final RemoteFileService remoteFileService; + + /** + * 查询供应商入库 + * + * @param id 主键 + * @return 供应商入库 + */ + @Override + public OpsTenderSupplierInputVo queryById(Long id){ + return baseMapper.selectVoById(id); + } + + /** + * 分页查询供应商入库列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 供应商入库分页列表 + */ + @Override + public TableDataInfo queryPageList(OpsTenderSupplierInputBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的供应商入库列表 + * + * @param bo 查询条件 + * @return 供应商入库列表 + */ + @Override + public List queryList(OpsTenderSupplierInputBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(OpsTenderSupplierInputBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.orderByDesc(OpsTenderSupplierInput::getCreateTime); + lqw.eq(bo.getProjectId() != null, OpsTenderSupplierInput::getProjectId, bo.getProjectId()); + lqw.eq(StringUtils.isNotBlank(bo.getSupplierType()), OpsTenderSupplierInput::getSupplierType, bo.getSupplierType()); + lqw.like(StringUtils.isNotBlank(bo.getSupplierName()), OpsTenderSupplierInput::getSupplierName, bo.getSupplierName()); + lqw.like(StringUtils.isNotBlank(bo.getState()), OpsTenderSupplierInput::getState, bo.getState()); + return lqw; + } + + /** + * 新增供应商入库 + * + * @param bo 供应商入库 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(OpsTenderSupplierInputBo bo) { + OpsTenderSupplierInput add = MapstructUtils.convert(bo, OpsTenderSupplierInput.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setId(add.getId()); + } + return flag; + } + + /** + * 修改供应商入库 + * + * @param bo 供应商入库 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(OpsTenderSupplierInputBo bo) { + if (bo.getId() == null) { + throw new ServiceException("id不能为空"); + } + OpsTenderSupplierInput update = MapstructUtils.convert(bo, OpsTenderSupplierInput.class); + OpsTenderSupplierInput byId = getById(update.getId()); + if (BusinessStatusEnum.FINISH.getStatus().equals(byId.getState())) { + throw new ServiceException("已审核完成数据不能修改"); + } + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(OpsTenderSupplierInput entity){ + //TODO 做一些数据校验,如唯一约束 + if (entity.getProjectId() == null){ + throw new ServiceException("项目id不能为空"); + } + if (entity.getSupplierType() == null || entity.getSupplierType().isEmpty()){ + throw new ServiceException("企业登记注册类型不能为空"); + } + if (entity.getSupplierName() == null || entity.getSupplierName().isEmpty()){ + throw new ServiceException("企业名称不能为空"); + } + if (entity.getSupplierPerson() == null || entity.getSupplierPerson().isEmpty()){ + throw new ServiceException("企业法定代表人不能为空"); + } + if (entity.getSupplierCode() == null || entity.getSupplierCode().isEmpty()){ + throw new ServiceException("统一社会信用代码不能为空"); + } + if (entity.getPersonName() == null || entity.getPersonName().isEmpty()){ + throw new ServiceException("负责人姓名不能为空"); + } + if (entity.getPersonPhone() == null || entity.getPersonPhone().isEmpty()){ + throw new ServiceException("负责人联系电话不能为空"); + } + + } + + /** + * 校验并批量删除供应商入库信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + List fileIds = new ArrayList<>(); + for (Long id : ids) { + OpsTenderSupplierInput byId = getById(id); + if (byId.getFileId() != null){ + fileIds.add(byId.getInputFile()); + } + } + if (!fileIds.isEmpty()) { + remoteFileService.deleteFile(fileIds); + } + } + return baseMapper.deleteByIds(ids) > 0; + } + + @Override + public List getList(OpsTenderSupplierInputBo bo) { + bo.setState("finish"); + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + List OpsTenderSupplierInputVos = baseMapper.selectVoList(lqw); + List list = new ArrayList<>(); + OpsTenderSupplierInputVos.forEach(OpsTenderSupplierInputVo -> { + OpsTenderSupplierInputVo vo = new OpsTenderSupplierInputVo(); + vo.setSupplierName(OpsTenderSupplierInputVo.getSupplierName()); + vo.setId(OpsTenderSupplierInputVo.getId()); + list.add(vo); + }); + return list; + } + + @Override + public boolean importData(List OpsTenderSupplierInputVos, Long projectId) { + List OpsTenderSupplierInputVos1 = OpsTenderSupplierInputVos.stream() + .collect(Collectors.collectingAndThen( + Collectors.toCollection(() -> + new TreeSet<>(Comparator.comparing(item -> + item.getSupplierName() + "_" + item.getSupplierPerson() + "_" + item.getSupplierCode()))), + ArrayList::new + )); + List OpsTenderSupplierInputs = new ArrayList<>(); + for (OpsTenderSupplierInputVo OpsTenderSupplierInputVo : OpsTenderSupplierInputVos1) { + Long count = baseMapper.selectCount(new LambdaQueryWrapper() + .eq(OpsTenderSupplierInput::getProjectId,projectId) + .eq(OpsTenderSupplierInput::getSupplierCode, OpsTenderSupplierInputVo.getSupplierCode()) + .eq(OpsTenderSupplierInput::getSupplierName, OpsTenderSupplierInputVo.getSupplierName()) + .eq(OpsTenderSupplierInput::getSupplierPerson, OpsTenderSupplierInputVo.getSupplierPerson())); + if (count > 0) { + continue; + } + OpsTenderSupplierInput newOpsTenderSupplierInput = new OpsTenderSupplierInput(); + BeanUtils.copyProperties(OpsTenderSupplierInputVo, newOpsTenderSupplierInput); + newOpsTenderSupplierInput.setProjectId(projectId); + newOpsTenderSupplierInput.setState("draft"); + OpsTenderSupplierInputs.add(newOpsTenderSupplierInput); + } + if (CollectionUtils.isEmpty(OpsTenderSupplierInputs)) { + throw new ServiceException("导入数据数据库中全部存在,请核实后再导入!!!"); + } + return baseMapper.insertBatch(OpsTenderSupplierInputs); + } + + + /** + * 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等) + * 正常使用只需#processEvent.flowCode=='leave1' + * 示例为了方便则使用startsWith匹配了全部示例key + * + * @param processEvent 参数 + */ +// @org.springframework.context.event.EventListener(condition = "#processEvent.flowCode.endsWith('"+ constant.SUPPLIER_INPUT+"')") +// public void processPlansHandler(ProcessEvent processEvent) { +// log.info("物资计划审核任务执行了{}", processEvent.toString()); +// OpsTenderSupplierInput byId = getById(processEvent.getBusinessId()); +// byId.setState(processEvent.getStatus()); +// boolean b = updateById(byId); +// if (!b){ +// log.error("更改供应商入库状态失败"); +// } +//// String batchNumber = processEvent.getBusinessId().split("_")[0]; +//// //1、根据批次ID改编审核状态 +//// BusCailiaoshebeiPici busCailiaoshebeiPici = new BusCailiaoshebeiPici().setApprovalPlan(processEvent.getStatus()); +//// busCailiaoshebeiPiciService.update(busCailiaoshebeiPici, new LambdaQueryWrapper() +//// .eq(BusCailiaoshebeiPici::getBatchNumber, batchNumber)); +// } +} diff --git a/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/utils/CglxdIdGenerator.java b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/utils/CglxdIdGenerator.java new file mode 100644 index 0000000..f9c1b41 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/java/org/dromara/personnel/utils/CglxdIdGenerator.java @@ -0,0 +1,44 @@ +package org.dromara.personnel.utils; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Random; +import java.util.concurrent.atomic.AtomicInteger; + +public class CglxdIdGenerator { + + // 时间格式化器(线程安全) + private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + + // 随机数生成器 + private static final Random RANDOM = new Random(); + + // 序列号(用于高并发场景,确保同一毫秒内不重复) + private static final AtomicInteger SEQUENCE = new AtomicInteger(0); + + /** + * 生成唯一标识 + * 格式:CGLXD + yyyyMMddHHmmss + 3位随机数(或序列号) + */ + public static String generateId(String prefix) { + // 1. 获取当前时间并格式化 + String timeStr = LocalDateTime.now().format(DATE_TIME_FORMATTER); + + // 2. 生成3位随机数(000-999),或使用序列号 + String randomPart; + // 高并发场景建议用序列号(避免随机数碰撞) + int seq = SEQUENCE.getAndIncrement() % 1000; + randomPart = String.format("%03d", seq); // 补零至3位 + + // 3. 拼接前缀、时间、随机数 + return prefix + timeStr + randomPart; + } + + // 测试 + public static void main(String[] args) { + // 生成10个示例 + for (int i = 0; i < 10; i++) { + System.out.println(generateId("CGLXD")); + } + } +} diff --git a/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsBeipinBeijianMapper.xml b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsBeipinBeijianMapper.xml new file mode 100644 index 0000000..9d9b488 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsBeipinBeijianMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanChanpinMapper.xml b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanChanpinMapper.xml new file mode 100644 index 0000000..25a12e9 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanChanpinMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanFilesMapper.xml b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanFilesMapper.xml new file mode 100644 index 0000000..c53240f --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanFilesMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanMapper.xml b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanMapper.xml new file mode 100644 index 0000000..3dbf143 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsCaigouPlanMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + diff --git a/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsChurukudanMapper.xml b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsChurukudanMapper.xml new file mode 100644 index 0000000..8726bf3 --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsChurukudanMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + diff --git a/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsTenderSupplierInputMapper.xml b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsTenderSupplierInputMapper.xml new file mode 100644 index 0000000..7ab372d --- /dev/null +++ b/ruoyi-modules/xny-ops/src/main/resources/mapper/personnel/OpsTenderSupplierInputMapper.xml @@ -0,0 +1,7 @@ + + + + +