运维-物资管理接口

This commit is contained in:
2025-09-28 20:06:03 +08:00
parent 5f51572b68
commit da9cc7cc76
79 changed files with 6094 additions and 23 deletions

View File

@ -190,4 +190,6 @@ public interface RemoteUserService {
Map<Long, String> selectPostNamesByIds(List<Long> postIds);
RemoteUserVo selectUserByPhonenumber(String phone);
String getPostNameByUserId(Long userId);
}

View File

@ -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);
}
}

View File

@ -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<SysPost, SysPostVo> {
*/
List<SysPostVo> selectPostsByUserId(Long userId);
/**
* 根据用户id获取岗位名称
* @param userId
* @return
*/
String selectPostNameByUserId(@Param("userId") Long userId);
}

View File

@ -127,4 +127,11 @@ public interface ISysPostService {
* @return 结果
*/
int updatePost(SysPostBo bo);
/**
* 根据用户id获取岗位名
* @param userId
* @return
*/
String selectPostNameByUserId(Long userId);
}

View File

@ -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);
}
}

View File

@ -14,5 +14,12 @@
left join sys_user u on u.user_id = up.user_id
where u.user_id = #{userId}
</select>
<select id="selectPostNameByUserId" resultType="java.lang.String">
select p.post_name
from sys_post p
left join sys_user_post up on up.post_id = p.post_id
left join sys_user u on u.user_id = up.user_id
where u.user_id = #{userId}
</select>
</mapper>

View File

@ -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<HashMap<String,Object>> getPowerStationOverview() {
HashMap<String, Object> map = ginlongApiService.getPowerStationOverview();
return R.ok(map);
}
/**
* 查询手续办理清单模板列表
*/
@SaCheckPermission("formalities:listOfFormalities:list")
@GetMapping("/getInverterListOverview")
public R<HashMap<String,Object>> getInverterListOverview(GinlongBo bo) {
HashMap<String, Object> map = ginlongApiService.getInverterListOverview(bo);
return R.ok(map);
}
/**
* 能源收益分析
*/
@SaCheckPermission("formalities:listOfFormalities:list")
@GetMapping("/getStationMonthOverview")
public R<HashMap<String,Object>> getStationMonthOverview(GinlongBo bo) {
HashMap<String, Object> map = ginlongApiService.getStationMonthOverview(bo);
return R.ok(map);
}
/**
* 告警信息
*/
@SaCheckPermission("formalities:listOfFormalities:list")
@GetMapping("/getAlarmListOverview")
public R<List<HashMap<String,Object>>> getAlarmListOverview() {
return R.ok(ginlongApiService.getAlarmListOverview());
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<String, Object> getPowerStationOverview();
/**
* 查询逆变器数据
* @return
*/
HashMap<String, Object> getInverterListOverview(GinlongBo bo);
/**
* 查询能源收益分析
* @param bo
* @return
*/
HashMap<String, Object> getStationMonthOverview(GinlongBo bo);
/**
* 查询全部设备报警信息
*/
List<HashMap<String, Object>> getAlarmListOverview();
}

View File

@ -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<String, Object> 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<String, Object> 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<Long> idList){
try {
Map<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<Long> idList, String date){
// try {
// Map<String, Object> 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<Long> idList, String date){
// try {
// Map<String, Object> 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<Long> idList, String date){
// try {
// Map<String, Object> 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<String, Object> 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<String, Object> getPowerStationOverview() {
HashMap<String, Object> map = new HashMap<>();
GinlongApiEntity apiEntity = getGinlongApiEntity();
double dayEnergy = 0.0; //今日总发电量
List<Long> 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<String, Object> 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<String, Object> getInverterListOverview(GinlongBo bo) {
HashMap<String, Object> 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<Long> ids = new ArrayList<>();
if (!records.isEmpty()) {
for (Object record : records) {
JSONObject object = JSONUtil.parseObj(record);
ids.add(object.getLong("id"));
}
}
List<HashMap<String, Object>> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> getStationMonthOverview(GinlongBo bo) {
HashMap<String, Object> map = new HashMap<>();
GinlongApiEntity apiEntity = getGinlongApiEntity();
List<Long> 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<HashMap<String, Object>> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<HashMap<String, Object>> getAlarmListOverview() {
List<HashMap<String, Object>> 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<String, Object> 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<String, Object> 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<Long> idList, HashMap<String, Object> 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<Long> 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<Long> 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);
}
}

View File

@ -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<String, Object> 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);
}
}

View File

@ -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<OpsBeipinBeijianVo> 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<OpsBeipinBeijianVo> list = opsBeipinBeijianService.queryList(bo);
ExcelUtil.exportExcel(list, "运维-物资-备品配件", OpsBeipinBeijianVo.class, response);
}
/**
* 获取运维-物资-备品配件详细信息
*
* @param id 主键
*/
@SaCheckPermission("personnel:beipinBeijian:query")
@GetMapping("/{id}")
public R<OpsBeipinBeijianVo> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable("ids") Long[] ids) {
return toAjax(opsBeipinBeijianService.deleteWithValidByIds(List.of(ids), true));
}
}

View File

@ -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<OpsCaigouPlanVo> list(OpsCaigouPlanReq bo, PageQuery pageQuery) {
return opsCaigouPlanService.queryPageList(bo, pageQuery);
}
/**
* 出入库表单新增修改获取产品列表
*/
@SaCheckPermission("personnel:caigouPlan:list")
@GetMapping("/getChanpinList")
public R<List<OpsCaigouPlanChanpinListVo>> getChanpinList(OpsCaigouPlanReq bo) {
return R.ok(opsCaigouPlanService.getChanpinList(bo));
}
/**
* 查询运维-物资-采购计划单数量统计
*/
@SaCheckPermission("personnel:caigouPlan:getCount")
@GetMapping("/getCount")
public R<List<OpsCaigouPlanCountVo>> getCount(Long projectId) {
if (projectId == null) {
throw new ServiceException("项目id不能为空");
}
return R.ok(opsCaigouPlanService.getCountVo(projectId));
}
/**
* 查询运维-物资-采购计划单年度金额
*/
@SaCheckPermission("personnel:caigouPlan:getJinE")
@GetMapping("/getJinE")
public R<OpsCaigouPlanVo> 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<OpsCaigouPlanVo> list = opsCaigouPlanService.queryList(bo);
ExcelUtil.exportExcel(list, "运维-物资-采购计划单", OpsCaigouPlanVo.class, response);
}
/**
* 获取运维-物资-采购计划单详细信息
*
* @param id 主键
*/
@SaCheckPermission("personnel:caigouPlan:query")
@GetMapping("/{id}")
public R<OpsCaigouPlanVo> 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<Void> 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<Void> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable("ids") Long[] ids) {
return toAjax(opsCaigouPlanService.deleteWithValidByIds(List.of(ids), true));
}
}

View File

@ -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<OpsChurukudanVo> 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<OpsChurukudanCountDto> 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<OpsChurukudanDayCountDto> 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<OpsChurukudanVo> list = opsChurukudanService.queryList(bo);
ExcelUtil.exportExcel(list, "运维-物资-出入库单管理", OpsChurukudanVo.class, response);
}
/**
* 获取运维-物资-出入库单管理详细信息
*
* @param id 主键
*/
@SaCheckPermission("personnel:churukudan:query")
@GetMapping("/{id}")
public R<OpsChurukudanVo> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable("ids") Long[] ids) {
return toAjax(opsChurukudanService.deleteWithValidByIds(List.of(ids), true));
}
}

View File

@ -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<Void> 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<Void> add(@Validated(AddGroup.class) @RequestBody OpsSchedulingBo bo) {
return toAjax(opsSchedulingService.insertByBo(bo));
return toAjax(opsSchedulingService.insertOneByBo(bo));
}
/**

View File

@ -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<OpsTenderSupplierInputVo> list(OpsTenderSupplierInputBo bo, PageQuery pageQuery) {
return tenderSupplierInputService.queryPageList(bo, pageQuery);
}
/**
* 查询供应商入库列表
*/
@SaCheckPermission("supplierInput:supplierInput:getList")
@GetMapping("/getList")
public R<List<OpsTenderSupplierInputVo>> 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<OpsTenderSupplierInputVo> list = tenderSupplierInputService.queryList(bo);
ExcelUtil.exportExcel(list, "供应商入库", OpsTenderSupplierInputVo.class, response);
}
/**
* 导入供应商入库 入库资料文件只有导入后修改进行上传
*/
@SaCheckPermission("supplierInput:supplierInput:import")
@Log(title = "供应商入库", businessType = BusinessType.IMPORT)
@PostMapping("/import")
public R<Void> importData(Long projectId,@RequestParam("file") MultipartFile file) throws IOException {
List<OpsTenderSupplierInputVo> tenderSupplierInputVos = ExcelUtil.importExcel(file.getInputStream(), OpsTenderSupplierInputVo.class);
return toAjax(tenderSupplierInputService.importData(tenderSupplierInputVos,projectId));
}
/**
* 获取供应商入库详细信息
*
* @param id 主键
*/
@SaCheckPermission("supplierInput:supplierInput:query")
@GetMapping("/{id}")
public R<OpsTenderSupplierInputVo> 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<Void> add(OpsTenderSupplierInputBo bo) {
return toAjax(tenderSupplierInputService.insertByBo(bo));
}
/**
* 修改供应商入库
*/
@Transactional
@SaCheckPermission("supplierInput:supplierInput:edit")
@Log(title = "供应商入库", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(OpsTenderSupplierInputBo bo) {
return toAjax(tenderSupplierInputService.updateByBo(bo));
}
/**
* 删除供应商入库
*
* @param ids 主键串
*/
@SaCheckPermission("supplierInput:supplierInput:remove")
@Log(title = "供应商入库", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(tenderSupplierInputService.deleteWithValidByIds(List.of(ids), true));
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<OpsCaigouPlanFilesBo> opsCaigouPlanFilesBos;
/**
* 产品信息
*/
private List<OpsCaigouPlanChanpinBo> opsCaigouPlanChanpinBos;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<Long> opsUserId;
/**
* 排班类型id

View File

@ -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<String> shebeiType;
/**
* 入库数量
*/
private List<Long> rukuCounnt;
/**
* 出库数量
*/
private List<Long> chukuCounnt;
}

View File

@ -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<String> days;
/**
* 入库数量
*/
private List<Long> rukuCounnts;
/**
* 出库数量
*/
private List<Long> chukuCounnts;
}

View File

@ -11,6 +11,7 @@ import java.util.List;
public class SchedulingUserGroupDTO implements Serializable {
private Long opsUserId; // 运维人员ID
private String opsUserName; // 运维人员ID
private String postName;
/**
* 总时长
*/

View File

@ -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

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<OpsCaigouPlanFilesVo> opsCaigouPlanFilesVos;
/**
* 产品信息
*/
private List<OpsCaigouPlanChanpinVo> opsCaigouPlanChanpinVos;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<OpsBeipinBeijian, OpsBeipinBeijianVo> {
}

View File

@ -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<OpsCaigouPlanChanpin, OpsCaigouPlanChanpinVo> {
}

View File

@ -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<OpsCaigouPlanFiles, OpsCaigouPlanFilesVo> {
}

View File

@ -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<OpsCaigouPlan, OpsCaigouPlanVo> {
List<OpsCaigouPlanCountVo> getCountVo(@Param("projectId") Long projectId);
List<OpsCaigouPlanChanpinListVo> getChanpinList(@Param("projectId") Long projectId);
}

View File

@ -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<OpsChurukudan, OpsChurukudanVo> {
List<OpsChurukudanCountVo> getChuRuKuCount(@Param("bo") OpsChurukudanReq bo);
List<OpsChurukudanDayCountVo> 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);
}

View File

@ -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<OpsTenderSupplierInput, OpsTenderSupplierInputVo> {
}

View File

@ -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<OpsBeipinBeijian> {
/**
* 查询运维-物资-备品配件
*
* @param id 主键
* @return 运维-物资-备品配件
*/
OpsBeipinBeijianVo queryById(Long id);
/**
* 分页查询运维-物资-备品配件列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 运维-物资-备品配件分页列表
*/
TableDataInfo<OpsBeipinBeijianVo> queryPageList(OpsBeipinBeijianBo bo, PageQuery pageQuery);
/**
* 查询符合条件的运维-物资-备品配件列表
*
* @param bo 查询条件
* @return 运维-物资-备品配件列表
*/
List<OpsBeipinBeijianVo> 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<Long> ids, Boolean isValid);
}

View File

@ -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<OpsCaigouPlanChanpin> {
/**
* 查询运维-物资-采购申请计划-产品信息
*
* @param id 主键
* @return 运维-物资-采购申请计划-产品信息
*/
OpsCaigouPlanChanpinVo queryById(Long id);
/**
* 分页查询运维-物资-采购申请计划-产品信息列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 运维-物资-采购申请计划-产品信息分页列表
*/
TableDataInfo<OpsCaigouPlanChanpinVo> queryPageList(OpsCaigouPlanChanpinBo bo, PageQuery pageQuery);
/**
* 查询符合条件的运维-物资-采购申请计划-产品信息列表
*
* @param bo 查询条件
* @return 运维-物资-采购申请计划-产品信息列表
*/
List<OpsCaigouPlanChanpinVo> 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<Long> ids, Boolean isValid);
/**
* 根据采购计划id获取产品信息
* @param id
* @return
*/
List<OpsCaigouPlanChanpinVo> getVoByCaiGouPlanId(Long caigouId);
}

View File

@ -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<OpsCaigouPlanFiles> {
/**
* 查询运维-物资-采购申请计划文件
*
* @param id 主键
* @return 运维-物资-采购申请计划文件
*/
OpsCaigouPlanFilesVo queryById(Long id);
/**
* 分页查询运维-物资-采购申请计划文件列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 运维-物资-采购申请计划文件分页列表
*/
TableDataInfo<OpsCaigouPlanFilesVo> queryPageList(OpsCaigouPlanFilesBo bo, PageQuery pageQuery);
/**
* 查询符合条件的运维-物资-采购申请计划文件列表
*
* @param bo 查询条件
* @return 运维-物资-采购申请计划文件列表
*/
List<OpsCaigouPlanFilesVo> 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<Long> ids, Boolean isValid);
/**
* 根据采购计划id获取采购计划附件数据
* @param id
* @return
*/
List<OpsCaigouPlanFilesVo> getVoByCaiGouPlanId(Long caigouId);
}

View File

@ -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<OpsCaigouPlan> {
/**
* 查询运维-物资-采购计划单
*
* @param id 主键
* @return 运维-物资-采购计划单
*/
OpsCaigouPlanVo queryById(Long id);
/**
* 分页查询运维-物资-采购计划单列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 运维-物资-采购计划单分页列表
*/
TableDataInfo<OpsCaigouPlanVo> queryPageList(OpsCaigouPlanReq bo, PageQuery pageQuery);
/**
* 查询符合条件的运维-物资-采购计划单列表
*
* @param bo 查询条件
* @return 运维-物资-采购计划单列表
*/
List<OpsCaigouPlanVo> 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<Long> ids, Boolean isValid);
/**
* 统计各个状态数量
* @param projectId
* @return
*/
List<OpsCaigouPlanCountVo> 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<OpsCaigouPlanChanpinListVo> getChanpinList(OpsCaigouPlanReq bo);
}

View File

@ -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<OpsChurukudan> {
/**
* 查询运维-物资-出入库单管理
*
* @param id 主键
* @return 运维-物资-出入库单管理
*/
OpsChurukudanVo queryById(Long id);
/**
* 分页查询运维-物资-出入库单管理列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 运维-物资-出入库单管理分页列表
*/
TableDataInfo<OpsChurukudanVo> queryPageList(OpsChurukudanReq bo, PageQuery pageQuery);
/**
* 查询符合条件的运维-物资-出入库单管理列表
*
* @param bo 查询条件
* @return 运维-物资-出入库单管理列表
*/
List<OpsChurukudanVo> 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<Long> ids, Boolean isValid);
/**
* 查询本月出入库类型
* @param bo
* @return
*/
OpsChurukudanCountDto getChuRuKuCount(OpsChurukudanReq bo);
/**
* 查询出入库月中每天的出入库数量
* @param bo
* @return
*/
OpsChurukudanDayCountDto getChuRuKuDayCount(OpsChurukudanReq bo);
}

View File

@ -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<OpsEquipment> {
/**
* 查询运维-设备

View File

@ -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<OpsSchedulingDate> {
/**
* 查询运维-排班时间类型

View File

@ -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<OpsScheduling> {
/**
* 查询运维-人员排班
@ -76,4 +78,6 @@ public interface IOpsSchedulingService {
List<SchedulingUserGroupDTO> getRiLiList(OpsSchedulingReq req);
Boolean allEdit(OpsSchedulingBo bo);
Boolean insertOneByBo(OpsSchedulingBo bo);
}

View File

@ -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<OpsTenderSupplierInput> {
/**
* 查询供应商入库
*
* @param id 主键
* @return 供应商入库
*/
OpsTenderSupplierInputVo queryById(Long id);
/**
* 分页查询供应商入库列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 供应商入库分页列表
*/
TableDataInfo<OpsTenderSupplierInputVo> queryPageList(OpsTenderSupplierInputBo bo, PageQuery pageQuery);
/**
* 查询符合条件的供应商入库列表
*
* @param bo 查询条件
* @return 供应商入库列表
*/
List<OpsTenderSupplierInputVo> 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<Long> ids, Boolean isValid);
List<OpsTenderSupplierInputVo> getList(OpsTenderSupplierInputBo bo);
boolean importData(List<OpsTenderSupplierInputVo> tenderSupplierInputVos, Long projectId);
}

View File

@ -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<OpsBeipinBeijianMapper,OpsBeipinBeijian> 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<OpsBeipinBeijianVo> queryPageList(OpsBeipinBeijianBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OpsBeipinBeijian> lqw = buildQueryWrapper(bo);
Page<OpsBeipinBeijianVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询符合条件的运维-物资-备品配件列表
*
* @param bo 查询条件
* @return 运维-物资-备品配件列表
*/
@Override
public List<OpsBeipinBeijianVo> queryList(OpsBeipinBeijianBo bo) {
LambdaQueryWrapper<OpsBeipinBeijian> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<OpsBeipinBeijian> buildQueryWrapper(OpsBeipinBeijianBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<OpsBeipinBeijian> 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<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

View File

@ -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<OpsCaigouPlanChanpinMapper,OpsCaigouPlanChanpin> 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<OpsCaigouPlanChanpinVo> queryPageList(OpsCaigouPlanChanpinBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OpsCaigouPlanChanpin> lqw = buildQueryWrapper(bo);
Page<OpsCaigouPlanChanpinVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询符合条件的运维-物资-采购申请计划-产品信息列表
*
* @param bo 查询条件
* @return 运维-物资-采购申请计划-产品信息列表
*/
@Override
public List<OpsCaigouPlanChanpinVo> queryList(OpsCaigouPlanChanpinBo bo) {
LambdaQueryWrapper<OpsCaigouPlanChanpin> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<OpsCaigouPlanChanpin> buildQueryWrapper(OpsCaigouPlanChanpinBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<OpsCaigouPlanChanpin> 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<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
@Override
public List<OpsCaigouPlanChanpinVo> getVoByCaiGouPlanId(Long caigouId) {
return baseMapper.selectVoList(new LambdaQueryWrapper<OpsCaigouPlanChanpin>().eq(OpsCaigouPlanChanpin::getCaigouPlanId, caigouId));
}
}

View File

@ -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<OpsCaigouPlanFilesMapper,OpsCaigouPlanFiles> 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<OpsCaigouPlanFilesVo> queryPageList(OpsCaigouPlanFilesBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OpsCaigouPlanFiles> lqw = buildQueryWrapper(bo);
Page<OpsCaigouPlanFilesVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询符合条件的运维-物资-采购申请计划文件列表
*
* @param bo 查询条件
* @return 运维-物资-采购申请计划文件列表
*/
@Override
public List<OpsCaigouPlanFilesVo> queryList(OpsCaigouPlanFilesBo bo) {
LambdaQueryWrapper<OpsCaigouPlanFiles> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<OpsCaigouPlanFiles> buildQueryWrapper(OpsCaigouPlanFilesBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<OpsCaigouPlanFiles> 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<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
@Override
public List<OpsCaigouPlanFilesVo> getVoByCaiGouPlanId(Long caigouId) {
return baseMapper.selectVoList(new LambdaQueryWrapper<OpsCaigouPlanFiles>().eq(OpsCaigouPlanFiles::getCaigouPlanId, caigouId));
}
}

View File

@ -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<OpsCaigouPlanMapper,OpsCaigouPlan> 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<OpsCaigouPlanVo> queryPageList(OpsCaigouPlanReq bo, PageQuery pageQuery) {
LambdaQueryWrapper<OpsCaigouPlan> lqw = buildQueryWrapper(bo);
Page<OpsCaigouPlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询符合条件的运维-物资-采购计划单列表
*
* @param bo 查询条件
* @return 运维-物资-采购计划单列表
*/
@Override
public List<OpsCaigouPlanVo> queryList(OpsCaigouPlanReq bo) {
LambdaQueryWrapper<OpsCaigouPlan> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<OpsCaigouPlan> buildQueryWrapper(OpsCaigouPlanReq bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<OpsCaigouPlan> 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<OpsCaigouPlanChanpinBo> 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<OpsCaigouPlanChanpin> planChanpinList = BeanUtil.copyToList(opsCaigouPlanChanpinBos, OpsCaigouPlanChanpin.class);
caigouPlanChanpinService.saveBatch(planChanpinList);
List<OpsCaigouPlanFilesBo> opsCaigouPlanFilesBos = bo.getOpsCaigouPlanFilesBos();
opsCaigouPlanFilesBos.forEach(fileBo -> {
fileBo.setCaigouPlanId(add.getId());
});
List<OpsCaigouPlanFiles> 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<OpsCaigouPlanChanpin>().eq(OpsCaigouPlanChanpin::getCaigouPlanId, bo.getId()));
caigouPlanFilesService.getBaseMapper().delete(new LambdaQueryWrapper<OpsCaigouPlanFiles>().eq(OpsCaigouPlanFiles::getCaigouPlanId, bo.getId()));
OpsCaigouPlan update = MapstructUtils.convert(bo, OpsCaigouPlan.class);
validEntityBeforeSave(update);
List<OpsCaigouPlanChanpinBo> 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<OpsCaigouPlanChanpin> planChanpinList = MapstructUtils.convert(opsCaigouPlanChanpinBos, OpsCaigouPlanChanpin.class);
caigouPlanChanpinService.saveBatch(planChanpinList);
List<OpsCaigouPlanFilesBo> opsCaigouPlanFilesBos = bo.getOpsCaigouPlanFilesBos();
opsCaigouPlanFilesBos.forEach(fileBo -> {
fileBo.setCaigouPlanId(update.getId());
});
List<OpsCaigouPlanFiles> 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<OpsCaigouPlan>()
.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<Long> 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<OpsCaigouPlanCountVo> 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<OpsCaigouPlanVo> opsCaigouPlanVos = baseMapper.selectVoList(new LambdaQueryWrapper<OpsCaigouPlan>()
.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<OpsCaigouPlanChanpinListVo> getChanpinList(OpsCaigouPlanReq bo) {
return baseMapper.getChanpinList(bo.getProjectId());
}
}

View File

@ -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<OpsChurukudanMapper,OpsChurukudan> 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<OpsChurukudanVo> queryPageList(OpsChurukudanReq bo, PageQuery pageQuery) {
LambdaQueryWrapper<OpsChurukudan> lqw = buildQueryWrapper(bo);
Page<OpsChurukudanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询符合条件的运维-物资-出入库单管理列表
*
* @param bo 查询条件
* @return 运维-物资-出入库单管理列表
*/
@Override
public List<OpsChurukudanVo> queryList(OpsChurukudanReq bo) {
LambdaQueryWrapper<OpsChurukudan> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<OpsChurukudan> buildQueryWrapper(OpsChurukudanReq bo) {
LambdaQueryWrapper<OpsChurukudan> 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<Long> 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<String> shebeiType = new ArrayList<>();
List<Long> rukuCounnt = new ArrayList<>();
List<Long> chukuCounnt = new ArrayList<>();
List<OpsChurukudanCountVo> 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<String> days = new ArrayList<>();
List<Long> rukuCounnt = new ArrayList<>();
List<Long> chukuCounnt = new ArrayList<>();
List<OpsChurukudanDayCountVo> 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;
}
}

View File

@ -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<OpsEquipmentMapper,OpsEquipment> implements IOpsEquipmentService {
private final OpsEquipmentMapper baseMapper;

View File

@ -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<OpsSchedulingDateMapper,OpsSchedulingDate> implements IOpsSchedulingDateService {
private final OpsSchedulingDateMapper baseMapper;

View File

@ -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<OpsSchedulingMapper,OpsScheduling> 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<UserTypePairDTO> 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);

View File

@ -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<OpsTenderSupplierInputMapper,OpsTenderSupplierInput> 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<OpsTenderSupplierInputVo> queryPageList(OpsTenderSupplierInputBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<OpsTenderSupplierInput> lqw = buildQueryWrapper(bo);
Page<OpsTenderSupplierInputVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询符合条件的供应商入库列表
*
* @param bo 查询条件
* @return 供应商入库列表
*/
@Override
public List<OpsTenderSupplierInputVo> queryList(OpsTenderSupplierInputBo bo) {
LambdaQueryWrapper<OpsTenderSupplierInput> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<OpsTenderSupplierInput> buildQueryWrapper(OpsTenderSupplierInputBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<OpsTenderSupplierInput> 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<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
List<String> 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<OpsTenderSupplierInputVo> getList(OpsTenderSupplierInputBo bo) {
bo.setState("finish");
LambdaQueryWrapper<OpsTenderSupplierInput> lqw = buildQueryWrapper(bo);
List<OpsTenderSupplierInputVo> OpsTenderSupplierInputVos = baseMapper.selectVoList(lqw);
List<OpsTenderSupplierInputVo> 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<OpsTenderSupplierInputVo> OpsTenderSupplierInputVos, Long projectId) {
List<OpsTenderSupplierInputVo> OpsTenderSupplierInputVos1 = OpsTenderSupplierInputVos.stream()
.collect(Collectors.collectingAndThen(
Collectors.toCollection(() ->
new TreeSet<>(Comparator.comparing(item ->
item.getSupplierName() + "_" + item.getSupplierPerson() + "_" + item.getSupplierCode()))),
ArrayList::new
));
List<OpsTenderSupplierInput> OpsTenderSupplierInputs = new ArrayList<>();
for (OpsTenderSupplierInputVo OpsTenderSupplierInputVo : OpsTenderSupplierInputVos1) {
Long count = baseMapper.selectCount(new LambdaQueryWrapper<OpsTenderSupplierInput>()
.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<BusCailiaoshebeiPici>()
//// .eq(BusCailiaoshebeiPici::getBatchNumber, batchNumber));
// }
}

View File

@ -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"));
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.personnel.mapper.OpsBeipinBeijianMapper">
</mapper>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.personnel.mapper.OpsCaigouPlanChanpinMapper">
</mapper>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.personnel.mapper.OpsCaigouPlanFilesMapper">
</mapper>

View File

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.personnel.mapper.OpsCaigouPlanMapper">
<select id="getCountVo" resultType="org.dromara.personnel.domain.vo.OpsCaigouPlanCountVo">
SELECT
ocp.`status` AS planType,
COUNT(*) AS palnCount
FROM
ops_caigou_plan ocp
WHERE
ocp.project_id = #{projectId}
GROUP BY
ocp.`status`
</select>
<select id="getChanpinList" resultType="org.dromara.personnel.domain.vo.OpsCaigouPlanChanpinListVo">
SELECT
ocpc.id AS id,
ocp.jihua_name AS caigouPlanName,
ocpc.chanpin_name AS chanpinName
FROM
ops_caigou_plan_chanpin ocpc
LEFT JOIN ops_caigou_plan ocp ON ocpc.caigou_plan_id = ocp.id
WHERE ocp.project_id = #{projectId} AND ocp.status = "11"
ORDER BY ocp.create_time
</select>
</mapper>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.personnel.mapper.OpsChurukudanMapper">
<select id="getChuRuKuCount" resultType="org.dromara.personnel.domain.vo.OpsChurukudanCountVo">
SELECT
IFNULL(ocpc.shebei_type, '未分类') AS shebei_type,
SUM(CASE WHEN oc.danjv_type = '1' THEN oc.zon_number ELSE 0 END) AS chuku_total,
SUM(CASE WHEN oc.danjv_type = '2' THEN oc.zon_number ELSE 0 END) AS rukuku_total
FROM
ops_churukudan oc left join ops_caigou_plan_chanpin ocpc ON ocpc.id = oc.chanpin_id
WHERE
oc.shenhe_status = 'finish' AND
oc.project_id = #{bo.projectId} AND
oc.create_time BETWEEN CAST(#{bo.startDate} AS DATE) AND CAST(#{bo.endDate} AS DATE)
GROUP BY
ocpc.shebei_type
ORDER BY
ocpc.shebei_type
</select>
<select id="getChuRuKuDayCount" resultType="org.dromara.personnel.domain.vo.OpsChurukudanDayCountVo">
WITH RECURSIVE date_series AS (
SELECT CAST(#{bo.startDate} AS DATE) AS stat_day
UNION ALL
SELECT DATE_ADD(stat_day, INTERVAL 1 DAY)
FROM date_series
WHERE stat_day &lt; CAST(#{bo.endDate} AS DATE)
)
-- 关联统计结果,确保每天都出现
SELECT
ds.stat_day AS statDay,
-- 无数据时显示0而非NULL
COALESCE(t.chuku_total, 0) AS chukuCounnt,
COALESCE(t.rukou_total, 0) AS rukuCounnt
FROM
date_series ds
LEFT JOIN (
SELECT
DATE(create_time) AS stat_day,
SUM(CASE WHEN danjv_type = '1' THEN zon_number ELSE 0 END) AS chuku_total,
SUM(CASE WHEN danjv_type = '2' THEN zon_number ELSE 0 END) AS rukou_total
FROM
ops_churukudan
WHERE
shenhe_status = 'finish' -- 仅统计已完成的单据
AND create_time BETWEEN CAST(#{bo.startDate} AS DATE) AND CAST(#{bo.endDate} AS DATE)
GROUP BY
DATE(create_time)
) t ON ds.stat_day = t.stat_day
ORDER BY
ds.stat_day; -- 按日期升序排列
</select>
<select id="getChuRuKuZonCount" resultType="java.lang.Long">
SELECT
SUM(zon_number)
FROM
ops_churukudan
WHERE
project_id = #{projectId}
AND chanpin_id = #{chanpinId}
AND danjv_type = #{type}
</select>
</mapper>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.personnel.mapper.OpsTenderSupplierInputMapper">
</mapper>