Compare commits
184 Commits
dad8a12e11
...
dev
Author | SHA1 | Date | |
---|---|---|---|
5b94ae37cd | |||
26cf862d6e | |||
f7cd344a0b | |||
89c89cbfcd | |||
868616ea26 | |||
b5cf663a2b | |||
4c536ca269 | |||
f0f30ce841 | |||
4d2a2186c9 | |||
c277e5f80d | |||
21aae1f8c0 | |||
7e90c101e8 | |||
c3899ae6a2 | |||
c662e1aa4d | |||
91f01dc012 | |||
ce972d030f | |||
dd025df653 | |||
d77e12ee4e | |||
9afda7305c | |||
974b11f8d3 | |||
a1d1aaff49 | |||
9402c3c9f3 | |||
8e9307bf00 | |||
c68d6cb53c | |||
8e84195e98 | |||
542c4e91ac | |||
47b0a4b087 | |||
6ace8b0dc2 | |||
1e33027d4f | |||
9fbc9dbc45 | |||
8bf12d04cd | |||
00dcc00b05 | |||
0b29401112 | |||
e8c78865cb | |||
a8cb16ab3f | |||
2c45762c66 | |||
056b28af31 | |||
7dd6d97a3e | |||
697beb67c4 | |||
4d627af3a1 | |||
ab332c462f | |||
0f3d1e38be | |||
4392a287cc | |||
f38538be33 | |||
ede1e501b4 | |||
4a2b62cf92 | |||
325f392e8f | |||
5b991396c2 | |||
c75563b46a | |||
724ebf8dbd | |||
a52b9078a0 | |||
9d682a3290 | |||
abad289c2b | |||
820188863e | |||
113b5debc9 | |||
6b4cd4ae0d | |||
261dd0b643 | |||
71f3810e51 | |||
fa835684d4 | |||
e19ef3003a | |||
8a18223d06 | |||
c90828f98e | |||
2ecb0063bf | |||
998547e63f | |||
78829ef5e7 | |||
da0dd8f78f | |||
96d0406931 | |||
d7616960c6 | |||
66e8495859 | |||
95c2858a64 | |||
5cbb0c630b | |||
e0cc521291 | |||
ff9f49b1d9 | |||
b738bb821d | |||
2cea57646d | |||
ab5cd491d6 | |||
3f3e20a64b | |||
f5d9cb7fc1 | |||
5b05d2eb40 | |||
fbffc18a9f | |||
490820d080 | |||
8e9b7c9b14 | |||
ae3738c098 | |||
127059e934 | |||
742e67af23 | |||
4e61a4afe9 | |||
43d249d68a | |||
dc8a89f05e | |||
17d4041ef3 | |||
d19cda78b3 | |||
2f0b548f20 | |||
f1aed20560 | |||
8c412d033b | |||
a929225ed5 | |||
3b6b1d53a9 | |||
81162852a2 | |||
f584e6233c | |||
e8da350f0b | |||
e916829032 | |||
8c131cb9a5 | |||
9aef0d4b86 | |||
de5c569f88 | |||
79edeb6ccd | |||
a3ef525ab6 | |||
659e4e3d5f | |||
96e6c75949 | |||
711c473749 | |||
4636aa3c05 | |||
788f13fa7b | |||
a588b94310 | |||
b44de3ff49 | |||
5d643fbc6a | |||
19fd73f4c8 | |||
a07792c8e3 | |||
8a29ffdd2e | |||
d46f672b9a | |||
d6528845e4 | |||
0ff805683f | |||
3f79a955b3 | |||
971c8c277d | |||
12f02638a2 | |||
b1c21b1f88 | |||
642d5c73ca | |||
d7054d6f02 | |||
e85bbca73b | |||
3f5396e347 | |||
c9041df9b8 | |||
87e510aafc | |||
4e4497a07f | |||
7c4f6b8add | |||
7daf2ada66 | |||
073f614a21 | |||
1878a7dab3 | |||
aa31eb97b9 | |||
4f8776930e | |||
f171238029 | |||
377892f691 | |||
7e0cd7c946 | |||
936145138e | |||
e6f37662b0 | |||
3ea6050dc3 | |||
f7940e23fa | |||
3d57edf374 | |||
797e913b69 | |||
2e40c3ac6d | |||
61dc34c79e | |||
5772b5fc83 | |||
971101d5e8 | |||
508d81bedf | |||
57a39ad727 | |||
126fdeb6ba | |||
8e07ecc69b | |||
c26f23cfb0 | |||
b008a472fc | |||
c2ce524ef3 | |||
a2b33f3b53 | |||
551dd084b8 | |||
35323fa352 | |||
3f6af11dff | |||
5cecdaf385 | |||
2fda6c8930 | |||
7095a58083 | |||
fe32eb945c | |||
c9c0224145 | |||
d47fdbd9c3 | |||
50c35315b6 | |||
05c57c19b9 | |||
8ea683599d | |||
60997ab90e | |||
967d97312e | |||
2db941ef97 | |||
700f95a334 | |||
aa2685c2ec | |||
baf0794cce | |||
8e3d37718c | |||
969a70f62c | |||
dc02c5dfae | |||
f06d46469e | |||
476c19019e | |||
8d460b418e | |||
e8e04cae63 | |||
05c1a37704 | |||
cf5d71d528 | |||
86945b9122 |
BIN
file/resource/fonts/simhei.ttf
Normal file
BIN
file/resource/fonts/simhei.ttf
Normal file
Binary file not shown.
@ -307,7 +307,6 @@
|
|||||||
<artifactId>snail-job-client-job-core</artifactId>
|
<artifactId>snail-job-client-job-core</artifactId>
|
||||||
<version>${snailjob.version}</version>
|
<version>${snailjob.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 加密包引入 -->
|
<!-- 加密包引入 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
@ -331,7 +330,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
<version>2.15.0</version>
|
<version>2.16.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -6,6 +6,7 @@ import cn.dev33.satoken.stp.StpUtil;
|
|||||||
import cn.hutool.core.codec.Base64;
|
import cn.hutool.core.codec.Base64;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -28,6 +29,8 @@ import org.dromara.common.social.utils.SocialUtils;
|
|||||||
import org.dromara.common.sse.dto.SseMessageDto;
|
import org.dromara.common.sse.dto.SseMessageDto;
|
||||||
import org.dromara.common.sse.utils.SseMessageUtils;
|
import org.dromara.common.sse.utils.SseMessageUtils;
|
||||||
import org.dromara.common.tenant.helper.TenantHelper;
|
import org.dromara.common.tenant.helper.TenantHelper;
|
||||||
|
import org.dromara.sms4j.api.SmsBlend;
|
||||||
|
import org.dromara.sms4j.core.factory.SmsFactory;
|
||||||
import org.dromara.system.domain.bo.SysTenantBo;
|
import org.dromara.system.domain.bo.SysTenantBo;
|
||||||
import org.dromara.system.domain.vo.SysClientVo;
|
import org.dromara.system.domain.vo.SysClientVo;
|
||||||
import org.dromara.system.domain.vo.SysTenantVo;
|
import org.dromara.system.domain.vo.SysTenantVo;
|
||||||
@ -41,16 +44,20 @@ import org.dromara.web.domain.vo.TenantListVo;
|
|||||||
import org.dromara.web.service.IAuthStrategy;
|
import org.dromara.web.service.IAuthStrategy;
|
||||||
import org.dromara.web.service.SysLoginService;
|
import org.dromara.web.service.SysLoginService;
|
||||||
import org.dromara.web.service.SysRegisterService;
|
import org.dromara.web.service.SysRegisterService;
|
||||||
|
import org.dromara.websocket.domain.ChatGroup;
|
||||||
|
import org.dromara.websocket.service.Impl.ChatGroupServiceImpl;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认证
|
* 认证
|
||||||
@ -72,6 +79,7 @@ public class AuthController {
|
|||||||
private final ISysSocialService socialUserService;
|
private final ISysSocialService socialUserService;
|
||||||
private final ISysClientService clientService;
|
private final ISysClientService clientService;
|
||||||
private final ScheduledExecutorService scheduledExecutorService;
|
private final ScheduledExecutorService scheduledExecutorService;
|
||||||
|
private final ChatGroupServiceImpl chatGroupService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,10 +111,7 @@ public class AuthController {
|
|||||||
|
|
||||||
// Long userId = LoginHelper.getUserId();
|
// Long userId = LoginHelper.getUserId();
|
||||||
// scheduledExecutorService.schedule(() -> {
|
// scheduledExecutorService.schedule(() -> {
|
||||||
// SseMessageDto dto = new SseMessageDto();
|
// chatGroupService.createSystem(userId,client.getClientKey());
|
||||||
// dto.setMessage("欢迎登录新能源项目管理系统");
|
|
||||||
// dto.setUserIds(List.of(userId));
|
|
||||||
// SseMessageUtils.publishMessage(dto);
|
|
||||||
// }, 5, TimeUnit.SECONDS);
|
// }, 5, TimeUnit.SECONDS);
|
||||||
return R.ok(loginVo);
|
return R.ok(loginVo);
|
||||||
}
|
}
|
||||||
@ -193,6 +198,17 @@ public class AuthController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/app/register")
|
||||||
|
public R<Void> appRegister(@Validated @RequestBody RegisterBody user) {
|
||||||
|
if("sms".equals(user.getGrantType())){
|
||||||
|
registerService.appSmsRegister(user);
|
||||||
|
}else {
|
||||||
|
registerService.appRegister(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录页面租户下拉框
|
* 登录页面租户下拉框
|
||||||
*
|
*
|
||||||
|
@ -57,16 +57,23 @@ public class CaptchaController {
|
|||||||
*/
|
*/
|
||||||
@RateLimiter(key = "#phonenumber", time = 60, count = 1)
|
@RateLimiter(key = "#phonenumber", time = 60, count = 1)
|
||||||
@GetMapping("/resource/sms/code")
|
@GetMapping("/resource/sms/code")
|
||||||
public R<Void> smsCode(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber) {
|
public R<Void> smsCode(@NotBlank(message = "{user.phonenumber.not.blank}") String phonenumber,String type) {
|
||||||
String key = GlobalConstants.CAPTCHA_CODE_KEY + phonenumber;
|
String key = GlobalConstants.CAPTCHA_CODE_KEY + phonenumber;
|
||||||
String code = RandomUtil.randomNumbers(4);
|
String code = RandomUtil.randomNumbers(4);
|
||||||
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
RedisUtils.setCacheObject(key, code, Duration.ofMinutes(Constants.CAPTCHA_EXPIRATION));
|
||||||
// 验证码模板id 自行处理 (查数据库或写死均可)
|
// 验证码模板id 自行处理 (查数据库或写死均可)
|
||||||
String templateId = "";
|
|
||||||
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
|
LinkedHashMap<String, String> map = new LinkedHashMap<>(1);
|
||||||
map.put("code", code);
|
map.put("1", code);
|
||||||
SmsBlend smsBlend = SmsFactory.getSmsBlend("config1");
|
map.put("2", Constants.CAPTCHA_EXPIRATION.toString());
|
||||||
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, templateId, map);
|
String configName;
|
||||||
|
if("login".equals(type)){
|
||||||
|
configName = "config2";
|
||||||
|
}else{
|
||||||
|
configName = "config3";
|
||||||
|
}
|
||||||
|
SmsBlend smsBlend = SmsFactory.getSmsBlend(configName);
|
||||||
|
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, map);
|
||||||
if (!smsResponse.isSuccess()) {
|
if (!smsResponse.isSuccess()) {
|
||||||
log.error("验证码短信发送异常 => {}", smsResponse);
|
log.error("验证码短信发送异常 => {}", smsResponse);
|
||||||
return R.fail(smsResponse.getData().toString());
|
return R.fail(smsResponse.getData().toString());
|
||||||
|
@ -55,7 +55,8 @@ public class UserActionListener implements SaTokenListener {
|
|||||||
String username = (String) loginModel.getExtra(LoginHelper.USER_NAME_KEY);
|
String username = (String) loginModel.getExtra(LoginHelper.USER_NAME_KEY);
|
||||||
String tenantId = (String) loginModel.getExtra(LoginHelper.TENANT_KEY);
|
String tenantId = (String) loginModel.getExtra(LoginHelper.TENANT_KEY);
|
||||||
dto.setUserName(username);
|
dto.setUserName(username);
|
||||||
dto.setClientKey((String) loginModel.getExtra(LoginHelper.CLIENT_KEY));
|
String clientId = (String) loginModel.getExtra(LoginHelper.CLIENT_KEY);
|
||||||
|
dto.setClientKey(clientId);
|
||||||
dto.setDeviceType(loginModel.getDevice());
|
dto.setDeviceType(loginModel.getDevice());
|
||||||
dto.setDeptName((String) loginModel.getExtra(LoginHelper.DEPT_NAME_KEY));
|
dto.setDeptName((String) loginModel.getExtra(LoginHelper.DEPT_NAME_KEY));
|
||||||
TenantHelper.dynamic(tenantId, () -> {
|
TenantHelper.dynamic(tenantId, () -> {
|
||||||
@ -75,7 +76,7 @@ public class UserActionListener implements SaTokenListener {
|
|||||||
SpringUtils.context().publishEvent(logininforEvent);
|
SpringUtils.context().publishEvent(logininforEvent);
|
||||||
// 更新登录信息
|
// 更新登录信息
|
||||||
loginService.recordLoginInfo((Long) loginModel.getExtra(LoginHelper.USER_KEY), ip);
|
loginService.recordLoginInfo((Long) loginModel.getExtra(LoginHelper.USER_KEY), ip);
|
||||||
log.info("user doLogin, userId:{}, token:{}", loginId, tokenValue);
|
log.info("user doLogin, userId:{}, token:{}, clientid{}", loginId, tokenValue, clientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -154,6 +154,12 @@ public class SysLoginService {
|
|||||||
loginUser.setTenantId(user.getTenantId());
|
loginUser.setTenantId(user.getTenantId());
|
||||||
loginUser.setUserId(userId);
|
loginUser.setUserId(userId);
|
||||||
loginUser.setDeptId(user.getDeptId());
|
loginUser.setDeptId(user.getDeptId());
|
||||||
|
List<Long> projectIds = user.getProjectIds();
|
||||||
|
Long projectId = null;
|
||||||
|
if (CollUtil.isNotEmpty(projectIds)) {
|
||||||
|
projectId = projectIds.getFirst();
|
||||||
|
}
|
||||||
|
loginUser.setProjectId(projectId);
|
||||||
loginUser.setUsername(user.getUserName());
|
loginUser.setUsername(user.getUserName());
|
||||||
loginUser.setNickname(user.getNickName());
|
loginUser.setNickname(user.getNickName());
|
||||||
loginUser.setUserType(user.getUserType());
|
loginUser.setUserType(user.getUserType());
|
||||||
@ -188,7 +194,7 @@ public class SysLoginService {
|
|||||||
/**
|
/**
|
||||||
* 登录校验
|
* 登录校验
|
||||||
*/
|
*/
|
||||||
public void checkLogin(LoginType loginType, String tenantId, String username, Supplier<Boolean> supplier) {
|
public void checkLogin(LoginType loginType, String tenantId, String username, Supplier<Boolean> supplier) {
|
||||||
String errorKey = CacheConstants.PWD_ERR_CNT_KEY + username;
|
String errorKey = CacheConstants.PWD_ERR_CNT_KEY + username;
|
||||||
String loginFail = Constants.LOGIN_FAIL;
|
String loginFail = Constants.LOGIN_FAIL;
|
||||||
|
|
||||||
|
@ -77,6 +77,82 @@ public class SysRegisterService {
|
|||||||
recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success"));
|
recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册
|
||||||
|
*/
|
||||||
|
public void appRegister(RegisterBody registerBody) {
|
||||||
|
String tenantId = registerBody.getTenantId();
|
||||||
|
String username = registerBody.getPhonenumber();
|
||||||
|
String password = registerBody.getPassword();
|
||||||
|
// 校验用户类型是否存在
|
||||||
|
String userType = UserType.getUserType(registerBody.getUserType()).getUserType();
|
||||||
|
// 校验密码是否符合要求
|
||||||
|
String pattern = "^(?!.*\\s)(?!^[a-zA-Z]+$)(?!^[0-9]+$)(?!^[^a-zA-Z0-9]+$)(?!^[a-zA-Z0-9]+$).{8,18}$";
|
||||||
|
boolean isValid = password.matches(pattern);
|
||||||
|
if (!isValid) {
|
||||||
|
throw new UserException("注册失败,密码需满足8–18位,包含大小写字母、数字、特殊字符中的至少三种组合");
|
||||||
|
}
|
||||||
|
// 验证码开关
|
||||||
|
SysUserBo sysUser = new SysUserBo();
|
||||||
|
sysUser.setUserName(username);
|
||||||
|
sysUser.setNickName(username);
|
||||||
|
sysUser.setPhonenumber(username);
|
||||||
|
sysUser.setPassword(BCrypt.hashpw(password));
|
||||||
|
sysUser.setUserType(userType);
|
||||||
|
sysUser.setEmail(registerBody.getEmail());
|
||||||
|
|
||||||
|
boolean exist = TenantHelper.dynamic(tenantId, () -> {
|
||||||
|
return userMapper.exists(new LambdaQueryWrapper<SysUser>()
|
||||||
|
.eq(SysUser::getPhonenumber, sysUser.getPhonenumber()));
|
||||||
|
});
|
||||||
|
if (exist) {
|
||||||
|
throw new UserException("user.register.save.error", username);
|
||||||
|
}
|
||||||
|
boolean regFlag = userService.registerUser(sysUser, tenantId);
|
||||||
|
if (!regFlag) {
|
||||||
|
throw new UserException("user.register.error");
|
||||||
|
}
|
||||||
|
|
||||||
|
recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 短信注册
|
||||||
|
*/
|
||||||
|
public void appSmsRegister(RegisterBody registerBody) {
|
||||||
|
String tenantId = registerBody.getTenantId();
|
||||||
|
String username = registerBody.getPhonenumber();
|
||||||
|
String smsCode = registerBody.getSmsCode();
|
||||||
|
|
||||||
|
validateSmsCode(tenantId, username, smsCode);
|
||||||
|
|
||||||
|
// 校验用户类型是否存在
|
||||||
|
String userType = UserType.getUserType(registerBody.getUserType()).getUserType();
|
||||||
|
|
||||||
|
// 验证码开关
|
||||||
|
SysUserBo sysUser = new SysUserBo();
|
||||||
|
sysUser.setUserName(username);
|
||||||
|
sysUser.setNickName(username);
|
||||||
|
sysUser.setPhonenumber(username);
|
||||||
|
sysUser.setUserType(userType);
|
||||||
|
|
||||||
|
boolean exist = TenantHelper.dynamic(tenantId, () -> {
|
||||||
|
return userMapper.exists(new LambdaQueryWrapper<SysUser>()
|
||||||
|
.eq(SysUser::getPhonenumber, sysUser.getPhonenumber()));
|
||||||
|
});
|
||||||
|
if (exist) {
|
||||||
|
throw new UserException("user.register.save.error", username);
|
||||||
|
}
|
||||||
|
boolean regFlag = userService.registerUser(sysUser, tenantId);
|
||||||
|
if (!regFlag) {
|
||||||
|
throw new UserException("user.register.error");
|
||||||
|
}
|
||||||
|
|
||||||
|
recordLogininfor(tenantId, username, Constants.REGISTER, MessageUtils.message("user.register.success"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验验证码
|
* 校验验证码
|
||||||
*
|
*
|
||||||
@ -98,6 +174,18 @@ public class SysRegisterService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验短信验证码
|
||||||
|
*/
|
||||||
|
private boolean validateSmsCode(String tenantId, String phonenumber, String smsCode) {
|
||||||
|
String code = RedisUtils.getCacheObject(GlobalConstants.CAPTCHA_CODE_KEY + phonenumber);
|
||||||
|
if (StringUtils.isBlank(code)) {
|
||||||
|
recordLogininfor(tenantId, phonenumber, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire"));
|
||||||
|
throw new CaptchaExpireException();
|
||||||
|
}
|
||||||
|
return code.equals(smsCode);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录登录信息
|
* 记录登录信息
|
||||||
*
|
*
|
||||||
|
@ -3,6 +3,7 @@ package org.dromara.web.service.impl;
|
|||||||
import cn.dev33.satoken.secure.BCrypt;
|
import cn.dev33.satoken.secure.BCrypt;
|
||||||
import cn.dev33.satoken.stp.SaLoginModel;
|
import cn.dev33.satoken.stp.SaLoginModel;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -24,6 +25,8 @@ import org.dromara.common.redis.utils.RedisUtils;
|
|||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.common.tenant.helper.TenantHelper;
|
import org.dromara.common.tenant.helper.TenantHelper;
|
||||||
import org.dromara.common.web.config.properties.CaptchaProperties;
|
import org.dromara.common.web.config.properties.CaptchaProperties;
|
||||||
|
import org.dromara.project.domain.BusUserProjectRelevancy;
|
||||||
|
import org.dromara.project.service.IBusUserProjectRelevancyService;
|
||||||
import org.dromara.system.domain.SysUser;
|
import org.dromara.system.domain.SysUser;
|
||||||
import org.dromara.system.domain.vo.SysClientVo;
|
import org.dromara.system.domain.vo.SysClientVo;
|
||||||
import org.dromara.system.domain.vo.SysUserVo;
|
import org.dromara.system.domain.vo.SysUserVo;
|
||||||
@ -33,6 +36,8 @@ import org.dromara.web.service.IAuthStrategy;
|
|||||||
import org.dromara.web.service.SysLoginService;
|
import org.dromara.web.service.SysLoginService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码认证策略
|
* 密码认证策略
|
||||||
*
|
*
|
||||||
@ -46,6 +51,7 @@ public class PasswordAuthStrategy implements IAuthStrategy {
|
|||||||
private final CaptchaProperties captchaProperties;
|
private final CaptchaProperties captchaProperties;
|
||||||
private final SysLoginService loginService;
|
private final SysLoginService loginService;
|
||||||
private final SysUserMapper userMapper;
|
private final SysUserMapper userMapper;
|
||||||
|
private final IBusUserProjectRelevancyService userProjectRelevancyService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LoginVo login(String body, SysClientVo client) {
|
public LoginVo login(String body, SysClientVo client) {
|
||||||
@ -117,6 +123,14 @@ public class PasswordAuthStrategy implements IAuthStrategy {
|
|||||||
log.info("登录用户:{} 已被停用.", username);
|
log.info("登录用户:{} 已被停用.", username);
|
||||||
throw new UserException("user.blocked", username);
|
throw new UserException("user.blocked", username);
|
||||||
}
|
}
|
||||||
|
if (!SystemConstants.SUPER_ADMIN_ID.equals(user.getUserId())) {
|
||||||
|
List<BusUserProjectRelevancy> list = userProjectRelevancyService.lambdaQuery()
|
||||||
|
.eq(BusUserProjectRelevancy::getUserId, user.getUserId())
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
user.setProjectIds(list.stream().map(BusUserProjectRelevancy::getProjectId).toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,13 +13,13 @@ spring.boot.admin.client:
|
|||||||
|
|
||||||
--- # snail-job 配置
|
--- # snail-job 配置
|
||||||
snail-job:
|
snail-job:
|
||||||
enabled: false
|
enabled: true
|
||||||
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
|
# 需要在 SnailJob 后台组管理创建对应名称的组,然后创建任务的时候选择对应的组,才能正确分派任务
|
||||||
group: "ruoyi_group"
|
group: "ruoyi_group"
|
||||||
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
|
# SnailJob 接入验证令牌 详见 script/sql/ry_job.sql `sj_group_config` 表
|
||||||
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
|
token: "SJ_cKqBTPzCsWA3VyuCfFoccmuIEGXjr5KT"
|
||||||
server:
|
server:
|
||||||
host: 192.168.110.119
|
host: 127.0.0.1
|
||||||
port: 17888
|
port: 17888
|
||||||
# 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
|
# 命名空间UUID 详见 script/sql/ry_job.sql `sj_namespace`表`unique_id`字段
|
||||||
namespace: ${spring.profiles.active}
|
namespace: ${spring.profiles.active}
|
||||||
@ -53,13 +53,13 @@ spring:
|
|||||||
username: xinnengyuandev
|
username: xinnengyuandev
|
||||||
password: StRWCZdZirysNSs2
|
password: StRWCZdZirysNSs2
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
# slave:
|
slave:
|
||||||
# lazy: true
|
lazy: true
|
||||||
# type: ${spring.datasource.type}
|
type: ${spring.datasource.type}
|
||||||
# driverClassName: com.mysql.cj.jdbc.Driver
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
# url: jdbc:mysql://192.168.110.2:13386/zmkgdev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.110.2:13386/zmkgdev?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
# username: zmkgdev
|
username: zmkgdev
|
||||||
# password: JhYxREf25AXdy3h8
|
password: JhYxREf25AXdy3h8
|
||||||
# oracle:
|
# oracle:
|
||||||
# type: ${spring.datasource.type}
|
# type: ${spring.datasource.type}
|
||||||
# driverClassName: oracle.jdbc.OracleDriver
|
# driverClassName: oracle.jdbc.OracleDriver
|
||||||
@ -180,12 +180,21 @@ sms:
|
|||||||
signature: 您的短信签名
|
signature: 您的短信签名
|
||||||
sdk-app-id: 您的sdkAppId
|
sdk-app-id: 您的sdkAppId
|
||||||
config2:
|
config2:
|
||||||
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
# 登录
|
||||||
supplier: tencent
|
supplier: tencent
|
||||||
access-key-id: 您的accessKey
|
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||||
access-key-secret: 您的accessKeySecret
|
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||||
signature: 您的短信签名
|
signature: 重庆远界大数据研究院
|
||||||
sdk-app-id: 您的sdkAppId
|
sdk-app-id: 1401018866
|
||||||
|
template-id: 2491779
|
||||||
|
config3:
|
||||||
|
# 注册
|
||||||
|
supplier: tencent
|
||||||
|
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||||
|
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||||
|
signature: 重庆远界大数据研究院
|
||||||
|
sdk-app-id: 1401018866
|
||||||
|
template-id: 2491776
|
||||||
|
|
||||||
|
|
||||||
--- # 三方授权
|
--- # 三方授权
|
||||||
@ -287,7 +296,7 @@ sparta:
|
|||||||
id-card:
|
id-card:
|
||||||
encrypt-key: 7ae260d150a14027d2238a1cf80a48ef
|
encrypt-key: 7ae260d150a14027d2238a1cf80a48ef
|
||||||
recognizer:
|
recognizer:
|
||||||
url: http://192.168.110.5:50070
|
url: http://192.168.110.5:50071
|
||||||
|
|
||||||
qrCode:
|
qrCode:
|
||||||
url: http://192.168.110.151:7788
|
url: http://192.168.110.151:7788
|
||||||
|
@ -55,6 +55,14 @@ spring:
|
|||||||
url: jdbc:mysql://192.168.110.2:13386/xinnengyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
url: jdbc:mysql://192.168.110.2:13386/xinnengyuan?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
username: xinnengyuan
|
username: xinnengyuan
|
||||||
password: mEZPC5Sdf3r2HENi
|
password: mEZPC5Sdf3r2HENi
|
||||||
|
# 从库数据源
|
||||||
|
slave:
|
||||||
|
lazy: true
|
||||||
|
type: ${spring.datasource.type}
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://192.168.110.2:13386/zmkgc?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||||
|
username: zmkgc
|
||||||
|
password: nWKDKRNRT48tFBdh
|
||||||
# # 从库数据源
|
# # 从库数据源
|
||||||
# slave:
|
# slave:
|
||||||
# lazy: true
|
# lazy: true
|
||||||
@ -183,12 +191,21 @@ sms:
|
|||||||
signature: 您的短信签名
|
signature: 您的短信签名
|
||||||
sdk-app-id: 您的sdkAppId
|
sdk-app-id: 您的sdkAppId
|
||||||
config2:
|
config2:
|
||||||
# 厂商标识,标定此配置是哪个厂商,详细请看厂商标识介绍部分
|
# 登录
|
||||||
supplier: tencent
|
supplier: tencent
|
||||||
access-key-id: 您的accessKey
|
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||||
access-key-secret: 您的accessKeySecret
|
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||||
signature: 您的短信签名
|
signature: 重庆远界大数据研究院
|
||||||
sdk-app-id: 您的sdkAppId
|
sdk-app-id: 1401018866
|
||||||
|
template-id: 2491779
|
||||||
|
config3:
|
||||||
|
# 注册
|
||||||
|
supplier: tencent
|
||||||
|
access-key-id: AKIDb3JK5dx4wa0DCxWqvxlKejvysZ3ITVJv
|
||||||
|
access-key-secret: c5LPFsJI8k7GDxTkoeFj4A1ukQr66rPi
|
||||||
|
signature: 重庆远界大数据研究院
|
||||||
|
sdk-app-id: 1401018866
|
||||||
|
template-id: 2491776
|
||||||
|
|
||||||
--- # 三方授权
|
--- # 三方授权
|
||||||
justauth:
|
justauth:
|
||||||
@ -286,7 +303,7 @@ sparta:
|
|||||||
id-card:
|
id-card:
|
||||||
encrypt-key: 7ae260d150a14027d2238a1cf80a48ef
|
encrypt-key: 7ae260d150a14027d2238a1cf80a48ef
|
||||||
recognizer:
|
recognizer:
|
||||||
url: http://192.168.110.5:50070
|
url: http://192.168.110.5:50071
|
||||||
|
|
||||||
qrCode:
|
qrCode:
|
||||||
url: http://xny.yj-3d.com:7788
|
url: http://xny.yj-3d.com:7788
|
||||||
|
@ -125,6 +125,8 @@ security:
|
|||||||
# todo 仅测试
|
# todo 仅测试
|
||||||
- /facility/matrix/**
|
- /facility/matrix/**
|
||||||
- /**/changxie/callback/**
|
- /**/changxie/callback/**
|
||||||
|
- /gps/equipment/dataAcceptance
|
||||||
|
- /resource/oss/upload
|
||||||
|
|
||||||
# 多租户配置
|
# 多租户配置
|
||||||
tenant:
|
tenant:
|
||||||
@ -194,6 +196,7 @@ api-decrypt:
|
|||||||
- /actuator/** # 放行监控接口
|
- /actuator/** # 放行监控接口
|
||||||
- /other/ys7Device/webhook # 放行萤石云设备回调接口
|
- /other/ys7Device/webhook # 放行萤石云设备回调接口
|
||||||
- /auth/register # 放行注册接口
|
- /auth/register # 放行注册接口
|
||||||
|
- /gps/equipment/dataAcceptance # GPS数据接收接口
|
||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
api-docs:
|
api-docs:
|
||||||
@ -247,8 +250,8 @@ springdoc:
|
|||||||
packages-to-scan: org.dromara.design
|
packages-to-scan: org.dromara.design
|
||||||
- group: 13.工作流模块
|
- group: 13.工作流模块
|
||||||
packages-to-scan: org.dromara.workflow
|
packages-to-scan: org.dromara.workflow
|
||||||
- group: 14.罗成模块
|
# - group: 14.罗成模块
|
||||||
packages-to-scan: org.dromara.cory
|
# packages-to-scan: org.dromara.cory
|
||||||
- group: 15.无人机模块
|
- group: 15.无人机模块
|
||||||
packages-to-scan: org.dromara.drone
|
packages-to-scan: org.dromara.drone
|
||||||
- group: 20.代码生成模块
|
- group: 20.代码生成模块
|
||||||
@ -261,10 +264,23 @@ springdoc:
|
|||||||
packages-to-scan: org.dromara.out
|
packages-to-scan: org.dromara.out
|
||||||
- group: 19.消息模块
|
- group: 19.消息模块
|
||||||
packages-to-scan: org.dromara.message
|
packages-to-scan: org.dromara.message
|
||||||
- group: 20.合同模块
|
# - group: 20.手续模块
|
||||||
packages-to-scan: org.dromara.ctr
|
# packages-to-scan: org.dromara.formalities
|
||||||
- group: 21.招标模块
|
- group: 21.分标策划模块
|
||||||
packages-to-scan: org.dromara.tender
|
packages-to-scan: org.dromara.tender
|
||||||
|
- group: 22.大屏模块
|
||||||
|
packages-to-scan: org.dromara.bigscreen
|
||||||
|
- group: 22.投标管理模块
|
||||||
|
packages-to-scan: org.dromara.bidding
|
||||||
|
- group: 23.GPS定位模块
|
||||||
|
packages-to-scan: org.dromara.gps
|
||||||
|
|
||||||
|
# - group: 20.合同模块
|
||||||
|
# packages-to-scan: org.dromara.ctr
|
||||||
|
- group: 24.招标模块
|
||||||
|
packages-to-scan: org.dromara.tender
|
||||||
|
|
||||||
|
|
||||||
# knife4j的增强配置,不需要增强可以不配
|
# knife4j的增强配置,不需要增强可以不配
|
||||||
knife4j:
|
knife4j:
|
||||||
enable: true
|
enable: true
|
||||||
@ -313,11 +329,17 @@ management:
|
|||||||
sse:
|
sse:
|
||||||
enabled: true
|
enabled: true
|
||||||
path: /resource/sse
|
path: /resource/sse
|
||||||
|
wait: /task/taskWaiting
|
||||||
|
copy: /task/taskCopyList
|
||||||
|
project: /personnel-management/project
|
||||||
|
violationRecord: /safety-management/ai/violationRecord
|
||||||
|
drawing: /design-management/volumeCatalog
|
||||||
|
|
||||||
|
|
||||||
--- # websocket
|
--- # websocket
|
||||||
websocket:
|
websocket:
|
||||||
# 如果关闭 需要和前端开关一起关闭
|
# 如果关闭 需要和前端开关一起关闭
|
||||||
enabled: false
|
enabled: true
|
||||||
# 路径
|
# 路径
|
||||||
path: /resource/websocket
|
path: /resource/websocket
|
||||||
# 设置访问源地址
|
# 设置访问源地址
|
||||||
|
Binary file not shown.
@ -1,18 +1,28 @@
|
|||||||
package org.dromara.test;
|
package org.dromara.test;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.io.FileUtil;
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.contractor.domain.SubConstructionUser;
|
||||||
|
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||||
|
import org.dromara.contractor.service.ISubUserSalaryDetailService;
|
||||||
import org.dromara.design.service.IDesTechnicalStandardService;
|
import org.dromara.design.service.IDesTechnicalStandardService;
|
||||||
import org.dromara.facility.domain.FacMatrix;
|
import org.dromara.facility.domain.FacMatrix;
|
||||||
import org.dromara.facility.service.IFacMatrixService;
|
import org.dromara.facility.service.IFacMatrixService;
|
||||||
import org.dromara.facility.service.IFacPhotovoltaicPanelPartsService;
|
import org.dromara.facility.service.IFacPhotovoltaicPanelPartsService;
|
||||||
import org.dromara.progress.service.IPgsProgressCategoryService;
|
import org.dromara.progress.service.IPgsProgressCategoryService;
|
||||||
|
import org.dromara.progress.service.IPgsProgressCategoryTemplateService;
|
||||||
import org.dromara.project.service.IBusProjectService;
|
import org.dromara.project.service.IBusProjectService;
|
||||||
import org.dromara.system.service.ISysDeptService;
|
import org.dromara.system.service.ISysDeptService;
|
||||||
|
import org.dromara.tender.service.impl.TenderSupplierInputServiceImpl;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -30,6 +40,9 @@ public class DemoTest {
|
|||||||
@Resource
|
@Resource
|
||||||
private IPgsProgressCategoryService progressCategoryService;
|
private IPgsProgressCategoryService progressCategoryService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPgsProgressCategoryTemplateService progressCategoryTemplateService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IFacMatrixService matrixService;
|
private IFacMatrixService matrixService;
|
||||||
|
|
||||||
@ -41,6 +54,14 @@ public class DemoTest {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ISysDeptService deptService;
|
private ISysDeptService deptService;
|
||||||
|
@Autowired
|
||||||
|
private TenderSupplierInputServiceImpl tenderSupplierInputService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISubConstructionUserService constructionUserService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISubUserSalaryDetailService userSalaryDetailService;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void test() {
|
void test() {
|
||||||
@ -85,8 +106,38 @@ public class DemoTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
void testProject() {
|
||||||
|
// 初始化施工类型模版
|
||||||
|
Boolean init = progressCategoryTemplateService.initTemplateByProject(1958935730389606402L);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* @Test
|
||||||
void testDeptProject() {
|
void testDeptProject() {
|
||||||
deptService.selectProjectIdById(100L);
|
deptService.selectProjectIdById(100L);
|
||||||
deptService.selectProjectIdById(1937478258803171329L);
|
deptService.selectProjectIdById(1937478258803171329L);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void tenderExport() {
|
||||||
|
// 同步修改用户表的team_id字段并添加入场时间
|
||||||
|
LambdaUpdateWrapper<SubConstructionUser> constructionUserLuw = Wrappers.lambdaUpdate(SubConstructionUser.class)
|
||||||
|
.in(SubConstructionUser::getId, 1961446214960435201L, 1963077776210710529L, 1963080543771832321L, 1963151975159324673L)
|
||||||
|
.set(SubConstructionUser::getEntryDate, new Date());
|
||||||
|
constructionUserService.update(constructionUserLuw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testSalary() {
|
||||||
|
List<SubConstructionUser> list = constructionUserService.lambdaQuery()
|
||||||
|
.eq(SubConstructionUser::getProjectId, 1897160897167638529L)
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isNotEmpty(list)) {
|
||||||
|
for (SubConstructionUser user : list) {
|
||||||
|
for (int i = 1; i < 7; i++) {
|
||||||
|
userSalaryDetailService.insertByAttendance(user.getSysUserId(), LocalDate.now().minusDays(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,98 +0,0 @@
|
|||||||
package org.dromara.test;
|
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.dromara.formalities.domain.bo.AddBusFormalitiesAreConsolidatedBo;
|
|
||||||
import org.dromara.formalities.domain.bo.BusFormalitiesAreConsolidatedBo;
|
|
||||||
import org.dromara.formalities.domain.bo.BusListOfFormalitiesBo;
|
|
||||||
import org.dromara.formalities.domain.vo.BusListOfFormalitiesVo;
|
|
||||||
import org.dromara.formalities.service.IBusFormalitiesAreConsolidatedService;
|
|
||||||
import org.dromara.formalities.service.IBusListOfFormalitiesService;
|
|
||||||
import org.dromara.manager.ys7manager.Ys7Manager;
|
|
||||||
import org.dromara.manager.ys7manager.Ys7RequestUtils;
|
|
||||||
import org.dromara.manager.ys7manager.vo.Ys7QueryDeviceResponseVo;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lilemy
|
|
||||||
* @date 2025/6/12 17:06
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@SpringBootTest
|
|
||||||
public class Ys7Test {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private Ys7Manager ys7Manager;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void test() {
|
|
||||||
String token = ys7Manager.getToken();
|
|
||||||
List<Ys7QueryDeviceResponseVo> ys7QueryDeviceResponseVos = Ys7RequestUtils.queryDeviceVoList(token, 1, 20);
|
|
||||||
System.out.println(ys7QueryDeviceResponseVos);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void testCaptureDevicePic() {
|
|
||||||
String pic = ys7Manager.getCaptureDevicePic("AE9470016", 1, 1);
|
|
||||||
System.out.println(pic);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IBusListOfFormalitiesService busListOfFormalitiesService;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test111(){
|
|
||||||
BusListOfFormalitiesBo busListOfFormalitiesBo = new BusListOfFormalitiesBo();
|
|
||||||
// busListOfFormalitiesBo.setName("test1");
|
|
||||||
// busListOfFormalitiesBo.setPid(1955976169241026561L);
|
|
||||||
// busListOfFormalitiesService.insertByBo(busListOfFormalitiesBo);
|
|
||||||
// List<BusListOfFormalitiesVo> tree = busListOfFormalitiesService.getTree(busListOfFormalitiesBo);
|
|
||||||
// System.out.println(tree);
|
|
||||||
Boolean b = busListOfFormalitiesService.deleteWithValidByIds(1955976169241026561L, true);
|
|
||||||
System.out.println(b);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IBusFormalitiesAreConsolidatedService formalitiesAreConsolidatedService;
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void test222(){
|
|
||||||
BusFormalitiesAreConsolidatedBo busFormalitiesAreConsolidatedBo = new BusFormalitiesAreConsolidatedBo();
|
|
||||||
// List<AddBusFormalitiesAreConsolidatedBo> addBusFormalitiesAreConsolidatedBos = new ArrayList<>();
|
|
||||||
// AddBusFormalitiesAreConsolidatedBo bo1 = new AddBusFormalitiesAreConsolidatedBo();
|
|
||||||
// bo1.setFormalitiesId(1955977461032103939L);
|
|
||||||
// AddBusFormalitiesAreConsolidatedBo bo2 = new AddBusFormalitiesAreConsolidatedBo();
|
|
||||||
// bo2.setFormalitiesId(1955977461032103940L);
|
|
||||||
// bo2.setFormalitiesPid(1955977461032103939L);
|
|
||||||
// AddBusFormalitiesAreConsolidatedBo bo3 = new AddBusFormalitiesAreConsolidatedBo();
|
|
||||||
// bo3.setFormalitiesId(1955977461032103941L);
|
|
||||||
// bo3.setFormalitiesPid(1955977461032103939L);
|
|
||||||
// AddBusFormalitiesAreConsolidatedBo bo4 = new AddBusFormalitiesAreConsolidatedBo();
|
|
||||||
// bo4.setFormalitiesId(1955977461032103942L);
|
|
||||||
// bo4.setFormalitiesPid(1955977461032103939L);
|
|
||||||
// addBusFormalitiesAreConsolidatedBos.add(bo1);
|
|
||||||
// addBusFormalitiesAreConsolidatedBos.add(bo2);
|
|
||||||
// addBusFormalitiesAreConsolidatedBos.add(bo3);
|
|
||||||
// addBusFormalitiesAreConsolidatedBos.add(bo4);
|
|
||||||
// busFormalitiesAreConsolidatedBo.setAddBusFormalitiesAreConsolidatedBos(addBusFormalitiesAreConsolidatedBos);
|
|
||||||
// busFormalitiesAreConsolidatedBo.setProjectId(1555L);
|
|
||||||
// Boolean b = formalitiesAreConsolidatedService.insertByBo(busFormalitiesAreConsolidatedBo);
|
|
||||||
// System.out.println(b);
|
|
||||||
// busFormalitiesAreConsolidatedBo.setId(1956013379818409985L);
|
|
||||||
// busFormalitiesAreConsolidatedBo.setHead("舟山");
|
|
||||||
// busFormalitiesAreConsolidatedBo.setPlanTheStartTime(new Date());
|
|
||||||
// busFormalitiesAreConsolidatedBo.setRemark("asdasd");
|
|
||||||
// busFormalitiesAreConsolidatedBo.setStatus(0);
|
|
||||||
// MultipartFile[] files = {};
|
|
||||||
// Boolean b = formalitiesAreConsolidatedService.updateByBo(busFormalitiesAreConsolidatedBo, files);
|
|
||||||
// System.out.println(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -80,4 +80,9 @@ public interface CacheNames {
|
|||||||
*/
|
*/
|
||||||
String ONLINE_TOKEN = "online_tokens";
|
String ONLINE_TOKEN = "online_tokens";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
String PROJECT_NAME = "project_name#30d";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ public interface Constants {
|
|||||||
/**
|
/**
|
||||||
* 验证码有效期(分钟)
|
* 验证码有效期(分钟)
|
||||||
*/
|
*/
|
||||||
Integer CAPTCHA_EXPIRATION = 2;
|
Integer CAPTCHA_EXPIRATION = 5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 顶级父级id
|
* 顶级父级id
|
||||||
|
@ -4,11 +4,12 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.dromara.common.core.domain.dto.PostDTO;
|
import org.dromara.common.core.domain.dto.PostDTO;
|
||||||
import org.dromara.common.core.domain.dto.RoleDTO;
|
import org.dromara.common.core.domain.dto.RoleDTO;
|
||||||
|
import org.dromara.common.core.domain.vo.SysProjectRoleMenuVo;
|
||||||
|
import org.dromara.common.core.domain.vo.SysProjectRolePermissionVo;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录用户身份权限
|
* 登录用户身份权限
|
||||||
@ -37,6 +38,11 @@ public class LoginUser implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目ID
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门类别编码
|
* 部门类别编码
|
||||||
*/
|
*/
|
||||||
@ -90,12 +96,12 @@ public class LoginUser implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 菜单权限
|
* 菜单权限
|
||||||
*/
|
*/
|
||||||
private Set<String> menuPermission;
|
private List<SysProjectRoleMenuVo> menuPermission;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色权限
|
* 角色权限
|
||||||
*/
|
*/
|
||||||
private Set<String> rolePermission;
|
private List<SysProjectRolePermissionVo> rolePermission;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* 用户名
|
||||||
|
@ -30,4 +30,13 @@ public class RegisterBody extends LoginBody {
|
|||||||
|
|
||||||
private String userType;
|
private String userType;
|
||||||
|
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
private String phonenumber;
|
||||||
|
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
private String smsCode;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package org.dromara.common.core.domain.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-08-27 18:14
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysProjectRoleMenuVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目菜单权限
|
||||||
|
*/
|
||||||
|
private Set<String> projectPermissions;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package org.dromara.common.core.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-08-27 17:53
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class SysProjectRolePermissionVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -6552769878716622338L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目菜单权限
|
||||||
|
*/
|
||||||
|
private Set<String> projectRoles;
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package org.dromara.common.core.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-10 16:15
|
||||||
|
*/
|
||||||
|
public interface ProjectService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过项目ID查询项目名称
|
||||||
|
*
|
||||||
|
* @param projectId 项目ID
|
||||||
|
* @return 项目名称
|
||||||
|
*/
|
||||||
|
String selectProjectNameById(Long projectId);
|
||||||
|
|
||||||
|
}
|
@ -74,7 +74,7 @@ public interface UserService {
|
|||||||
* @param roleIds 角色ids
|
* @param roleIds 角色ids
|
||||||
* @return 用户
|
* @return 用户
|
||||||
*/
|
*/
|
||||||
List<UserDTO> selectUsersByRoleIds(List<Long> roleIds);
|
List<UserDTO> selectUsersByRoleIds(List<Long> roleIds,Long projectId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过部门ID查询用户
|
* 通过部门ID查询用户
|
||||||
|
@ -376,4 +376,19 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验日期范围
|
||||||
|
*
|
||||||
|
* @param startDate 开始日期
|
||||||
|
* @param endDate 结束日期
|
||||||
|
* @return true 表示日期范围有效,false 表示日期范围无效
|
||||||
|
*/
|
||||||
|
public static boolean isValidDateRange(LocalDate startDate, LocalDate endDate) {
|
||||||
|
try {
|
||||||
|
return !startDate.isAfter(endDate); // start <= end
|
||||||
|
} catch (DateTimeParseException e) {
|
||||||
|
return false; // 格式非法
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,14 @@ import org.dromara.common.core.utils.file.FileUtils;
|
|||||||
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
import org.dromara.common.excel.convert.ExcelBigNumberConvert;
|
||||||
import org.dromara.common.excel.core.*;
|
import org.dromara.common.excel.core.*;
|
||||||
import org.dromara.common.excel.handler.DataWriteHandler;
|
import org.dromara.common.excel.handler.DataWriteHandler;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -203,6 +205,60 @@ public class ExcelUtil {
|
|||||||
builder.doWrite(list);
|
builder.doWrite(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出多sheet excel(增强版,解决XML安全问题)
|
||||||
|
*
|
||||||
|
* @param sheetData 多个sheet的数据
|
||||||
|
* @param sheetNames 多个sheet的名称
|
||||||
|
* @param clazz 实体类
|
||||||
|
* @param optionsList 级联下拉选内容列表
|
||||||
|
*/
|
||||||
|
public static <T> void exportMultiSheetExcelEnhanced(List<List<T>> sheetData, List<String> sheetNames, Class<T> clazz, List<List<DropDownOptions>> optionsList,HttpServletResponse response) throws IOException {
|
||||||
|
resetResponse("file", response);
|
||||||
|
ExcelWriter excelWriter = null;
|
||||||
|
ServletOutputStream os = response.getOutputStream();
|
||||||
|
|
||||||
|
try {
|
||||||
|
// 使用SXSSFWorkbook避免内存问题,并减少XML处理复杂度
|
||||||
|
excelWriter = EasyExcel.write(os)
|
||||||
|
.head(clazz)
|
||||||
|
.autoCloseStream(false)
|
||||||
|
.registerConverter(new ExcelBigNumberConvert())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
// 为每个sheet写入数据
|
||||||
|
for (int i = 0; i < sheetData.size(); i++) {
|
||||||
|
// 创建基本sheet配置
|
||||||
|
WriteSheet writeSheet = EasyExcel.writerSheet(i, sheetNames.get(i))
|
||||||
|
.head(clazz)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// 添加下拉选项(如果存在)
|
||||||
|
if (optionsList != null && optionsList.size() > i && optionsList.get(i) != null) {
|
||||||
|
ExcelDownHandler handler = new ExcelDownHandler(optionsList.get(i));
|
||||||
|
writeSheet.setCustomWriteHandlerList(
|
||||||
|
Collections.singletonList(handler));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 写入数据
|
||||||
|
excelWriter.write(sheetData.get(i), writeSheet);
|
||||||
|
}
|
||||||
|
|
||||||
|
} finally {
|
||||||
|
// 确保资源正确释放
|
||||||
|
if (excelWriter != null) {
|
||||||
|
try {
|
||||||
|
excelWriter.finish();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 记录日志但不中断主流程
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 单表多数据模板导出 模板格式为 {.属性}
|
* 单表多数据模板导出 模板格式为 {.属性}
|
||||||
*
|
*
|
||||||
@ -436,4 +492,7 @@ public class ExcelUtil {
|
|||||||
return IdUtil.fastSimpleUUID() + "_" + filename + ".xlsx";
|
return IdUtil.fastSimpleUUID() + "_" + filename + ".xlsx";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ public class MybatisPlusConfig {
|
|||||||
public PaginationInnerInterceptor paginationInnerInterceptor() {
|
public PaginationInnerInterceptor paginationInnerInterceptor() {
|
||||||
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
|
||||||
// 分页合理化
|
// 分页合理化
|
||||||
paginationInnerInterceptor.setOverflow(true);
|
paginationInnerInterceptor.setOverflow(false);
|
||||||
return paginationInnerInterceptor;
|
return paginationInnerInterceptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,18 @@
|
|||||||
package org.dromara.common.satoken.core.service;
|
package org.dromara.common.satoken.core.service;
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpInterface;
|
import cn.dev33.satoken.stp.StpInterface;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import org.dromara.common.core.domain.model.LoginUser;
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
|
import org.dromara.common.core.domain.vo.SysProjectRoleMenuVo;
|
||||||
|
import org.dromara.common.core.domain.vo.SysProjectRolePermissionVo;
|
||||||
import org.dromara.common.core.enums.UserType;
|
import org.dromara.common.core.enums.UserType;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sa-token 权限管理实现类
|
* sa-token 权限管理实现类
|
||||||
@ -21,15 +26,36 @@ public class SaPermissionImpl implements StpInterface {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getPermissionList(Object loginId, String loginType) {
|
public List<String> getPermissionList(Object loginId, String loginType) {
|
||||||
// LoginUser loginUser = LoginHelper.getLoginUser();
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
// UserType userType = UserType.getUserType(loginUser.getUserType());
|
UserType userType = UserType.getUserType(loginUser.getUserType());
|
||||||
// if (userType == UserType.SYS_USER) {
|
if (userType == UserType.SYS_USER) {
|
||||||
// return new ArrayList<>(loginUser.getMenuPermission());
|
Long projectId = loginUser.getProjectId();
|
||||||
// } else if (userType == UserType.APP_USER) {
|
List<SysProjectRoleMenuVo> menuPermission = loginUser.getMenuPermission();
|
||||||
// // 其他端 自行根据业务编写
|
if (CollUtil.isNotEmpty(menuPermission)) {
|
||||||
// }
|
if (projectId != null) {
|
||||||
// return new ArrayList<>();
|
Map<Long, List<SysProjectRoleMenuVo>> map = menuPermission.stream()
|
||||||
return Collections.singletonList("*");
|
.collect(Collectors.groupingBy(SysProjectRoleMenuVo::getProjectId));
|
||||||
|
if (map.containsKey(projectId)) {
|
||||||
|
return map.get(projectId).stream()
|
||||||
|
.map(SysProjectRoleMenuVo::getProjectPermissions)
|
||||||
|
.flatMap(Set::stream)
|
||||||
|
.filter(s -> !s.isEmpty())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
List<Set<String>> list = menuPermission.stream().map(SysProjectRoleMenuVo::getProjectPermissions).toList();
|
||||||
|
return list.stream().flatMap(Set::stream).filter(s -> !s.isEmpty()).distinct().toList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (userType == UserType.APP_USER) {
|
||||||
|
// 其他端 自行根据业务编写
|
||||||
|
}
|
||||||
|
return new ArrayList<>();
|
||||||
|
// return Collections.singletonList("*");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,7 +66,27 @@ public class SaPermissionImpl implements StpInterface {
|
|||||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||||
UserType userType = UserType.getUserType(loginUser.getUserType());
|
UserType userType = UserType.getUserType(loginUser.getUserType());
|
||||||
if (userType == UserType.SYS_USER) {
|
if (userType == UserType.SYS_USER) {
|
||||||
return new ArrayList<>(loginUser.getRolePermission());
|
Long projectId = loginUser.getProjectId();
|
||||||
|
List<SysProjectRolePermissionVo> rolePermission = loginUser.getRolePermission();
|
||||||
|
if (CollUtil.isNotEmpty(rolePermission)) {
|
||||||
|
if (projectId != null) {
|
||||||
|
Map<Long, List<SysProjectRolePermissionVo>> map = rolePermission.stream()
|
||||||
|
.collect(Collectors.groupingBy(SysProjectRolePermissionVo::getProjectId));
|
||||||
|
if (map.containsKey(projectId)) {
|
||||||
|
return map.get(projectId).stream()
|
||||||
|
.map(SysProjectRolePermissionVo::getProjectRoles)
|
||||||
|
.flatMap(Set::stream)
|
||||||
|
.filter(s -> !s.isEmpty())
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
List<Set<String>> list = rolePermission.stream().map(SysProjectRolePermissionVo::getProjectRoles).toList();
|
||||||
|
return list.stream().flatMap(Set::stream).filter(s -> !s.isEmpty()).distinct().toList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
} else if (userType == UserType.APP_USER) {
|
} else if (userType == UserType.APP_USER) {
|
||||||
// 其他端 自行根据业务编写
|
// 其他端 自行根据业务编写
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ public class LoginHelper {
|
|||||||
public static final String DEPT_NAME_KEY = "deptName";
|
public static final String DEPT_NAME_KEY = "deptName";
|
||||||
public static final String DEPT_CATEGORY_KEY = "deptCategory";
|
public static final String DEPT_CATEGORY_KEY = "deptCategory";
|
||||||
public static final String CLIENT_KEY = "clientid";
|
public static final String CLIENT_KEY = "clientid";
|
||||||
|
public static final String PROJECT_KEY = "projectId";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录系统 基于 设备类型
|
* 登录系统 基于 设备类型
|
||||||
@ -131,6 +132,10 @@ public class LoginHelper {
|
|||||||
return Convert.toStr(getExtra(DEPT_CATEGORY_KEY));
|
return Convert.toStr(getExtra(DEPT_CATEGORY_KEY));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Long getProjectId() {
|
||||||
|
return Convert.toLong(getExtra(PROJECT_KEY));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前 Token 的扩展信息
|
* 获取当前 Token 的扩展信息
|
||||||
*
|
*
|
||||||
@ -191,7 +196,7 @@ public class LoginHelper {
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public static boolean isTenantAdmin() {
|
public static boolean isTenantAdmin() {
|
||||||
return Convert.toBool(isTenantAdmin(getLoginUser().getRolePermission()));
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,4 +18,17 @@ public class SseProperties {
|
|||||||
* 路径
|
* 路径
|
||||||
*/
|
*/
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
|
private String wait;
|
||||||
|
|
||||||
|
private String copy;
|
||||||
|
|
||||||
|
private String project;
|
||||||
|
|
||||||
|
private String violationRecord;
|
||||||
|
|
||||||
|
private String drawing;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ public class SseEmitterManager {
|
|||||||
broadcastMessage.setMessage(sseMessageDto.getMessage());
|
broadcastMessage.setMessage(sseMessageDto.getMessage());
|
||||||
broadcastMessage.setUserIds(sseMessageDto.getUserIds());
|
broadcastMessage.setUserIds(sseMessageDto.getUserIds());
|
||||||
broadcastMessage.setRoute(sseMessageDto.getRoute());
|
broadcastMessage.setRoute(sseMessageDto.getRoute());
|
||||||
broadcastMessage.setDetailId(sseMessageDto.getDetailId());
|
broadcastMessage.setProjectId(sseMessageDto.getProjectId());
|
||||||
RedisUtils.publish(SSE_TOPIC, broadcastMessage, consumer -> {
|
RedisUtils.publish(SSE_TOPIC, broadcastMessage, consumer -> {
|
||||||
log.info("SSE发送主题订阅消息topic:{} session keys:{} message:{}",
|
log.info("SSE发送主题订阅消息topic:{} session keys:{} message:{}",
|
||||||
SSE_TOPIC, sseMessageDto.getUserIds(), sseMessageDto.getMessage());
|
SSE_TOPIC, sseMessageDto.getUserIds(), sseMessageDto.getMessage());
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
package org.dromara.common.sse.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SeeMessageContentDto implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 需要发送的消息
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 路由
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
}
|
@ -33,8 +33,13 @@ public class SseMessageDto implements Serializable {
|
|||||||
private String route;
|
private String route;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情
|
* 项目id
|
||||||
*/
|
*/
|
||||||
private String detailId;
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否记录
|
||||||
|
*/
|
||||||
|
private Boolean isRecord = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,4 +32,9 @@ public interface TransConstant {
|
|||||||
*/
|
*/
|
||||||
String OSS_ID_TO_URL = "oss_id_to_url";
|
String OSS_ID_TO_URL = "oss_id_to_url";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id转名称
|
||||||
|
*/
|
||||||
|
String PROJECT_ID_TO_NAME = "project_id_to_name";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
package org.dromara.common.translation.core.impl;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.dromara.common.core.service.ProjectService;
|
||||||
|
import org.dromara.common.translation.annotation.TranslationType;
|
||||||
|
import org.dromara.common.translation.constant.TransConstant;
|
||||||
|
import org.dromara.common.translation.core.TranslationInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-10 16:13
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TranslationType(type = TransConstant.PROJECT_ID_TO_NAME)
|
||||||
|
public class ProjectNameTranslationImpl implements TranslationInterface<String> {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectService projectService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 翻译
|
||||||
|
*
|
||||||
|
* @param key 需要被翻译的键(不为空)
|
||||||
|
* @param other 其他参数
|
||||||
|
* @return 返回键对应的值
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String translation(Object key, String other) {
|
||||||
|
if (key instanceof Long id) {
|
||||||
|
return projectService.selectProjectNameById(id);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -4,3 +4,4 @@ org.dromara.common.translation.core.impl.DictTypeTranslationImpl
|
|||||||
org.dromara.common.translation.core.impl.OssUrlTranslationImpl
|
org.dromara.common.translation.core.impl.OssUrlTranslationImpl
|
||||||
org.dromara.common.translation.core.impl.UserNameTranslationImpl
|
org.dromara.common.translation.core.impl.UserNameTranslationImpl
|
||||||
org.dromara.common.translation.core.impl.NicknameTranslationImpl
|
org.dromara.common.translation.core.impl.NicknameTranslationImpl
|
||||||
|
org.dromara.common.translation.core.impl.ProjectNameTranslationImpl
|
||||||
|
@ -12,6 +12,8 @@ public interface WebSocketConstants {
|
|||||||
*/
|
*/
|
||||||
String LOGIN_USER_KEY = "loginUser";
|
String LOGIN_USER_KEY = "loginUser";
|
||||||
|
|
||||||
|
String PROJECT_ID = "projectId";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订阅的频道
|
* 订阅的频道
|
||||||
*/
|
*/
|
||||||
|
@ -13,6 +13,7 @@ import java.io.IOException;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.dromara.common.websocket.constant.WebSocketConstants.LOGIN_USER_KEY;
|
import static org.dromara.common.websocket.constant.WebSocketConstants.LOGIN_USER_KEY;
|
||||||
|
import static org.dromara.common.websocket.constant.WebSocketConstants.PROJECT_ID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WebSocketHandler 实现类
|
* WebSocketHandler 实现类
|
||||||
@ -27,14 +28,17 @@ public class PlusWebSocketHandler extends AbstractWebSocketHandler {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void afterConnectionEstablished(WebSocketSession session) throws IOException {
|
public void afterConnectionEstablished(WebSocketSession session) throws IOException {
|
||||||
LoginUser loginUser = (LoginUser) session.getAttributes().get(LOGIN_USER_KEY);
|
// LoginUser loginUser = (LoginUser) session.getAttributes().get(LOGIN_USER_KEY);
|
||||||
if (ObjectUtil.isNull(loginUser)) {
|
Long loginUser = (Long) session.getAttributes().get(PROJECT_ID);
|
||||||
|
// if (ObjectUtil.isNull(loginUser) ) {
|
||||||
|
if (loginUser == null ) {
|
||||||
session.close(CloseStatus.BAD_DATA);
|
session.close(CloseStatus.BAD_DATA);
|
||||||
log.info("[connect] invalid token received. sessionId: {}", session.getId());
|
log.info("[connect] invalid token received. sessionId: {}", session.getId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WebSocketSessionHolder.addSession(loginUser.getUserId(), session);
|
WebSocketSessionHolder.addSession(loginUser, session);
|
||||||
log.info("[connect] sessionId: {},userId:{},userType:{}", session.getId(), loginUser.getUserId(), loginUser.getUserType());
|
// WebSocketSessionHolder.addSession(loginUser.getUserId(), session);
|
||||||
|
// log.info("[connect] sessionId: {},userId:{},userType:{}", session.getId(), loginUser.getUserId(), loginUser.getUserType());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,11 +51,13 @@ public class PlusWebSocketHandler extends AbstractWebSocketHandler {
|
|||||||
@Override
|
@Override
|
||||||
protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
|
protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
|
||||||
// 从WebSocket会话中获取登录用户信息
|
// 从WebSocket会话中获取登录用户信息
|
||||||
LoginUser loginUser = (LoginUser) session.getAttributes().get(LOGIN_USER_KEY);
|
// LoginUser loginUser = (LoginUser) session.getAttributes().get(LOGIN_USER_KEY);
|
||||||
|
Long loginUser = (Long) session.getAttributes().get(PROJECT_ID);
|
||||||
|
|
||||||
// 创建WebSocket消息DTO对象
|
// 创建WebSocket消息DTO对象
|
||||||
WebSocketMessageDto webSocketMessageDto = new WebSocketMessageDto();
|
WebSocketMessageDto webSocketMessageDto = new WebSocketMessageDto();
|
||||||
webSocketMessageDto.setSessionKeys(List.of(loginUser.getUserId()));
|
// webSocketMessageDto.setSessionKeys(List.of(loginUser.getUserId()));
|
||||||
|
webSocketMessageDto.setSessionKeys(List.of(loginUser));
|
||||||
webSocketMessageDto.setMessage(message.getPayload());
|
webSocketMessageDto.setMessage(message.getPayload());
|
||||||
WebSocketUtils.publishMessage(webSocketMessageDto);
|
WebSocketUtils.publishMessage(webSocketMessageDto);
|
||||||
}
|
}
|
||||||
@ -100,13 +106,16 @@ public class PlusWebSocketHandler extends AbstractWebSocketHandler {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) {
|
public void afterConnectionClosed(WebSocketSession session, CloseStatus status) {
|
||||||
LoginUser loginUser = (LoginUser) session.getAttributes().get(LOGIN_USER_KEY);
|
// LoginUser loginUser = (LoginUser) session.getAttributes().get(LOGIN_USER_KEY);
|
||||||
if (ObjectUtil.isNull(loginUser)) {
|
Long loginUser = (Long) session.getAttributes().get(PROJECT_ID);
|
||||||
|
// if (ObjectUtil.isNull(loginUser)) {
|
||||||
|
if (loginUser != null ) {
|
||||||
log.info("[disconnect] invalid token received. sessionId: {}", session.getId());
|
log.info("[disconnect] invalid token received. sessionId: {}", session.getId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WebSocketSessionHolder.removeSession(loginUser.getUserId());
|
// WebSocketSessionHolder.removeSession(loginUser.getUserId());
|
||||||
log.info("[disconnect] sessionId: {},userId:{},userType:{}", session.getId(), loginUser.getUserId(), loginUser.getUserType());
|
WebSocketSessionHolder.removeSession(loginUser);
|
||||||
|
// log.info("[disconnect] sessionId: {},userId:{},userType:{}", session.getId(), loginUser.getUserId(), loginUser.getUserType());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,6 +15,7 @@ import org.springframework.web.socket.server.HandshakeInterceptor;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.dromara.common.websocket.constant.WebSocketConstants.LOGIN_USER_KEY;
|
import static org.dromara.common.websocket.constant.WebSocketConstants.LOGIN_USER_KEY;
|
||||||
|
import static org.dromara.common.websocket.constant.WebSocketConstants.PROJECT_ID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WebSocket握手请求的拦截器
|
* WebSocket握手请求的拦截器
|
||||||
@ -44,6 +45,8 @@ public class PlusWebSocketInterceptor implements HandshakeInterceptor {
|
|||||||
String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY);
|
String headerCid = ServletUtils.getRequest().getHeader(LoginHelper.CLIENT_KEY);
|
||||||
String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY);
|
String paramCid = ServletUtils.getParameter(LoginHelper.CLIENT_KEY);
|
||||||
String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString();
|
String clientId = StpUtil.getExtra(LoginHelper.CLIENT_KEY).toString();
|
||||||
|
String projectIdStr = ServletUtils.getRequest().getParameter("projectId");
|
||||||
|
Long projectId = Long.parseLong(projectIdStr);
|
||||||
if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) {
|
if (!StringUtils.equalsAny(clientId, headerCid, paramCid)) {
|
||||||
// token 无效
|
// token 无效
|
||||||
throw NotLoginException.newInstance(StpUtil.getLoginType(),
|
throw NotLoginException.newInstance(StpUtil.getLoginType(),
|
||||||
@ -52,6 +55,7 @@ public class PlusWebSocketInterceptor implements HandshakeInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
attributes.put(LOGIN_USER_KEY, loginUser);
|
attributes.put(LOGIN_USER_KEY, loginUser);
|
||||||
|
attributes.put(PROJECT_ID,projectId);
|
||||||
return true;
|
return true;
|
||||||
} catch (NotLoginException e) {
|
} catch (NotLoginException e) {
|
||||||
log.error("WebSocket 认证失败'{}',无法访问系统资源", e.getMessage());
|
log.error("WebSocket 认证失败'{}',无法访问系统资源", e.getMessage());
|
||||||
|
@ -17,6 +17,21 @@
|
|||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.drewnoakes</groupId>-->
|
||||||
|
<!-- <artifactId>metadata-extractor</artifactId>-->
|
||||||
|
<!-- <version>2.18.0</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>technology.tabula</groupId>-->
|
||||||
|
<!-- <artifactId>tabula</artifactId>-->
|
||||||
|
<!-- <version>1.0.4</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
|
||||||
<!-- JSON解析(FastJSON) -->
|
<!-- JSON解析(FastJSON) -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
@ -73,18 +88,32 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 在pdf上生成二维码 -->
|
<!-- 在pdf上生成二维码 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf</groupId>
|
||||||
|
<artifactId>layout</artifactId>
|
||||||
|
<version>7.2.5</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- iText 7 核心模块(必须,layout依赖此模块) -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.itextpdf</groupId>
|
||||||
|
<artifactId>kernel</artifactId>
|
||||||
|
<version>7.2.5</version> <!-- 与layout版本严格一致 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 支持中文字体 -->
|
<!-- 支持中文字体 -->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>com.itextpdf</groupId>
|
<!-- <groupId>com.itextpdf</groupId>-->
|
||||||
<artifactId>itext-asian</artifactId>
|
<!-- <artifactId>itext-asian</artifactId>-->
|
||||||
<version>5.2.0</version>
|
<!-- <version>5.2.0</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<!-- iText -->
|
<!-- <!– iText –>-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>com.itextpdf</groupId>
|
<!-- <groupId>com.itextpdf</groupId>-->
|
||||||
<artifactId>itextpdf</artifactId>
|
<!-- <artifactId>itextpdf</artifactId>-->
|
||||||
<version>5.5.13.3</version>
|
<!-- <version>5.5.13.3</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<!-- ZXing -->
|
<!-- ZXing -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.zxing</groupId>
|
<groupId>com.google.zxing</groupId>
|
||||||
@ -108,6 +137,11 @@
|
|||||||
<artifactId>ruoyi-common-doc</artifactId>
|
<artifactId>ruoyi-common-doc</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-job</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-mybatis</artifactId>
|
<artifactId>ruoyi-common-mybatis</artifactId>
|
||||||
@ -216,6 +250,17 @@
|
|||||||
<version>5.3.0</version>
|
<version>5.3.0</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.javassist</groupId>
|
||||||
|
<artifactId>javassist</artifactId>
|
||||||
|
<version>3.25.0-GA</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty-all</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -3,7 +3,9 @@ package org.dromara.bidding.controller;
|
|||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||||
import org.dromara.bidding.domain.bo.BusBiddingLimitListBo;
|
import org.dromara.bidding.domain.bo.BusBiddingLimitListBo;
|
||||||
import org.dromara.bidding.domain.bo.BiddingAllVersionNumbersReq;
|
import org.dromara.bidding.domain.bo.BiddingAllVersionNumbersReq;
|
||||||
import org.dromara.bidding.domain.vo.BusBiddingLimitListVo;
|
import org.dromara.bidding.domain.vo.BusBiddingLimitListVo;
|
||||||
@ -16,10 +18,14 @@ import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.web.core.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.tender.domain.bo.BusBillofquantitiesLimitListBo;
|
||||||
|
import org.dromara.tender.domain.vo.BusBLimitListVersionsVo;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,6 +42,8 @@ public class BusBiddingLimitListController extends BaseController {
|
|||||||
|
|
||||||
private final IBusBiddingLimitListService busBiddingLimitListService;
|
private final IBusBiddingLimitListService busBiddingLimitListService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询成本-投标列表
|
* 查询成本-投标列表
|
||||||
*/
|
*/
|
||||||
@ -63,6 +71,15 @@ public class BusBiddingLimitListController extends BaseController {
|
|||||||
return R.ok(busBiddingLimitListService.obtainAllVersionNumbers(bo));
|
return R.ok(busBiddingLimitListService.obtainAllVersionNumbers(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有版本详细信息
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("bidding:biddingLimitList:getVersionDetail")
|
||||||
|
@GetMapping("/getVersionDetail/{id}")
|
||||||
|
public R<BusBiddingLimitVersionsVo> getVersionDetail(@NotNull(message = "id不能为空") @PathVariable Long id) {
|
||||||
|
return R.ok(busBiddingLimitListService.getVersionDetail(id));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取指定版本的sheet
|
* 获取指定版本的sheet
|
||||||
*/
|
*/
|
||||||
@ -90,8 +107,8 @@ public class BusBiddingLimitListController extends BaseController {
|
|||||||
@Log(title = "成本-投标", businessType = BusinessType.INSERT)
|
@Log(title = "成本-投标", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/importExcelFile")
|
@PostMapping("/importExcelFile")
|
||||||
public R<Void> importExcelFile(Long projectId, @RequestParam("file") MultipartFile file) {
|
public R<Void> importExcelFile(BusBiddingLimitListBo bo, @RequestParam("file") MultipartFile file) {
|
||||||
return toAjax(busBiddingLimitListService.importExcelFile(projectId, file));
|
return toAjax(busBiddingLimitListService.importExcelFile(bo, file));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -124,8 +141,8 @@ public class BusBiddingLimitListController extends BaseController {
|
|||||||
@Log(title = "成本-投标", businessType = BusinessType.UPDATE)
|
@Log(title = "成本-投标", businessType = BusinessType.UPDATE)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BusBiddingLimitListBo bo) {
|
public R<Void> edit(@RequestBody List<BusBiddingLimitListBo> bos) {
|
||||||
return toAjax(busBiddingLimitListService.updateByBo(bo));
|
return toAjax(busBiddingLimitListService.updateByBo(bos));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6,6 +6,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.dromara.tender.domain.bo.BusBiddingPlanBo;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
@ -21,12 +22,13 @@ import org.dromara.bidding.domain.vo.BusListOfWinningBidsVo;
|
|||||||
import org.dromara.bidding.domain.bo.BusListOfWinningBidsBo;
|
import org.dromara.bidding.domain.bo.BusListOfWinningBidsBo;
|
||||||
import org.dromara.bidding.service.IBusListOfWinningBidsService;
|
import org.dromara.bidding.service.IBusListOfWinningBidsService;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标项目一览
|
* 中标项目一览
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-08-20
|
* @date 2025-08-22
|
||||||
*/
|
*/
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@ -41,8 +43,8 @@ public class BusListOfWinningBidsController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("bidding:listOfWinningBids:list")
|
@SaCheckPermission("bidding:listOfWinningBids:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo<BusListOfWinningBidsVo> list(BusListOfWinningBidsBo bo, PageQuery pageQuery) {
|
public R<BusListOfWinningBidsVo> list(BusListOfWinningBidsBo bo) {
|
||||||
return busListOfWinningBidsService.queryPageList(bo, pageQuery);
|
return R.ok(busListOfWinningBidsService.queryOne(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -68,6 +70,17 @@ public class BusListOfWinningBidsController extends BaseController {
|
|||||||
return R.ok(busListOfWinningBidsService.queryById(id));
|
return R.ok(busListOfWinningBidsService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id获取中标项目一览详细信息
|
||||||
|
*
|
||||||
|
* @param bo 主键
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("bidding:listOfWinningBids:getInfoByProjectId")
|
||||||
|
@GetMapping("/getInfoByProjectId")
|
||||||
|
public R<BusListOfWinningBidsVo> getInfoByProjectId(BusListOfWinningBidsBo bo) {
|
||||||
|
return R.ok(busListOfWinningBidsService.queryOne(bo));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增中标项目一览
|
* 新增中标项目一览
|
||||||
*/
|
*/
|
||||||
@ -75,7 +88,7 @@ public class BusListOfWinningBidsController extends BaseController {
|
|||||||
@Log(title = "中标项目一览", businessType = BusinessType.INSERT)
|
@Log(title = "中标项目一览", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BusListOfWinningBidsBo bo) {
|
public R<Void> add(@RequestBody BusListOfWinningBidsBo bo ) {
|
||||||
return toAjax(busListOfWinningBidsService.insertByBo(bo));
|
return toAjax(busListOfWinningBidsService.insertByBo(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +42,14 @@ public class BusBiddingLimitVersions extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String versions;
|
private String versions;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本号名称
|
||||||
|
*/
|
||||||
|
private String versionsName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* excel文件
|
* excel文件
|
||||||
*/
|
*/
|
||||||
|
@ -6,7 +6,6 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
@ -16,7 +15,7 @@ import java.io.Serial;
|
|||||||
* 中标项目一览对象 bus_list_of_winning_bids
|
* 中标项目一览对象 bus_list_of_winning_bids
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-08-20
|
* @date 2025-08-22
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ -37,90 +36,157 @@ public class BusListOfWinningBids extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目状态
|
|
||||||
*/
|
|
||||||
private String projectStatus;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目名称
|
* 项目名称
|
||||||
*/
|
*/
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标价(原币)
|
* 项目简称
|
||||||
*/
|
*/
|
||||||
private BigDecimal winningBidOriginal;
|
private String shortName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 汇率
|
* 负责人
|
||||||
*/
|
*/
|
||||||
private BigDecimal exchangeRate;
|
private String principal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种
|
* 负责人电话
|
||||||
*/
|
*/
|
||||||
private String currency;
|
private String principalPhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属主体
|
* 项目类型
|
||||||
*/
|
*/
|
||||||
private String subject;
|
private String projectType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目阶段
|
||||||
|
*/
|
||||||
|
private String projectStage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开工时间
|
||||||
|
*/
|
||||||
|
private String onStreamTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private String lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private String lat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目地址
|
||||||
|
*/
|
||||||
|
private String projectSite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划容量
|
||||||
|
*/
|
||||||
|
private String plan;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际容量
|
||||||
|
*/
|
||||||
|
private String actual;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计总量
|
||||||
|
*/
|
||||||
|
private Long designTotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序字段
|
||||||
|
*/
|
||||||
|
private Long sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除时间
|
||||||
|
*/
|
||||||
|
private Date deletedAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否中标(0中标 1未中标)
|
||||||
|
*/
|
||||||
|
private String whetherBid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标价
|
* 中标价
|
||||||
*/
|
*/
|
||||||
private BigDecimal winningBid;
|
private BigDecimal bidPrice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标日期
|
* 中标通知书
|
||||||
*/
|
*/
|
||||||
private LocalDate bidWinningDate;
|
private String bidFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 投标保证金
|
* 中标通知书名称
|
||||||
*/
|
*/
|
||||||
private BigDecimal bidDeposit;
|
private String bidFileName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否退还
|
* 招标代理机构
|
||||||
*/
|
*/
|
||||||
private String whetherSendBack;
|
private String biddingAgency;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建设单位(客户)
|
* 招标人
|
||||||
*/
|
*/
|
||||||
private String construction;
|
private String tenderer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总造价
|
* 投标截止时间
|
||||||
*/
|
*/
|
||||||
private BigDecimal totalCost;
|
private Date biddingDeadline;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立项申请人
|
* 开标时间
|
||||||
*/
|
*/
|
||||||
private String projectApplicant;
|
private Date bidOpeningTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立项部门
|
* 项目概况
|
||||||
*/
|
*/
|
||||||
private String projectApplicantDept;
|
private String projectOverview;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立项申请日期
|
* 建设地点
|
||||||
*/
|
*/
|
||||||
private LocalDate projectApplicantTime;
|
private String constructionSite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程状态
|
* 计划工期
|
||||||
*/
|
*/
|
||||||
private String processStatus;
|
private String planDuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目编号
|
* 答疑截止时间
|
||||||
*/
|
*/
|
||||||
private String projectNumbering;
|
private Date answeringDeadlineTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 澄清截止时间
|
||||||
|
*/
|
||||||
|
private Date clarifyDeadlineTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有投标保证金(0有,1无)
|
||||||
|
*/
|
||||||
|
private String whetherDeposit;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.bidding.domain.bo;
|
package org.dromara.bidding.domain.bo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import org.dromara.bidding.domain.BusBiddingLimitList;
|
import org.dromara.bidding.domain.BusBiddingLimitList;
|
||||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
@ -91,4 +92,6 @@ public class BusBiddingLimitListBo extends BaseEntity {
|
|||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
private Long type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,14 @@ public class BusBiddingLimitVersionsBo extends BaseEntity {
|
|||||||
@NotBlank(message = "版本号不能为空", groups = { AddGroup.class, EditGroup.class })
|
@NotBlank(message = "版本号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String versions;
|
private String versions;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本号名称
|
||||||
|
*/
|
||||||
|
private String versionsName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* excel文件
|
* excel文件
|
||||||
*/
|
*/
|
||||||
|
@ -10,7 +10,6 @@ import lombok.EqualsAndHashCode;
|
|||||||
import jakarta.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
@ -18,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||||||
* 中标项目一览业务对象 bus_list_of_winning_bids
|
* 中标项目一览业务对象 bus_list_of_winning_bids
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-08-20
|
* @date 2025-08-22
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ -34,93 +33,153 @@ public class BusListOfWinningBidsBo extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 项目id
|
* 项目id
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "项目id不能为空", groups = { AddGroup.class, EditGroup.class })
|
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目状态
|
|
||||||
*/
|
|
||||||
private String projectStatus;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目名称
|
* 项目名称
|
||||||
*/
|
*/
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标价(原币)
|
* 项目简称
|
||||||
*/
|
*/
|
||||||
private BigDecimal winningBidOriginal;
|
private String shortName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 汇率
|
* 负责人
|
||||||
*/
|
*/
|
||||||
private BigDecimal exchangeRate;
|
private String principal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种
|
* 负责人电话
|
||||||
*/
|
*/
|
||||||
private String currency;
|
private String principalPhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属主体
|
* 项目类型
|
||||||
*/
|
*/
|
||||||
private String subject;
|
private String projectType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目阶段
|
||||||
|
*/
|
||||||
|
private String projectStage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开工时间
|
||||||
|
*/
|
||||||
|
private String onStreamTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private String lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private String lat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目地址
|
||||||
|
*/
|
||||||
|
private String projectSite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划容量
|
||||||
|
*/
|
||||||
|
private String plan;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际容量
|
||||||
|
*/
|
||||||
|
private String actual;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计总量
|
||||||
|
*/
|
||||||
|
@NotNull(message = "设计总量不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long designTotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序字段
|
||||||
|
*/
|
||||||
|
@NotNull(message = "排序字段不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
|
private Long sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除时间
|
||||||
|
*/
|
||||||
|
private Date deletedAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否中标(0中标 1未中标)
|
||||||
|
*/
|
||||||
|
private String whetherBid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标价
|
* 中标价
|
||||||
*/
|
*/
|
||||||
private BigDecimal winningBid;
|
private BigDecimal bidPrice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标日期
|
* 中标通知书
|
||||||
*/
|
*/
|
||||||
private LocalDate bidWinningDate;
|
private String bidFile;
|
||||||
|
private Long bidFileId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 投标保证金
|
* 中标通知书名称
|
||||||
*/
|
*/
|
||||||
private BigDecimal bidDeposit;
|
private String bidFileName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否退还
|
* 招标代理机构
|
||||||
*/
|
*/
|
||||||
private String whetherSendBack;
|
private String biddingAgency;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建设单位(客户)
|
* 招标人
|
||||||
*/
|
*/
|
||||||
private String construction;
|
private String tenderer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总造价
|
* 投标截止时间
|
||||||
*/
|
*/
|
||||||
private BigDecimal totalCost;
|
private Date biddingDeadline;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立项申请人
|
* 开标时间
|
||||||
*/
|
*/
|
||||||
private String projectApplicant;
|
private Date bidOpeningTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立项部门
|
* 项目概况
|
||||||
*/
|
*/
|
||||||
private String projectApplicantDept;
|
private String projectOverview;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立项申请日期
|
* 建设地点
|
||||||
*/
|
*/
|
||||||
private LocalDate projectApplicantTime;
|
private String constructionSite;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程状态
|
* 计划工期
|
||||||
*/
|
*/
|
||||||
private String processStatus;
|
private String planDuration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目编号
|
* 答疑截止时间
|
||||||
*/
|
*/
|
||||||
private String projectNumbering;
|
private Date answeringDeadlineTime;
|
||||||
|
/**
|
||||||
|
* 澄清截止时间
|
||||||
|
*/
|
||||||
|
private Date clarifyDeadlineTime;
|
||||||
|
/**
|
||||||
|
* 是否有投标保证金(0有,1无)
|
||||||
|
*/
|
||||||
|
private String whetherDeposit;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.dromara.bidding.domain.vo;
|
package org.dromara.bidding.domain.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
import org.dromara.bidding.domain.BusBiddingLimitList;
|
import org.dromara.bidding.domain.BusBiddingLimitList;
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
@ -77,6 +78,7 @@ public class BusBiddingLimitListVo implements Serializable {
|
|||||||
* 名称
|
* 名称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "名称")
|
@ExcelProperty(value = "名称")
|
||||||
|
@ColumnWidth(50)
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,6 +52,14 @@ public class BusBiddingLimitVersionsVo implements Serializable {
|
|||||||
@ExcelProperty(value = "版本号")
|
@ExcelProperty(value = "版本号")
|
||||||
private String versions;
|
private String versions;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本号名称
|
||||||
|
*/
|
||||||
|
private String versionsName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* excel文件
|
* excel文件
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package org.dromara.bidding.domain.vo;
|
package org.dromara.bidding.domain.vo;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import org.dromara.bidding.domain.BusListOfWinningBids;
|
import org.dromara.bidding.domain.BusListOfWinningBids;
|
||||||
@ -22,7 +21,7 @@ import java.util.Date;
|
|||||||
* 中标项目一览视图对象 bus_list_of_winning_bids
|
* 中标项目一览视图对象 bus_list_of_winning_bids
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-08-20
|
* @date 2025-08-22
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
@ -44,12 +43,6 @@ public class BusListOfWinningBidsVo implements Serializable {
|
|||||||
@ExcelProperty(value = "项目id")
|
@ExcelProperty(value = "项目id")
|
||||||
private Long projectId;
|
private Long projectId;
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目状态
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "项目状态")
|
|
||||||
private String projectStatus;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目名称
|
* 项目名称
|
||||||
*/
|
*/
|
||||||
@ -57,95 +50,171 @@ public class BusListOfWinningBidsVo implements Serializable {
|
|||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标价(原币)
|
* 项目简称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "中标价(原币)", converter = ExcelDictConvert.class)
|
@ExcelProperty(value = "项目简称")
|
||||||
private BigDecimal winningBidOriginal;
|
private String shortName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 汇率
|
* 负责人
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "汇率")
|
@ExcelProperty(value = "负责人")
|
||||||
private BigDecimal exchangeRate;
|
private String principal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 币种
|
* 负责人电话
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "币种")
|
@ExcelProperty(value = "负责人电话")
|
||||||
private String currency;
|
private String principalPhone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属主体
|
* 项目类型
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "所属主体")
|
@ExcelProperty(value = "项目类型")
|
||||||
private String subject;
|
private String projectType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目阶段
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "项目阶段")
|
||||||
|
private String projectStage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开工时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "开工时间")
|
||||||
|
private String onStreamTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "经度")
|
||||||
|
private String lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "纬度")
|
||||||
|
private String lat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目地址
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "项目地址")
|
||||||
|
private String projectSite;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划容量
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "计划容量")
|
||||||
|
private String plan;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际容量
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "实际容量")
|
||||||
|
private String actual;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计总量
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "设计总量")
|
||||||
|
private Long designTotal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序字段
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "排序字段")
|
||||||
|
private Long sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "删除时间")
|
||||||
|
private Date deletedAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否中标(0中标 1未中标)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "是否中标", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "0=中标,1=未中标")
|
||||||
|
private String whetherBid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标价
|
* 中标价
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "中标价")
|
@ExcelProperty(value = "中标价")
|
||||||
private BigDecimal winningBid;
|
private BigDecimal bidPrice;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标日期
|
* 中标通知书
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "中标日期")
|
@ExcelProperty(value = "中标通知书")
|
||||||
private LocalDate bidWinningDate;
|
private String bidFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 投标保证金
|
* 中标通知书名称
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "投标保证金")
|
@ExcelProperty(value = "中标通知书名称")
|
||||||
private BigDecimal bidDeposit;
|
private String bidFileName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否退还
|
* 招标代理机构
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "是否退还")
|
private String biddingAgency;
|
||||||
private String whetherSendBack;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建设单位(客户)
|
* 招标人
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "建设单位", converter = ExcelDictConvert.class)
|
private String tenderer;
|
||||||
@ExcelDictFormat(readConverterExp = "客=户")
|
|
||||||
private String construction;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总造价
|
* 投标截止时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "总造价")
|
private Date biddingDeadline;
|
||||||
private BigDecimal totalCost;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立项申请人
|
* 开标时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "立项申请人")
|
private Date bidOpeningTime;
|
||||||
private String projectApplicant;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立项部门
|
* 项目概况
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "立项部门")
|
private String projectOverview;
|
||||||
private String projectApplicantDept;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 立项申请日期
|
* 建设地点
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "立项申请日期")
|
private String constructionSite;
|
||||||
private LocalDate projectApplicantTime;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 流程状态
|
* 计划工期
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "流程状态")
|
private String planDuration;
|
||||||
private String processStatus;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目编号
|
* 答疑截止时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "项目编号")
|
private Date answeringDeadlineTime;
|
||||||
private String projectNumbering;
|
|
||||||
|
/**
|
||||||
|
* 澄清截止时间
|
||||||
|
*/
|
||||||
|
private Date clarifyDeadlineTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有投标保证金(0有,1无)
|
||||||
|
*/
|
||||||
|
private String whetherDeposit;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
package org.dromara.bidding.mapper;
|
package org.dromara.bidding.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.dromara.bidding.domain.BusBiddingLimitList;
|
import org.dromara.bidding.domain.BusBiddingLimitList;
|
||||||
import org.dromara.bidding.domain.vo.BusBiddingLimitListVo;
|
import org.dromara.bidding.domain.vo.BusBiddingLimitListVo;
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成本-投标Mapper接口
|
* 成本-投标Mapper接口
|
||||||
*
|
*
|
||||||
@ -12,4 +15,6 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
*/
|
*/
|
||||||
public interface BusBiddingLimitListMapper extends BaseMapperPlus<BusBiddingLimitList, BusBiddingLimitListVo> {
|
public interface BusBiddingLimitListMapper extends BaseMapperPlus<BusBiddingLimitList, BusBiddingLimitListVo> {
|
||||||
|
|
||||||
|
|
||||||
|
Boolean updateBatchByIdByNull(@Param("list") List<BusBiddingLimitList> list);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|||||||
* 中标项目一览Mapper接口
|
* 中标项目一览Mapper接口
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-08-20
|
* @date 2025-08-22
|
||||||
*/
|
*/
|
||||||
public interface BusListOfWinningBidsMapper extends BaseMapperPlus<BusListOfWinningBids, BusListOfWinningBidsVo> {
|
public interface BusListOfWinningBidsMapper extends BaseMapperPlus<BusListOfWinningBids, BusListOfWinningBidsVo> {
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ public interface IBusBiddingLimitListService extends IService<BusBiddingLimitLis
|
|||||||
* @param bo 成本-投标
|
* @param bo 成本-投标
|
||||||
* @return 是否修改成功
|
* @return 是否修改成功
|
||||||
*/
|
*/
|
||||||
Boolean updateByBo(BusBiddingLimitListBo bo);
|
Boolean updateByBo(List<BusBiddingLimitListBo> bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验并批量删除成本-投标信息
|
* 校验并批量删除成本-投标信息
|
||||||
@ -79,9 +79,11 @@ public interface IBusBiddingLimitListService extends IService<BusBiddingLimitLis
|
|||||||
*/
|
*/
|
||||||
List<BusBiddingLimitListVo> getTree(BusBiddingLimitListBo bo);
|
List<BusBiddingLimitListVo> getTree(BusBiddingLimitListBo bo);
|
||||||
|
|
||||||
Boolean importExcelFile(Long projectId, MultipartFile file);
|
Boolean importExcelFile(BusBiddingLimitListBo projectId, MultipartFile file);
|
||||||
|
|
||||||
List<BusBiddingLimitVersionsVo> obtainAllVersionNumbers(BiddingAllVersionNumbersReq bo);
|
List<BusBiddingLimitVersionsVo> obtainAllVersionNumbers(BiddingAllVersionNumbersReq bo);
|
||||||
|
|
||||||
List<String> sheetList(BusBiddingLimitListBo bo);
|
List<String> sheetList(BusBiddingLimitListBo bo);
|
||||||
|
|
||||||
|
BusBiddingLimitVersionsVo getVersionDetail(Long id);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package org.dromara.bidding.service;
|
package org.dromara.bidding.service;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import org.dromara.bidding.domain.vo.BusBiddingLimitVersionsVo;
|
import org.dromara.bidding.domain.vo.BusBiddingLimitVersionsVo;
|
||||||
import org.dromara.bidding.domain.bo.BusBiddingLimitVersionsBo;
|
import org.dromara.bidding.domain.bo.BusBiddingLimitVersionsBo;
|
||||||
import org.dromara.bidding.domain.BusBiddingLimitVersions;
|
import org.dromara.bidding.domain.BusBiddingLimitVersions;
|
||||||
@ -67,4 +69,8 @@ public interface IBusBiddingLimitVersionsService extends IService<BusBiddingLimi
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
BusBiddingLimitVersions queryByProjectId( String versions, Long projectId);
|
||||||
|
|
||||||
|
BusBiddingLimitVersions getByProjectIdVersions(Long projectId, String versions);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -14,7 +15,7 @@ import java.util.List;
|
|||||||
* 中标项目一览Service接口
|
* 中标项目一览Service接口
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-08-20
|
* @date 2025-08-22
|
||||||
*/
|
*/
|
||||||
public interface IBusListOfWinningBidsService extends IService<BusListOfWinningBids>{
|
public interface IBusListOfWinningBidsService extends IService<BusListOfWinningBids>{
|
||||||
|
|
||||||
@ -67,4 +68,11 @@ public interface IBusListOfWinningBidsService extends IService<BusListOfWinningB
|
|||||||
* @return 是否删除成功
|
* @return 是否删除成功
|
||||||
*/
|
*/
|
||||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id获取数据
|
||||||
|
* @param bo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BusListOfWinningBidsVo queryOne(BusListOfWinningBidsBo bo);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.bidding.domain.BusBiddingLimitList;
|
import org.dromara.bidding.domain.BusBiddingLimitList;
|
||||||
|
import org.dromara.bidding.domain.BusBiddingLimitVersions;
|
||||||
import org.dromara.bidding.domain.bo.BusBiddingLimitListBo;
|
import org.dromara.bidding.domain.bo.BusBiddingLimitListBo;
|
||||||
import org.dromara.bidding.domain.bo.BusBiddingLimitVersionsBo;
|
import org.dromara.bidding.domain.bo.BusBiddingLimitVersionsBo;
|
||||||
import org.dromara.bidding.domain.bo.BiddingAllVersionNumbersReq;
|
import org.dromara.bidding.domain.bo.BiddingAllVersionNumbersReq;
|
||||||
@ -17,6 +18,7 @@ import org.dromara.bidding.mapper.BusBiddingLimitListMapper;
|
|||||||
import org.dromara.bidding.service.IBusBiddingLimitListService;
|
import org.dromara.bidding.service.IBusBiddingLimitListService;
|
||||||
import org.dromara.bidding.service.IBusBiddingLimitVersionsService;
|
import org.dromara.bidding.service.IBusBiddingLimitVersionsService;
|
||||||
import org.dromara.common.core.constant.HttpStatus;
|
import org.dromara.common.core.constant.HttpStatus;
|
||||||
|
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
@ -81,13 +83,14 @@ public class BusBiddingLimitListServiceImpl extends ServiceImpl<BusBiddingLimitL
|
|||||||
@Override
|
@Override
|
||||||
public List<BusBiddingLimitListVo> queryList(BusBiddingLimitListBo bo) {
|
public List<BusBiddingLimitListVo> queryList(BusBiddingLimitListBo bo) {
|
||||||
LambdaQueryWrapper<BusBiddingLimitList> lqw = buildQueryWrapper(bo);
|
LambdaQueryWrapper<BusBiddingLimitList> lqw = buildQueryWrapper(bo);
|
||||||
|
lqw.orderByAsc(BusBiddingLimitList::getNum);
|
||||||
return baseMapper.selectVoList(lqw);
|
return baseMapper.selectVoList(lqw);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LambdaQueryWrapper<BusBiddingLimitList> buildQueryWrapper(BusBiddingLimitListBo bo) {
|
private LambdaQueryWrapper<BusBiddingLimitList> buildQueryWrapper(BusBiddingLimitListBo bo) {
|
||||||
Map<String, Object> params = bo.getParams();
|
Map<String, Object> params = bo.getParams();
|
||||||
LambdaQueryWrapper<BusBiddingLimitList> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<BusBiddingLimitList> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByDesc(BusBiddingLimitList::getId);
|
lqw.orderByAsc(BusBiddingLimitList::getSid);
|
||||||
lqw.eq(bo.getProjectId() != null, BusBiddingLimitList::getProjectId, bo.getProjectId());
|
lqw.eq(bo.getProjectId() != null, BusBiddingLimitList::getProjectId, bo.getProjectId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getVersions()), BusBiddingLimitList::getVersions, bo.getVersions());
|
lqw.eq(StringUtils.isNotBlank(bo.getVersions()), BusBiddingLimitList::getVersions, bo.getVersions());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getSheet()), BusBiddingLimitList::getSheet, bo.getSheet());
|
lqw.eq(StringUtils.isNotBlank(bo.getSheet()), BusBiddingLimitList::getSheet, bo.getSheet());
|
||||||
@ -126,10 +129,30 @@ public class BusBiddingLimitListServiceImpl extends ServiceImpl<BusBiddingLimitL
|
|||||||
* @return 是否修改成功
|
* @return 是否修改成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateByBo(BusBiddingLimitListBo bo) {
|
public Boolean updateByBo(List<BusBiddingLimitListBo> bos) {
|
||||||
BusBiddingLimitList update = MapstructUtils.convert(bo, BusBiddingLimitList.class);
|
List<BusBiddingLimitList> list = new ArrayList<>();
|
||||||
validEntityBeforeSave(update);
|
for (BusBiddingLimitListBo bo : bos) {
|
||||||
return baseMapper.updateById(update) > 0;
|
if (bo.getId() == null) {
|
||||||
|
throw new ServiceException("id不能为空");
|
||||||
|
}
|
||||||
|
if (bo.getProjectId() == null) {
|
||||||
|
throw new ServiceException("项目id不能为空!");
|
||||||
|
}
|
||||||
|
if (bo.getVersions() == null) {
|
||||||
|
throw new ServiceException("版本号不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
BusBiddingLimitList update = MapstructUtils.convert(bo, BusBiddingLimitList.class);
|
||||||
|
if (bo.getUnitPrice() == null){
|
||||||
|
update.setUnitPrice(null);
|
||||||
|
}
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
list.add(update);
|
||||||
|
}
|
||||||
|
if (list.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return baseMapper.updateBatchByIdByNull(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -156,13 +179,17 @@ public class BusBiddingLimitListServiceImpl extends ServiceImpl<BusBiddingLimitL
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BusBiddingLimitListVo> getTree(BusBiddingLimitListBo bo) {
|
public List<BusBiddingLimitListVo> getTree(BusBiddingLimitListBo bo) {
|
||||||
|
BusBiddingLimitVersions biddingLimitVersions = busBiddingLimitVersionsService.queryByProjectId(bo.getVersions(),bo.getProjectId());
|
||||||
|
if (biddingLimitVersions == null || (bo.getType() == 1L && !BusinessStatusEnum.FINISH.getStatus().equals(biddingLimitVersions.getStatus()))) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
//获取所有数据
|
//获取所有数据
|
||||||
List<BusBiddingLimitListVo> listVoList = queryList(bo);
|
List<BusBiddingLimitListVo> listVoList = queryList(bo);
|
||||||
//过滤数量和单价为空的数据并计算总价
|
//过滤数量和单价为空的数据并计算总价
|
||||||
listVoList.stream().filter(vo -> vo.getUnitPrice() != null && vo.getUnitPrice().compareTo(BigDecimal.ZERO) != 0)
|
listVoList.stream().filter(vo -> vo.getUnitPrice() != null && vo.getUnitPrice().compareTo(BigDecimal.ZERO) != 0)
|
||||||
.filter(vo -> vo.getQuantity() != null && vo.getQuantity().compareTo(BigDecimal.ZERO) != 0)
|
.filter(vo -> vo.getQuantity() != null && vo.getQuantity().compareTo(BigDecimal.ZERO) != 0)
|
||||||
.forEach(item -> {
|
.forEach(item -> {
|
||||||
item.setPrice(item.getUnitPrice().multiply(item.getQuantity()).setScale(2, RoundingMode.HALF_UP));
|
item.setPrice(item.getUnitPrice().multiply(item.getQuantity()).setScale(4, RoundingMode.HALF_UP));
|
||||||
});
|
});
|
||||||
|
|
||||||
//构建父子映射
|
//构建父子映射
|
||||||
@ -171,12 +198,54 @@ public class BusBiddingLimitListServiceImpl extends ServiceImpl<BusBiddingLimitL
|
|||||||
//递归组装树形结构
|
//递归组装树形结构
|
||||||
List<BusBiddingLimitListVo> treeList = buildTree("0", parentMap);
|
List<BusBiddingLimitListVo> treeList = buildTree("0", parentMap);
|
||||||
|
|
||||||
|
for (BusBiddingLimitListVo item : treeList) {
|
||||||
|
calculateTreePrice(item);
|
||||||
|
}
|
||||||
return treeList;
|
return treeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归计算树形结构中每个节点的 price 字段:
|
||||||
|
* - 叶子节点:price = quantity * unitPrice
|
||||||
|
* - 非叶子节点:price = 所有子节点 price 的总和
|
||||||
|
*/
|
||||||
|
public void calculateTreePrice(BusBiddingLimitListVo node) {
|
||||||
|
if (node == null) return;
|
||||||
|
|
||||||
|
// 先处理所有子节点
|
||||||
|
for (BusBiddingLimitListVo child : node.getChildren()) {
|
||||||
|
calculateTreePrice(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是叶子节点,计算 price = quantity * unitPrice
|
||||||
|
if (node.getChildren().isEmpty()) {
|
||||||
|
if (node.getQuantity() != null && node.getUnitPrice() != null) {
|
||||||
|
node.setPrice(node.getQuantity().multiply(node.getUnitPrice()).setScale(4, RoundingMode.HALF_UP));
|
||||||
|
} else {
|
||||||
|
node.setPrice(BigDecimal.ZERO); // 默认值
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 非叶子节点:累加子节点的 price
|
||||||
|
BigDecimal totalPrice = node.getChildren().stream()
|
||||||
|
.map(BusBiddingLimitListVo::getPrice)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add)
|
||||||
|
.setScale(4, RoundingMode.HALF_UP);
|
||||||
|
node.setPrice(totalPrice);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean importExcelFile(Long projectId, MultipartFile file) {
|
public Boolean importExcelFile(BusBiddingLimitListBo bo, MultipartFile file) {
|
||||||
|
BusBiddingLimitVersions biddingLimitVersions = busBiddingLimitVersionsService.getByProjectIdVersions(bo.getProjectId(),bo.getVersions());
|
||||||
|
|
||||||
|
if (biddingLimitVersions == null) {
|
||||||
|
throw new ServiceException("版本号不存在!!!");
|
||||||
|
}
|
||||||
|
if (BusinessStatusEnum.FINISH.getStatus().equals(biddingLimitVersions.getStatus())) {
|
||||||
|
throw new ServiceException("数据已审核完成,不允许修改!!!");
|
||||||
|
}
|
||||||
|
|
||||||
// 跳过1行(表头),读取0到6列(共7列),映射到ExcelData实体类
|
// 跳过1行(表头),读取0到6列(共7列),映射到ExcelData实体类
|
||||||
List<BusBiddingLimitListBo> dataList = null;
|
List<BusBiddingLimitListBo> dataList = null;
|
||||||
@ -185,7 +254,7 @@ public class BusBiddingLimitListServiceImpl extends ServiceImpl<BusBiddingLimitL
|
|||||||
file, // 上传的文件
|
file, // 上传的文件
|
||||||
1, // 跳过1行(表头)
|
1, // 跳过1行(表头)
|
||||||
0, // 从第0列开始
|
0, // 从第0列开始
|
||||||
12, // 到第12列结束
|
13, // 到第12列结束
|
||||||
BusBiddingLimitListBo.class // 目标实体类
|
BusBiddingLimitListBo.class // 目标实体类
|
||||||
);
|
);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -208,7 +277,6 @@ public class BusBiddingLimitListServiceImpl extends ServiceImpl<BusBiddingLimitL
|
|||||||
busBillofquantities.add(limitList);
|
busBillofquantities.add(limitList);
|
||||||
});
|
});
|
||||||
log.info(busBillofquantities.toString());
|
log.info(busBillofquantities.toString());
|
||||||
|
|
||||||
return this.updateBatchById(busBillofquantities);
|
return this.updateBatchById(busBillofquantities);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,6 +306,12 @@ public class BusBiddingLimitListServiceImpl extends ServiceImpl<BusBiddingLimitL
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusBiddingLimitVersionsVo getVersionDetail(Long id) {
|
||||||
|
|
||||||
|
return busBiddingLimitVersionsService.queryById(id);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 递归构建树形结构
|
* 递归构建树形结构
|
||||||
*
|
*
|
||||||
|
@ -1,24 +1,29 @@
|
|||||||
package org.dromara.bidding.service.impl;
|
package org.dromara.bidding.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.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.bidding.domain.BusBiddingLimitVersions;
|
||||||
import org.dromara.bidding.domain.bo.BusBiddingLimitVersionsBo;
|
import org.dromara.bidding.domain.bo.BusBiddingLimitVersionsBo;
|
||||||
import org.dromara.bidding.domain.vo.BusBiddingLimitVersionsVo;
|
import org.dromara.bidding.domain.vo.BusBiddingLimitVersionsVo;
|
||||||
import org.dromara.bidding.domain.BusBiddingLimitVersions;
|
|
||||||
import org.dromara.bidding.mapper.BusBiddingLimitVersionsMapper;
|
import org.dromara.bidding.mapper.BusBiddingLimitVersionsMapper;
|
||||||
import org.dromara.bidding.service.IBusBiddingLimitVersionsService;
|
import org.dromara.bidding.service.IBusBiddingLimitVersionsService;
|
||||||
|
import org.dromara.common.core.domain.event.ProcessDeleteEvent;
|
||||||
|
import org.dromara.common.core.domain.event.ProcessEvent;
|
||||||
|
import org.dromara.common.core.domain.event.ProcessTaskEvent;
|
||||||
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.springframework.context.event.EventListener;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 成本- 投标版本Service业务层处理
|
* 成本- 投标版本Service业务层处理
|
||||||
@ -26,6 +31,7 @@ import java.util.Collection;
|
|||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-08-21
|
* @date 2025-08-21
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLimitVersionsMapper, BusBiddingLimitVersions> implements IBusBiddingLimitVersionsService {
|
public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLimitVersionsMapper, BusBiddingLimitVersions> implements IBusBiddingLimitVersionsService {
|
||||||
@ -39,7 +45,7 @@ public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLi
|
|||||||
* @return 成本- 投标版本
|
* @return 成本- 投标版本
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BusBiddingLimitVersionsVo queryById(Long id){
|
public BusBiddingLimitVersionsVo queryById(Long id) {
|
||||||
return baseMapper.selectVoById(id);
|
return baseMapper.selectVoById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +119,7 @@ public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLi
|
|||||||
/**
|
/**
|
||||||
* 保存前的数据校验
|
* 保存前的数据校验
|
||||||
*/
|
*/
|
||||||
private void validEntityBeforeSave(BusBiddingLimitVersions entity){
|
private void validEntityBeforeSave(BusBiddingLimitVersions entity) {
|
||||||
//TODO 做一些数据校验,如唯一约束
|
//TODO 做一些数据校验,如唯一约束
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,9 +132,78 @@ public class BusBiddingLimitVersionsServiceImpl extends ServiceImpl<BusBiddingLi
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
if(isValid){
|
if (isValid) {
|
||||||
//TODO 做一些业务上的校验,判断是否需要校验
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusBiddingLimitVersions queryByProjectId(String versions, Long projectId) {
|
||||||
|
return baseMapper.selectOne(new LambdaQueryWrapper<BusBiddingLimitVersions>()
|
||||||
|
.eq(BusBiddingLimitVersions::getProjectId, projectId)
|
||||||
|
.eq(BusBiddingLimitVersions::getVersions, versions));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusBiddingLimitVersions getByProjectIdVersions(Long projectId, String versions) {
|
||||||
|
return baseMapper.selectOne(new LambdaQueryWrapper<BusBiddingLimitVersions>()
|
||||||
|
.eq(BusBiddingLimitVersions::getProjectId, projectId)
|
||||||
|
.eq(BusBiddingLimitVersions::getVersions, versions));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总体流程监听(例如: 草稿,撤销,退回,作废,终止,已完成,单任务完成等)
|
||||||
|
* 正常使用只需#processEvent.flowCode=='leave1'
|
||||||
|
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||||
|
*
|
||||||
|
* @param processEvent 参数
|
||||||
|
*/
|
||||||
|
@EventListener(condition = "#processEvent.flowCode.endsWith('biddingLimitList')")
|
||||||
|
public void processPlansHandlErequipmentList(ProcessEvent processEvent) {
|
||||||
|
log.info("物资设备清单审核任务执行了{}", processEvent.toString());
|
||||||
|
String id = processEvent.getBusinessId();
|
||||||
|
LambdaQueryWrapper<BusBiddingLimitVersions> eq = new LambdaQueryWrapper<BusBiddingLimitVersions>()
|
||||||
|
.eq(BusBiddingLimitVersions::getId, id);
|
||||||
|
BusBiddingLimitVersions busBiddingLimitVersions = new BusBiddingLimitVersions();
|
||||||
|
busBiddingLimitVersions.setStatus(processEvent.getStatus());
|
||||||
|
boolean update = this.update(busBiddingLimitVersions, eq);
|
||||||
|
// BusBiddingPlan biddingPlan = baseMapper.selectById(Long.valueOf(id));
|
||||||
|
// if (biddingPlan == null) {
|
||||||
|
// log.error("");
|
||||||
|
// }
|
||||||
|
// if (BusinessStatusEnum.DRAFT.getStatus().equals(biddingPlan.getStatus())) {
|
||||||
|
// biddingPlan.setBidStatus(1);
|
||||||
|
// }
|
||||||
|
// biddingPlan.setStatus(processEvent.getStatus());
|
||||||
|
// baseMapper.updateById(biddingPlan);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 执行任务创建监听
|
||||||
|
* 示例:也可通过 @EventListener(condition = "#processTaskEvent.flowCode=='leave1'")进行判断
|
||||||
|
* 在方法中判断流程节点key
|
||||||
|
* if ("xxx".equals(processTaskEvent.getNodeCode())) {
|
||||||
|
* //执行业务逻辑
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
* @param processTaskEvent 参数
|
||||||
|
*/
|
||||||
|
@EventListener(condition = "#processTaskEvent.flowCode.endsWith('biddingLimitList')")
|
||||||
|
public void processTaskPlansHandlerEquipmentList(ProcessTaskEvent processTaskEvent) {
|
||||||
|
log.info("物资设备清单审核任务创建了{}", processTaskEvent.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监听删除流程事件
|
||||||
|
* 正常使用只需#processDeleteEvent.flowCode=='leave1'
|
||||||
|
* 示例为了方便则使用startsWith匹配了全部示例key
|
||||||
|
*
|
||||||
|
* @param processDeleteEvent 参数
|
||||||
|
*/
|
||||||
|
@EventListener(condition = "#processDeleteEvent.flowCode.endsWith('biddingLimitList')")
|
||||||
|
public void processDeletePlansHandlerEquipmentList(ProcessDeleteEvent processDeleteEvent) {
|
||||||
|
log.info("物资设备清单计划删除流程事件,技术标准文件审核任务执行了{}", processDeleteEvent.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,18 @@ package org.dromara.bidding.service.impl;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
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.TableDataInfo;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.ctr.domain.CtrIncomeContract;
|
||||||
|
import org.dromara.ctr.service.ICtrIncomeContractService;
|
||||||
|
import org.dromara.system.domain.vo.SysOssUploadVo;
|
||||||
|
import org.dromara.system.domain.vo.SysOssVo;
|
||||||
|
import org.dromara.system.service.ISysOssService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.dromara.bidding.domain.bo.BusListOfWinningBidsBo;
|
import org.dromara.bidding.domain.bo.BusListOfWinningBidsBo;
|
||||||
import org.dromara.bidding.domain.vo.BusListOfWinningBidsVo;
|
import org.dromara.bidding.domain.vo.BusListOfWinningBidsVo;
|
||||||
@ -20,11 +25,13 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
|
import static org.dromara.common.constant.MinioPathConstant.FormalitiesAnnex;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中标项目一览Service业务层处理
|
* 中标项目一览Service业务层处理
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @date 2025-08-20
|
* @date 2025-08-22
|
||||||
*/
|
*/
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
@ -32,6 +39,9 @@ public class BusListOfWinningBidsServiceImpl extends ServiceImpl<BusListOfWinnin
|
|||||||
|
|
||||||
private final BusListOfWinningBidsMapper baseMapper;
|
private final BusListOfWinningBidsMapper baseMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysOssService ossService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询中标项目一览
|
* 查询中标项目一览
|
||||||
*
|
*
|
||||||
@ -74,23 +84,7 @@ public class BusListOfWinningBidsServiceImpl extends ServiceImpl<BusListOfWinnin
|
|||||||
LambdaQueryWrapper<BusListOfWinningBids> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<BusListOfWinningBids> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.orderByDesc(BusListOfWinningBids::getId);
|
lqw.orderByDesc(BusListOfWinningBids::getId);
|
||||||
lqw.eq(bo.getProjectId() != null, BusListOfWinningBids::getProjectId, bo.getProjectId());
|
lqw.eq(bo.getProjectId() != null, BusListOfWinningBids::getProjectId, bo.getProjectId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectStatus()), BusListOfWinningBids::getProjectStatus, bo.getProjectStatus());
|
lqw.eq(bo.getId() != null, BusListOfWinningBids::getId, bo.getId());
|
||||||
lqw.like(StringUtils.isNotBlank(bo.getProjectName()), BusListOfWinningBids::getProjectName, bo.getProjectName());
|
|
||||||
lqw.eq(bo.getWinningBidOriginal() != null, BusListOfWinningBids::getWinningBidOriginal, bo.getWinningBidOriginal());
|
|
||||||
lqw.eq(bo.getExchangeRate() != null, BusListOfWinningBids::getExchangeRate, bo.getExchangeRate());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getCurrency()), BusListOfWinningBids::getCurrency, bo.getCurrency());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getSubject()), BusListOfWinningBids::getSubject, bo.getSubject());
|
|
||||||
lqw.eq(bo.getWinningBid() != null, BusListOfWinningBids::getWinningBid, bo.getWinningBid());
|
|
||||||
lqw.eq(bo.getBidWinningDate() != null, BusListOfWinningBids::getBidWinningDate, bo.getBidWinningDate());
|
|
||||||
lqw.eq(bo.getBidDeposit() != null, BusListOfWinningBids::getBidDeposit, bo.getBidDeposit());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getWhetherSendBack()), BusListOfWinningBids::getWhetherSendBack, bo.getWhetherSendBack());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getConstruction()), BusListOfWinningBids::getConstruction, bo.getConstruction());
|
|
||||||
lqw.eq(bo.getTotalCost() != null, BusListOfWinningBids::getTotalCost, bo.getTotalCost());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectApplicant()), BusListOfWinningBids::getProjectApplicant, bo.getProjectApplicant());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectApplicantDept()), BusListOfWinningBids::getProjectApplicantDept, bo.getProjectApplicantDept());
|
|
||||||
lqw.eq(bo.getProjectApplicantTime() != null, BusListOfWinningBids::getProjectApplicantTime, bo.getProjectApplicantTime());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getProcessStatus()), BusListOfWinningBids::getProcessStatus, bo.getProcessStatus());
|
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getProjectNumbering()), BusListOfWinningBids::getProjectNumbering, bo.getProjectNumbering());
|
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,13 +96,16 @@ public class BusListOfWinningBidsServiceImpl extends ServiceImpl<BusListOfWinnin
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(BusListOfWinningBidsBo bo) {
|
public Boolean insertByBo(BusListOfWinningBidsBo bo) {
|
||||||
BusListOfWinningBids add = MapstructUtils.convert(bo, BusListOfWinningBids.class);
|
if (bo.getId() == null) {
|
||||||
validEntityBeforeSave(add);
|
BusListOfWinningBids add = MapstructUtils.convert(bo, BusListOfWinningBids.class);
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
validEntityBeforeSave(add);
|
||||||
if (flag) {
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
bo.setId(add.getId());
|
if (flag) {
|
||||||
|
bo.setId(add.getId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
}
|
}
|
||||||
return flag;
|
return updateByBo(bo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -145,4 +142,10 @@ public class BusListOfWinningBidsServiceImpl extends ServiceImpl<BusListOfWinnin
|
|||||||
}
|
}
|
||||||
return baseMapper.deleteByIds(ids) > 0;
|
return baseMapper.deleteByIds(ids) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BusListOfWinningBidsVo queryOne(BusListOfWinningBidsBo bo) {
|
||||||
|
return baseMapper.selectVoOne(new LambdaQueryWrapper<BusListOfWinningBids>()
|
||||||
|
.eq(BusListOfWinningBids::getProjectId, bo.getProjectId()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,265 @@
|
|||||||
|
package org.dromara.bigscreen.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.dromara.bigscreen.domain.dto.WeatherQueryReq;
|
||||||
|
import org.dromara.bigscreen.domain.vo.*;
|
||||||
|
import org.dromara.bigscreen.mapper.ProjectBigScreenMapper;
|
||||||
|
import org.dromara.bigscreen.service.EnterpriseBigScreenService;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.utils.DateUtils;
|
||||||
|
import org.dromara.common.utils.BigDecimalUtil;
|
||||||
|
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||||
|
import org.dromara.project.domain.BusProject;
|
||||||
|
import org.dromara.project.domain.BusUserProjectRelevancy;
|
||||||
|
import org.dromara.project.service.IBusAttendanceService;
|
||||||
|
import org.dromara.project.service.IBusProjectService;
|
||||||
|
import org.dromara.project.service.IBusUserProjectRelevancyService;
|
||||||
|
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.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.temporal.ChronoUnit;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业级大屏
|
||||||
|
*
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 14:55
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/enterprise/big/screen")
|
||||||
|
public class EnterpriseBigScreenController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private EnterpriseBigScreenService enterpriseBigScreenService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusUserProjectRelevancyService userProjectRelevancyService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusAttendanceService attendanceService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProjectService projectService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProjectBigScreenMapper projectBigScreenMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取关键指标
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:keyIndex")
|
||||||
|
@GetMapping("/keyIndex")
|
||||||
|
public R<EnterpriseKeyIndexVo> getEnterpriseKeyIndex() {
|
||||||
|
return R.ok(enterpriseBigScreenService.getEnterpriseKeyIndex());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目进度分析
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:projectProgress")
|
||||||
|
@GetMapping("/projectProgress")
|
||||||
|
public R<ProjectProgressAnalysisVo> getProjectProgress() {
|
||||||
|
return R.ok(enterpriseBigScreenService.getProjectProgressAnalysis());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目产值对比
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:projectOutputValueComparison")
|
||||||
|
@GetMapping("/projectOutputValueComparison")
|
||||||
|
public R<List<OutputValueComparisonVo>> getProjectOutputValueComparison() {
|
||||||
|
return R.ok(enterpriseBigScreenService.getProjectOutputValueComparison());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目进度完成度和计划容量
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:projectProgressCapacity")
|
||||||
|
@GetMapping("/projectProgressCapacity")
|
||||||
|
public R<List<ProjectProgressCapacityVo>> getProjectProgressCapacity() {
|
||||||
|
return R.ok(enterpriseBigScreenService.getProjectProgressCapacity());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风险预警
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:riskEarlyWarning")
|
||||||
|
@GetMapping("/riskEarlyWarning")
|
||||||
|
public R<List<RiskEarlyWarningVo>> getRiskEarlyWarning() {
|
||||||
|
return R.ok(enterpriseBigScreenService.getRiskEarlyWarning());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询天气
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:weather")
|
||||||
|
@GetMapping("/weather")
|
||||||
|
public R<List<WeatherVo>> getProjectWeather(WeatherQueryReq req) {
|
||||||
|
return R.ok(enterpriseBigScreenService.getWeather3DaysList(req));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询安全天数
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:safetyDay")
|
||||||
|
@GetMapping("/safetyDay")
|
||||||
|
public R<Long> getProjectSafetyDay() {
|
||||||
|
LocalDate date = LocalDate.of(2023, 1, 1);
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
long days = Math.abs(ChronoUnit.DAYS.between(date, now));
|
||||||
|
return R.ok(days);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 人数统计
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:peopleCount")
|
||||||
|
@GetMapping("/peopleCount")
|
||||||
|
public R<PeopleCountVo> getProjectPeopleCount() {
|
||||||
|
PeopleCountVo peopleCountVo = new PeopleCountVo();
|
||||||
|
|
||||||
|
List<BusUserProjectRelevancy> list = userProjectRelevancyService.list();
|
||||||
|
//0系统管理员 1普通人员 2项目管理员 3分包人员
|
||||||
|
peopleCountVo.setConstructionPersonnelCount(list.stream().filter(item -> "1".equals(item.getUserType()))
|
||||||
|
.map(BusUserProjectRelevancy::getUserId)
|
||||||
|
.distinct().count());
|
||||||
|
|
||||||
|
// peopleCountVo.setManagersCount(list.stream().filter(item -> "2".equals(item.getUserType()))
|
||||||
|
// .map(BusUserProjectRelevancy::getUserId)
|
||||||
|
// .distinct().count());
|
||||||
|
peopleCountVo.setManagersCount(69L);
|
||||||
|
|
||||||
|
// peopleCountVo.setSubcontractorsCount(list.stream().filter(item -> "3".equals(item.getUserType()))
|
||||||
|
// .map(BusUserProjectRelevancy::getUserId)
|
||||||
|
// .distinct().count());
|
||||||
|
|
||||||
|
peopleCountVo.setManagersCount(9L);
|
||||||
|
|
||||||
|
Integer projectUserCount = projectBigScreenMapper.getUserCount();
|
||||||
|
peopleCountVo.setConstructionPersonnelCount(Long.valueOf(projectUserCount));
|
||||||
|
return R.ok(peopleCountVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出勤人数统计
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:allAttendanceCount")
|
||||||
|
@GetMapping("/allAttendanceCount")
|
||||||
|
public R<TodayAttendanceCountVo> getAllAttendanceCount() {
|
||||||
|
TodayAttendanceCountVo todayAttendanceCountVo = new TodayAttendanceCountVo();
|
||||||
|
List<BusProject> projectList = projectService.listByIds(List.of(1897160897167638529L, 1897161054676336641L));
|
||||||
|
Integer countUser = 0;
|
||||||
|
Integer countAttendance = 0;
|
||||||
|
for (BusProject project : projectList) {
|
||||||
|
Long projectId = project.getGoId();
|
||||||
|
countUser = countUser + projectBigScreenMapper.getProjectUserCount(projectId);
|
||||||
|
countAttendance = countAttendance + projectBigScreenMapper.getAttendanceCount(projectId, DateUtils.getDate());
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
List<BusAttendance> list = attendanceService.list(Wrappers.<BusAttendance>lambdaQuery()
|
||||||
|
.eq(BusAttendance::getClockDate, LocalDate.now())
|
||||||
|
.in(BusAttendance::getClockStatus, Arrays.asList("1", "2", "3"))
|
||||||
|
);
|
||||||
|
|
||||||
|
long attendanceCount = list.stream().map(BusAttendance::getUserId).distinct().count();
|
||||||
|
todayAttendanceCountVo.setAttendanceCount(attendanceCount);
|
||||||
|
|
||||||
|
// 查询总人数
|
||||||
|
List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list();
|
||||||
|
long totalUserCount = relevancyList.stream().map(BusUserProjectRelevancy::getUserId).distinct().count();
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 计算考勤率(保留一位小数)
|
||||||
|
if (countUser > 0) {
|
||||||
|
BigDecimal rate = new BigDecimal(countAttendance * 100)
|
||||||
|
.divide(new BigDecimal(countUser), 1, RoundingMode.HALF_UP);
|
||||||
|
todayAttendanceCountVo.setAttendanceRate(rate.doubleValue());
|
||||||
|
} else {
|
||||||
|
todayAttendanceCountVo.setAttendanceRate(0.0);
|
||||||
|
}
|
||||||
|
todayAttendanceCountVo.setAttendanceCount(Long.valueOf(countAttendance));
|
||||||
|
return R.ok(todayAttendanceCountVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每个项目的出勤人数
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("enterprise:bigScreen:projectAttendanceCount")
|
||||||
|
@GetMapping("/projectAttendanceCount")
|
||||||
|
public R<List<ProjectAttendanceCountVo>> getProjectAttendanceCount() {
|
||||||
|
|
||||||
|
List<BusProject> projectList = projectService.listByIds(List.of(1897160897167638529L, 1897161054676336641L));
|
||||||
|
return R.ok(projectList.stream().map(busProject -> {
|
||||||
|
ProjectAttendanceCountVo vo = new ProjectAttendanceCountVo();
|
||||||
|
vo.setProjectId(busProject.getId());
|
||||||
|
vo.setProjectName(busProject.getProjectName());
|
||||||
|
Long projectId = busProject.getGoId();
|
||||||
|
Integer projectUserCount = projectBigScreenMapper.getProjectUserCount(projectId);
|
||||||
|
Integer attendanceCount = projectBigScreenMapper.getAttendanceCount(projectId, DateUtils.getDate());
|
||||||
|
vo.setAttendanceCount(Long.valueOf(attendanceCount));
|
||||||
|
vo.setAttendanceRate(BigDecimalUtil.toPercentage(BigDecimal.valueOf(attendanceCount), BigDecimal.valueOf(projectUserCount)).doubleValue());
|
||||||
|
return vo;
|
||||||
|
}).toList());
|
||||||
|
/*ArrayList<ProjectAttendanceCountVo> projectAttendanceCountVos = new ArrayList<>();
|
||||||
|
|
||||||
|
List<BusAttendance> list = attendanceService.list(Wrappers.<BusAttendance>lambdaQuery()
|
||||||
|
.eq(BusAttendance::getClockDate, LocalDate.now())
|
||||||
|
.in(BusAttendance::getClockStatus, Arrays.asList("1", "2", "3"))
|
||||||
|
);
|
||||||
|
List<BusUserProjectRelevancy> relevancyList = userProjectRelevancyService.list();
|
||||||
|
|
||||||
|
// 转换为 Map<projectId, 去重后的 userId 数量>
|
||||||
|
Map<Long, Integer> projectUserCountMap = relevancyList.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
BusUserProjectRelevancy::getProjectId,
|
||||||
|
Collectors.mapping(
|
||||||
|
BusUserProjectRelevancy::getUserId,
|
||||||
|
Collectors.collectingAndThen(
|
||||||
|
Collectors.toSet(),
|
||||||
|
Set::size
|
||||||
|
)
|
||||||
|
)
|
||||||
|
));
|
||||||
|
for (Long projectId : projectUserCountMap.keySet()) {
|
||||||
|
ProjectAttendanceCountVo projectAttendanceCountVo = new ProjectAttendanceCountVo();
|
||||||
|
BusProject byId = projectService.getById(projectId);
|
||||||
|
|
||||||
|
if (byId == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
projectAttendanceCountVo.setProjectName(byId.getProjectName());
|
||||||
|
long count = list.stream().filter(item -> item.getProjectId().equals(projectId))
|
||||||
|
.map(BusAttendance::getUserId)
|
||||||
|
.distinct()
|
||||||
|
.count();
|
||||||
|
Integer i = projectUserCountMap.get(projectId);
|
||||||
|
BigDecimal rate = new BigDecimal("0.0");
|
||||||
|
if (i > 0) {
|
||||||
|
rate = new BigDecimal(count * 100)
|
||||||
|
.divide(new BigDecimal(projectUserCountMap.get(projectId)), 1, RoundingMode.HALF_UP);
|
||||||
|
}
|
||||||
|
projectAttendanceCountVo.setAttendanceRate(rate.doubleValue());
|
||||||
|
projectAttendanceCountVos.add(projectAttendanceCountVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(projectAttendanceCountVos);*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,15 +1,564 @@
|
|||||||
package org.dromara.bigscreen.controller;
|
package org.dromara.bigscreen.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.bigscreen.domain.vo.*;
|
||||||
|
import org.dromara.bigscreen.service.MoneyBigScreenService;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.ctr.domain.CtrExpensesContract;
|
||||||
|
import org.dromara.ctr.domain.CtrIncomeContract;
|
||||||
|
import org.dromara.ctr.service.ICtrExpensesContractService;
|
||||||
|
import org.dromara.ctr.service.ICtrIncomeContractService;
|
||||||
|
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||||
|
import org.dromara.out.domain.OutSettlementValueOwner;
|
||||||
|
import org.dromara.out.domain.OutSettlementValueSubcontract;
|
||||||
|
import org.dromara.out.service.IOutSettlementValueOwnerService;
|
||||||
|
import org.dromara.out.service.IOutSettlementValueSubcontractService;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectGisVo;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.YearMonth;
|
||||||
|
import java.time.temporal.TemporalAdjusters;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 资金大屏
|
||||||
|
*
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-08-21 14:28
|
* @date 2025-08-21 14:28
|
||||||
*/
|
*/
|
||||||
@Validated
|
@Validated
|
||||||
@RestController
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/money/big/screen")
|
@RequestMapping("/money/big/screen")
|
||||||
public class MoneyBigScreenController {
|
public class MoneyBigScreenController {
|
||||||
|
|
||||||
|
private final MoneyBigScreenService moneyBigScreenService;
|
||||||
|
|
||||||
|
private final IOutSettlementValueOwnerService settlementValueOwnerService;
|
||||||
|
private final IOutSettlementValueSubcontractService settlementValueSubcontractService;
|
||||||
|
private final ICtrIncomeContractService incomeContractService;
|
||||||
|
private final ICtrExpensesContractService expensesContractService;
|
||||||
|
|
||||||
|
private final BigDecimal HUNDRED = new BigDecimal(100);
|
||||||
|
private final BigDecimal FIRST_PHASE = new BigDecimal(1000000);
|
||||||
|
private final BigDecimal SECOND_PHASE = new BigDecimal(5000000);
|
||||||
|
private final BigDecimal THIRD_PHASE = new BigDecimal(10000000);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目位置列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("money:bigScreen:projectGis")
|
||||||
|
@GetMapping("/project/gis")
|
||||||
|
public R<List<BusProjectGisVo>> getProjectGis() {
|
||||||
|
return R.ok(moneyBigScreenService.getProjectGis());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收实收
|
||||||
|
*/
|
||||||
|
@GetMapping("/income/pay")
|
||||||
|
public R<MoneyPayVo> incomePay() {
|
||||||
|
Map<String, LocalDate> monthStartAndEnd = getMonthStartAndEnd();
|
||||||
|
LocalDate startDate = monthStartAndEnd.get("start");
|
||||||
|
LocalDate endDate = monthStartAndEnd.get("end");
|
||||||
|
|
||||||
|
|
||||||
|
List<OutSettlementValueOwner> list = settlementValueOwnerService.list();
|
||||||
|
|
||||||
|
BigDecimal planAmount = list.stream()
|
||||||
|
.map(OutSettlementValueOwner::getSettlementValue)
|
||||||
|
.filter(java.util.Objects::nonNull) // 过滤掉 null 值
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
|
||||||
|
// 筛选当月记录用于实际金额计算(包含开始和结束日期)
|
||||||
|
List<OutSettlementValueOwner> monthlyList = list.stream()
|
||||||
|
.filter(item -> {
|
||||||
|
LocalDate settlementDate = item.getSettlementDate();
|
||||||
|
return settlementDate != null &&
|
||||||
|
!settlementDate.isBefore(startDate) &&
|
||||||
|
!settlementDate.isAfter(endDate);
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
// 根据项目ID分组,并统计当月金额
|
||||||
|
Map<Long, BigDecimal> projectMonthlyAmountMap = monthlyList.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
OutSettlementValueOwner::getProjectId,
|
||||||
|
Collectors.reducing(
|
||||||
|
BigDecimal.ZERO,
|
||||||
|
OutSettlementValueOwner::getSettlementValue,
|
||||||
|
BigDecimal::add
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
BigDecimal actualAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
for (Long projectId : projectMonthlyAmountMap.keySet()) {
|
||||||
|
|
||||||
|
CtrIncomeContract contract = incomeContractService.getOne(Wrappers.lambdaQuery(CtrIncomeContract.class)
|
||||||
|
.eq(CtrIncomeContract::getProjectId, projectId)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
if (contract != null && contract.getPayRatio() != null) {
|
||||||
|
actualAmount = actualAmount.add(projectMonthlyAmountMap.get(projectId).multiply(contract.getPayRatio()).divide(HUNDRED).setScale(4, RoundingMode.HALF_UP));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return R.ok(new MoneyPayVo(planAmount, actualAmount));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应付实付
|
||||||
|
*/
|
||||||
|
@GetMapping("/expenses/pay")
|
||||||
|
public R<MoneyPayVo> expensesPay() {
|
||||||
|
Map<String, LocalDate> monthStartAndEnd = getMonthStartAndEnd();
|
||||||
|
LocalDate startDate = monthStartAndEnd.get("start");
|
||||||
|
LocalDate endDate = monthStartAndEnd.get("end");
|
||||||
|
|
||||||
|
List<OutSettlementValueSubcontract> list = settlementValueSubcontractService.list();
|
||||||
|
|
||||||
|
BigDecimal planAmount = list.stream()
|
||||||
|
.map(OutSettlementValueSubcontract::getSettlementValue)
|
||||||
|
.filter(java.util.Objects::nonNull) // 过滤掉 null 值
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
|
||||||
|
// 筛选当月记录用于实际金额计算(包含开始和结束日期)
|
||||||
|
List<OutSettlementValueSubcontract> monthlyList = list.stream()
|
||||||
|
.filter(item -> {
|
||||||
|
LocalDate settlementDate = item.getSettlementDate();
|
||||||
|
return settlementDate != null &&
|
||||||
|
!settlementDate.isBefore(startDate) &&
|
||||||
|
!settlementDate.isAfter(endDate);
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
// 根据分包商Id分组,并统计金额
|
||||||
|
Map<String, BigDecimal> projectAmountMap = monthlyList.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
OutSettlementValueSubcontract::getContractCode, // 根据合同编号分组
|
||||||
|
Collectors.reducing(
|
||||||
|
BigDecimal.ZERO,
|
||||||
|
OutSettlementValueSubcontract::getSettlementValue, // 获取金额字段
|
||||||
|
BigDecimal::add // 对金额求和
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
BigDecimal actualAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
for (String contractCode : projectAmountMap.keySet()) {
|
||||||
|
|
||||||
|
CtrExpensesContract contract = expensesContractService.getOne(Wrappers.lambdaQuery(CtrExpensesContract.class)
|
||||||
|
.eq(CtrExpensesContract::getContractCode, contractCode)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
|
||||||
|
if (contract != null && contract.getPayRatio() != null) {
|
||||||
|
actualAmount = actualAmount.add(projectAmountMap.get(contractCode).multiply(contract.getPayRatio()).setScale(4, RoundingMode.HALF_UP).divide(HUNDRED));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(new MoneyPayVo(planAmount, actualAmount));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收入合同分析
|
||||||
|
*/
|
||||||
|
@GetMapping("/income/analyze")
|
||||||
|
public R<MoneyContractCountVo> incomeAnalyze() {
|
||||||
|
|
||||||
|
|
||||||
|
List<CtrIncomeContract> list = incomeContractService.list();
|
||||||
|
|
||||||
|
// 按金额区间统计数量
|
||||||
|
Integer lessThan1M = (int) list.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null && contract.getAmount().compareTo(FIRST_PHASE) < 0)
|
||||||
|
.count();
|
||||||
|
|
||||||
|
Integer between1MAnd5M = (int) list.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null
|
||||||
|
&& contract.getAmount().compareTo(FIRST_PHASE) >= 0
|
||||||
|
&& contract.getAmount().compareTo(SECOND_PHASE) < 0)
|
||||||
|
.count();
|
||||||
|
|
||||||
|
Integer between5MAnd10M = (int) list.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null
|
||||||
|
&& contract.getAmount().compareTo(SECOND_PHASE) >= 0
|
||||||
|
&& contract.getAmount().compareTo(THIRD_PHASE) < 0)
|
||||||
|
.count();
|
||||||
|
|
||||||
|
Integer greaterThanOrEqualTo10M = (int) list.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null && contract.getAmount().compareTo(THIRD_PHASE) >= 0)
|
||||||
|
.count();
|
||||||
|
|
||||||
|
return R.ok(new MoneyContractCountVo(1, 2, 3, 4));
|
||||||
|
// return R.ok(new MoneyContractCountVo(lessThan1M, between1MAnd5M, between5MAnd10M, greaterThanOrEqualTo10M));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支出合同分析
|
||||||
|
*/
|
||||||
|
@GetMapping("/expenses/analyze")
|
||||||
|
public R<MoneyContractCountVo> expensesAnalyze() {
|
||||||
|
|
||||||
|
List<CtrExpensesContract> list = expensesContractService.list();
|
||||||
|
|
||||||
|
// 按金额区间统计数量
|
||||||
|
Integer lessThan1M = (int) list.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null && contract.getAmount().compareTo(FIRST_PHASE) < 0)
|
||||||
|
.count();
|
||||||
|
|
||||||
|
Integer between1MAnd5M = (int) list.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null
|
||||||
|
&& contract.getAmount().compareTo(FIRST_PHASE) >= 0
|
||||||
|
&& contract.getAmount().compareTo(SECOND_PHASE) < 0)
|
||||||
|
.count();
|
||||||
|
|
||||||
|
Integer between5MAnd10M = (int) list.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null
|
||||||
|
&& contract.getAmount().compareTo(SECOND_PHASE) >= 0
|
||||||
|
&& contract.getAmount().compareTo(THIRD_PHASE) < 0)
|
||||||
|
.count();
|
||||||
|
|
||||||
|
Integer greaterThanOrEqualTo10M = (int) list.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null && contract.getAmount().compareTo(THIRD_PHASE) >= 0)
|
||||||
|
.count();
|
||||||
|
|
||||||
|
return R.ok(new MoneyContractCountVo(4, 4, 6, 6));
|
||||||
|
// return R.ok(new MoneyContractCountVo(lessThan1M, between1MAnd5M, between5MAnd10M, greaterThanOrEqualTo10M));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合同金额
|
||||||
|
*/
|
||||||
|
@GetMapping("/totalAmount")
|
||||||
|
public R<MoneyTotalAmountVo> totalAmount() {
|
||||||
|
|
||||||
|
List<CtrIncomeContract> incomeContracts = incomeContractService.list();
|
||||||
|
BigDecimal incomeTotalAmount = incomeContracts.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null)
|
||||||
|
.map(CtrIncomeContract::getAmount)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
|
||||||
|
List<CtrExpensesContract> expensesContracts = expensesContractService.list();
|
||||||
|
|
||||||
|
BigDecimal expensesTotalAmount = expensesContracts.stream()
|
||||||
|
.filter(contract -> contract.getAmount() != null)
|
||||||
|
.map(CtrExpensesContract::getAmount)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
//利润
|
||||||
|
BigDecimal profitAmount = incomeTotalAmount.subtract(expensesTotalAmount);
|
||||||
|
|
||||||
|
//todo: 工程变更计算 不清楚逻辑 给定个假值
|
||||||
|
BigDecimal changeAmount = new BigDecimal("0.236");
|
||||||
|
|
||||||
|
return R.ok(new MoneyTotalAmountVo(incomeTotalAmount, expensesTotalAmount, profitAmount, changeAmount));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成本
|
||||||
|
*/
|
||||||
|
@GetMapping("/cost")
|
||||||
|
public R<MoneyCostVo> cost() {
|
||||||
|
|
||||||
|
// List<CtrIncomeContract> incomeContracts = incomeContractService.list();
|
||||||
|
// BigDecimal incomeTotalAmount = incomeContracts.stream()
|
||||||
|
// .filter(contract -> contract.getAmount() != null)
|
||||||
|
// .map(CtrIncomeContract::getAmount)
|
||||||
|
// .reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
//todo: 不清楚逻辑 给定个假值
|
||||||
|
BigDecimal materialCost = new BigDecimal("2634.48");
|
||||||
|
BigDecimal subcontractCost = new BigDecimal("28768.56");
|
||||||
|
BigDecimal LaborCost = new BigDecimal("16304.89");
|
||||||
|
BigDecimal manageCost = new BigDecimal("8623.61");
|
||||||
|
|
||||||
|
return R.ok(new MoneyCostVo(materialCost, subcontractCost, LaborCost, manageCost));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按月资金统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/monthMoney")
|
||||||
|
public R<List<MoneyMonthVo>> monthMoney() {
|
||||||
|
List<OutSettlementValueOwner> owners = settlementValueOwnerService.list();
|
||||||
|
List<OutSettlementValueSubcontract> subcontracts = settlementValueSubcontractService.list();
|
||||||
|
|
||||||
|
List<MoneyMonthVo> moneyCostVos = new ArrayList<>();
|
||||||
|
|
||||||
|
// 生成当年12个月的月份列表
|
||||||
|
YearMonth currentYearMonth = YearMonth.now();
|
||||||
|
YearMonth firstMonthOfYear = currentYearMonth.withMonth(1); // 当年1月
|
||||||
|
|
||||||
|
List<YearMonth> currentYearMonths = new ArrayList<>();
|
||||||
|
for (int i = 0; i < 12; i++) {
|
||||||
|
currentYearMonths.add(firstMonthOfYear.plusMonths(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 遍历每个月份,筛选对应的数据
|
||||||
|
for (YearMonth yearMonth : currentYearMonths) {
|
||||||
|
// 获取该月的第一天和最后一天
|
||||||
|
LocalDate startDate = yearMonth.atDay(1);
|
||||||
|
LocalDate endDate = yearMonth.atEndOfMonth();
|
||||||
|
|
||||||
|
// 筛选业主结算数据(应收)并按项目ID分组统计金额
|
||||||
|
Map<Long, BigDecimal> incomeGroupedByProject = owners.stream()
|
||||||
|
.filter(owner -> {
|
||||||
|
LocalDate settlementDate = owner.getSettlementDate();
|
||||||
|
return settlementDate != null &&
|
||||||
|
!settlementDate.isBefore(startDate) &&
|
||||||
|
!settlementDate.isAfter(endDate);
|
||||||
|
})
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
OutSettlementValueOwner::getProjectId,
|
||||||
|
Collectors.reducing(
|
||||||
|
BigDecimal.ZERO,
|
||||||
|
OutSettlementValueOwner::getSettlementValue,
|
||||||
|
BigDecimal::add
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
BigDecimal incomeAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
for (Long projectId : incomeGroupedByProject.keySet()) {
|
||||||
|
CtrIncomeContract contract = incomeContractService.getOne(Wrappers.lambdaQuery(CtrIncomeContract.class)
|
||||||
|
.eq(CtrIncomeContract::getProjectId, projectId)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
if (contract != null && contract.getPayRatio() != null) {
|
||||||
|
incomeAmount = incomeAmount.add(incomeGroupedByProject.get(projectId).multiply(contract.getPayRatio()).setScale(4, RoundingMode.HALF_UP).divide(HUNDRED));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 筛选分包商结算数据(应付)并按合同编号分组统计金额
|
||||||
|
Map<String, BigDecimal> expenseGroupedByContract = subcontracts.stream()
|
||||||
|
.filter(subcontract -> {
|
||||||
|
LocalDate settlementDate = subcontract.getSettlementDate();
|
||||||
|
return settlementDate != null &&
|
||||||
|
!settlementDate.isBefore(startDate) &&
|
||||||
|
!settlementDate.isAfter(endDate);
|
||||||
|
})
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
OutSettlementValueSubcontract::getContractCode,
|
||||||
|
Collectors.reducing(
|
||||||
|
BigDecimal.ZERO,
|
||||||
|
OutSettlementValueSubcontract::getSettlementValue,
|
||||||
|
BigDecimal::add
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
BigDecimal expensesAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
for (String contractCode : expenseGroupedByContract.keySet()) {
|
||||||
|
CtrExpensesContract contract = expensesContractService.getOne(Wrappers.lambdaQuery(CtrExpensesContract.class)
|
||||||
|
.eq(CtrExpensesContract::getContractCode, contractCode)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
|
||||||
|
if (contract != null && contract.getPayRatio() != null) {
|
||||||
|
expensesAmount = expensesAmount.add(expenseGroupedByContract.get(contractCode).multiply(contract.getPayRatio()).setScale(4, RoundingMode.HALF_UP).divide(HUNDRED));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MoneyMonthVo monthData = new MoneyMonthVo(
|
||||||
|
yearMonth.toString(),
|
||||||
|
incomeAmount,
|
||||||
|
expensesAmount,
|
||||||
|
incomeAmount.subtract(expensesAmount)
|
||||||
|
);
|
||||||
|
|
||||||
|
moneyCostVos.add(monthData);
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(moneyCostVos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金流统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/monthCash")
|
||||||
|
public R<List<MoneyMonthVo>> monthCash() {
|
||||||
|
List<OutSettlementValueOwner> owners = settlementValueOwnerService.list();
|
||||||
|
List<OutSettlementValueSubcontract> subcontracts = settlementValueSubcontractService.list();
|
||||||
|
|
||||||
|
List<MoneyMonthVo> moneyCostVos = new ArrayList<>();
|
||||||
|
|
||||||
|
// 生成当年12个月的月份列表
|
||||||
|
YearMonth currentYearMonth = YearMonth.now();
|
||||||
|
YearMonth firstMonthOfYear = currentYearMonth.withMonth(1); // 当年1月
|
||||||
|
|
||||||
|
List<YearMonth> currentYearMonths = new ArrayList<>();
|
||||||
|
for (int i = 0; i < 12; i++) {
|
||||||
|
currentYearMonths.add(firstMonthOfYear.plusMonths(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 遍历每个月份,筛选对应的数据
|
||||||
|
for (YearMonth yearMonth : currentYearMonths) {
|
||||||
|
// 获取该月的第一天和最后一天
|
||||||
|
LocalDate startDate = yearMonth.atDay(1);
|
||||||
|
LocalDate endDate = yearMonth.atEndOfMonth();
|
||||||
|
|
||||||
|
// 筛选业主结算数据(应收)并按项目ID分组统计金额
|
||||||
|
Map<Long, BigDecimal> incomeGroupedByProject = owners.stream()
|
||||||
|
.filter(owner -> {
|
||||||
|
LocalDate settlementDate = owner.getSettlementDate();
|
||||||
|
return settlementDate != null &&
|
||||||
|
!settlementDate.isBefore(startDate) &&
|
||||||
|
!settlementDate.isAfter(endDate);
|
||||||
|
})
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
OutSettlementValueOwner::getProjectId,
|
||||||
|
Collectors.reducing(
|
||||||
|
BigDecimal.ZERO,
|
||||||
|
OutSettlementValueOwner::getSettlementValue,
|
||||||
|
BigDecimal::add
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
BigDecimal incomeAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
for (Long projectId : incomeGroupedByProject.keySet()) {
|
||||||
|
CtrIncomeContract contract = incomeContractService.getOne(Wrappers.lambdaQuery(CtrIncomeContract.class)
|
||||||
|
.eq(CtrIncomeContract::getProjectId, projectId)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
if (contract != null && contract.getPayRatio() != null) {
|
||||||
|
incomeAmount = incomeAmount.add(incomeGroupedByProject.get(projectId).multiply(contract.getPayRatio()).setScale(4, RoundingMode.HALF_UP).divide(HUNDRED));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 筛选分包商结算数据(应付)并按合同编号分组统计金额
|
||||||
|
Map<String, BigDecimal> expenseGroupedByContract = subcontracts.stream()
|
||||||
|
.filter(subcontract -> {
|
||||||
|
LocalDate settlementDate = subcontract.getSettlementDate();
|
||||||
|
return settlementDate != null &&
|
||||||
|
!settlementDate.isBefore(startDate) &&
|
||||||
|
!settlementDate.isAfter(endDate);
|
||||||
|
})
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
OutSettlementValueSubcontract::getContractCode,
|
||||||
|
Collectors.reducing(
|
||||||
|
BigDecimal.ZERO,
|
||||||
|
OutSettlementValueSubcontract::getSettlementValue,
|
||||||
|
BigDecimal::add
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
BigDecimal expensesAmount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
for (String contractCode : expenseGroupedByContract.keySet()) {
|
||||||
|
CtrExpensesContract contract = expensesContractService.getOne(Wrappers.lambdaQuery(CtrExpensesContract.class)
|
||||||
|
.eq(CtrExpensesContract::getContractCode, contractCode)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
|
||||||
|
if (contract != null && contract.getPayRatio() != null) {
|
||||||
|
expensesAmount = expensesAmount.add(expenseGroupedByContract.get(contractCode).multiply(contract.getPayRatio()).setScale(4, RoundingMode.HALF_UP).divide(HUNDRED));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MoneyMonthVo monthData = new MoneyMonthVo(
|
||||||
|
yearMonth.toString(),
|
||||||
|
incomeAmount,
|
||||||
|
expensesAmount,
|
||||||
|
incomeAmount.subtract(expensesAmount)
|
||||||
|
);
|
||||||
|
|
||||||
|
moneyCostVos.add(monthData);
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(moneyCostVos);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金流总和
|
||||||
|
*/
|
||||||
|
@GetMapping("/cashTotal")
|
||||||
|
public R<MoneyCashVo> cashTotal() {
|
||||||
|
MoneyCashVo moneyCashVo = new MoneyCashVo();
|
||||||
|
List<OutSettlementValueOwner> ownerList = settlementValueOwnerService.list();
|
||||||
|
|
||||||
|
BigDecimal incomeCash = ownerList.stream()
|
||||||
|
.map(OutSettlementValueOwner::getSettlementValue)
|
||||||
|
.filter(java.util.Objects::nonNull) // 过滤掉 null 值
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
List<OutSettlementValueSubcontract> subcontractList = settlementValueSubcontractService.list();
|
||||||
|
|
||||||
|
BigDecimal expensesCash = subcontractList.stream()
|
||||||
|
.map(OutSettlementValueSubcontract::getSettlementValue)
|
||||||
|
.filter(java.util.Objects::nonNull) // 过滤掉 null 值
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
moneyCashVo.setIncomeCash(incomeCash);
|
||||||
|
moneyCashVo.setExpensesCash(expensesCash);
|
||||||
|
moneyCashVo.setProfitCash(incomeCash.subtract(expensesCash));
|
||||||
|
|
||||||
|
return R.ok(moneyCashVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前月份的开始时间和结束时间
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Map<String, LocalDate> getMonthStartAndEnd() {
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
LocalDate start = now.with(TemporalAdjusters.firstDayOfMonth());
|
||||||
|
LocalDate end = now.with(TemporalAdjusters.lastDayOfMonth());
|
||||||
|
return new HashMap<String, LocalDate>() {{
|
||||||
|
put("start", start);
|
||||||
|
put("end", end);
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目天气
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:weather")
|
||||||
|
@GetMapping("/weather/{projectId}")
|
||||||
|
public R<List<WeatherVo>> getProjectWeather(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
return R.ok(moneyBigScreenService.getProjectWeather(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目安全天数
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:safetyDay")
|
||||||
|
@GetMapping("/safetyDay/{projectId}")
|
||||||
|
public R<BusProjectSafetyDayVo> getProjectSafetyDay(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
return R.ok(moneyBigScreenService.getProjectSafetyDay(projectId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,486 @@
|
|||||||
package org.dromara.bigscreen.controller;
|
package org.dromara.bigscreen.controller;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.dromara.bigscreen.domain.*;
|
||||||
|
import org.dromara.bigscreen.domain.vo.*;
|
||||||
|
import org.dromara.bigscreen.mapper.ProjectBigScreenMapper;
|
||||||
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
||||||
|
import org.dromara.common.core.domain.R;
|
||||||
|
import org.dromara.common.core.utils.DateUtils;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.utils.BigDecimalUtil;
|
||||||
|
import org.dromara.gps.domain.bo.GpsEquipmentBo;
|
||||||
|
import org.dromara.gps.domain.vo.GpsEquipmentSonVo;
|
||||||
|
import org.dromara.gps.service.IGpsEquipmentService;
|
||||||
|
import org.dromara.land.domain.BusLandBlock;
|
||||||
|
import org.dromara.land.domain.BusLandTransferLedger;
|
||||||
|
import org.dromara.land.service.IBusLandBlockService;
|
||||||
|
import org.dromara.land.service.IBusLandTransferLedgerService;
|
||||||
|
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||||
|
import org.dromara.other.service.IOthYs7DeviceService;
|
||||||
|
import org.dromara.project.domain.BusProject;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo;
|
||||||
|
import org.dromara.project.domain.vo.projectnews.BusProjectNewsVo;
|
||||||
|
import org.dromara.project.service.IBusProjectService;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 项目级大屏
|
||||||
|
*
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-08-21 14:27
|
* @date 2025-08-21 14:27
|
||||||
*/
|
*/
|
||||||
@Validated
|
@Validated
|
||||||
@RestController
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/project/big/screen")
|
@RequestMapping("/project/big/screen")
|
||||||
public class ProjectBigScreenController {
|
public class ProjectBigScreenController {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ProjectBigScreenService projectBigScreenService;
|
private ProjectBigScreenService projectBigScreenService;
|
||||||
|
|
||||||
|
private final IBusLandTransferLedgerService busLandTransferLedgerService;
|
||||||
|
|
||||||
// @GetMapping("/{projectId}")
|
private final IBusLandBlockService busLandBlockService;
|
||||||
// public R<BusBiddingPlanAnnexVo> getInfo(@NotNull(message = "主键不能为空")
|
|
||||||
// @PathVariable Long id) {
|
private final IGpsEquipmentService gpsEquipmentService;
|
||||||
// return R.ok(busBiddingPlanAnnexService.queryById(id));
|
|
||||||
// }
|
private final IOthYs7DeviceService othYs7DeviceService;
|
||||||
|
|
||||||
|
private final ProjectBigScreenMapper projectBigScreenMapper;
|
||||||
|
|
||||||
|
private final IBusProjectService projectService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目土地统计
|
||||||
|
*/
|
||||||
|
@GetMapping("/{projectId}")
|
||||||
|
public R<List<ProjectLandVo>> landCount(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
List<BusLandTransferLedger> levelList = busLandTransferLedgerService.list(Wrappers.lambdaQuery(BusLandTransferLedger.class)
|
||||||
|
.eq(BusLandTransferLedger::getProjectId, projectId));
|
||||||
|
|
||||||
|
// 根据 landBlockId 分组,并对 designArea 和 transferAea 进行求和
|
||||||
|
Map<Long, Map<String, BigDecimal>> groupedResult = levelList.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
BusLandTransferLedger::getLandBlockId, // 按 landBlockId 分组
|
||||||
|
Collectors.collectingAndThen(
|
||||||
|
Collectors.toList(),
|
||||||
|
list -> {
|
||||||
|
BigDecimal designAreaSum = list.stream()
|
||||||
|
.map(BusLandTransferLedger::getDesignArea)
|
||||||
|
.filter(java.util.Objects::nonNull)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
BigDecimal transferAreaSum = list.stream()
|
||||||
|
.map(BusLandTransferLedger::getTransferAea)
|
||||||
|
.filter(java.util.Objects::nonNull)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
|
||||||
|
// 返回一个包含两个求和结果的 Map
|
||||||
|
return Map.of(
|
||||||
|
"designArea", designAreaSum,
|
||||||
|
"transferArea", transferAreaSum
|
||||||
|
);
|
||||||
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
List<ProjectLandVo> result = new ArrayList<>();
|
||||||
|
for (Long landBlockId : groupedResult.keySet()) {
|
||||||
|
ProjectLandVo projectLandVo = new ProjectLandVo();
|
||||||
|
BusLandBlock landBlock = busLandBlockService.getById(landBlockId);
|
||||||
|
projectLandVo.setLandName(landBlock.getLandName());
|
||||||
|
projectLandVo.setTransferArea(groupedResult.get(landBlockId).get("transferArea"));
|
||||||
|
projectLandVo.setDesignArea(groupedResult.get(landBlockId).get("designArea"));
|
||||||
|
|
||||||
|
result.add(projectLandVo);
|
||||||
|
}
|
||||||
|
return R.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目天气
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:weather")
|
||||||
|
@GetMapping("/weather/{projectId}")
|
||||||
|
public R<List<WeatherVo>> getProjectWeather(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
return R.ok(projectBigScreenService.getProjectWeather(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目安全天数
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:safetyDay")
|
||||||
|
@GetMapping("/safetyDay/{projectId}")
|
||||||
|
public R<BusProjectSafetyDayVo> getProjectSafetyDay(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
return R.ok(projectBigScreenService.getProjectSafetyDay(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目公告
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:news")
|
||||||
|
@GetMapping("/news/{projectId}")
|
||||||
|
public R<List<BusProjectNewsVo>> getProjectNews(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
List<BusCorporateEvents> busCorporateEvents = projectBigScreenMapper.getBusCorporateEvents();
|
||||||
|
return R.ok(busCorporateEvents.stream().map(event -> {
|
||||||
|
BusProjectNewsVo vo = new BusProjectNewsVo();
|
||||||
|
vo.setId(event.getId());
|
||||||
|
vo.setTitle(event.getHeadline());
|
||||||
|
vo.setContent(event.getContent());
|
||||||
|
return vo;
|
||||||
|
}).toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目AI安全巡检
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:safetyInspection")
|
||||||
|
@GetMapping("/safetyInspection/{projectId}")
|
||||||
|
public R<List<ProjectSafetyInspectionVo>> getProjectSafetyInspection(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
/* BusProject project = projectService.getById(projectId);
|
||||||
|
projectId = project.getGoId();
|
||||||
|
String pic;
|
||||||
|
if (projectId == 60) {
|
||||||
|
pic = "http://xny.yj-3d.com:7464";
|
||||||
|
} else {
|
||||||
|
pic = "http://xny.yj-3d.com:7363";
|
||||||
|
}
|
||||||
|
List<BusTour> busTours = projectBigScreenMapper.selectTourByProjectId(projectId);
|
||||||
|
return R.ok(busTours.stream().map(tour -> {
|
||||||
|
ProjectSafetyInspectionVo vo = new ProjectSafetyInspectionVo();
|
||||||
|
vo.setId(tour.getId());
|
||||||
|
vo.setViolationType(tour.getTourType());
|
||||||
|
vo.setPicture(pic + tour.getPicture());
|
||||||
|
vo.setCreateTime(tour.getCreatedAt());
|
||||||
|
return vo;
|
||||||
|
}).toList());*/
|
||||||
|
return R.ok(projectBigScreenService.getProjectSafetyInspection(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目人员情况
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:people")
|
||||||
|
@GetMapping("/people/{projectId}")
|
||||||
|
public R<ProjectPeopleVo> getProjectPeople(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
BusProject project = projectService.getById(projectId);
|
||||||
|
projectId = project.getGoId();
|
||||||
|
Integer projectUserCount = projectBigScreenMapper.getProjectUserCount(projectId);
|
||||||
|
ProjectPeopleVo vo = new ProjectPeopleVo();
|
||||||
|
vo.setPeopleCount(BigDecimal.valueOf(projectUserCount));
|
||||||
|
Integer attendanceCount = projectBigScreenMapper.getAttendanceCount(projectId, DateUtils.getDate());
|
||||||
|
vo.setAttendanceCount(BigDecimal.valueOf(attendanceCount));
|
||||||
|
vo.setAttendanceRate(BigDecimalUtil.toPercentage(BigDecimal.valueOf(attendanceCount), BigDecimal.valueOf(projectUserCount)));
|
||||||
|
List<BusConstructionUser> projectUserList = projectBigScreenMapper.getProjectUserList(projectId);
|
||||||
|
List<BusProjectTeamByGo> teamList = projectBigScreenMapper.getTeamList(projectId);
|
||||||
|
|
||||||
|
List<ProjectTeamAttendanceVo> teamAttendanceList = new ArrayList<>();
|
||||||
|
String punchRange = project.getPunchRange();
|
||||||
|
String punchTime = "";
|
||||||
|
if (punchRange != null) {
|
||||||
|
String start = punchRange.split(",")[0];
|
||||||
|
punchTime = LocalDate.now() + " " + start;
|
||||||
|
}
|
||||||
|
if (projectUserList != null && teamList != null) {
|
||||||
|
projectUserList = projectUserList.stream().filter(user -> user.getTeamId() != null).toList();
|
||||||
|
Map<Long, List<BusConstructionUser>> userMap = projectUserList.stream()
|
||||||
|
.collect(Collectors.groupingBy(BusConstructionUser::getTeamId));
|
||||||
|
for (BusProjectTeamByGo team : teamList) {
|
||||||
|
ProjectTeamAttendanceVo vo1 = new ProjectTeamAttendanceVo();
|
||||||
|
vo1.setId(team.getId());
|
||||||
|
vo1.setTeamName(team.getName());
|
||||||
|
vo1.setAttendanceTime(punchTime);
|
||||||
|
vo1.setAttendanceNumber(BigDecimal.ZERO);
|
||||||
|
List<BusConstructionUser> userList = userMap.get(team.getId());
|
||||||
|
if (CollUtil.isNotEmpty(userList)) {
|
||||||
|
List<String> list = userList.stream().map(BusConstructionUser::getOpenid).distinct().toList();
|
||||||
|
Integer aCount = projectBigScreenMapper.getAttendanceCountByOpenIds(list, LocalDate.now());
|
||||||
|
vo1.setAttendanceNumber(BigDecimal.valueOf(aCount));
|
||||||
|
}
|
||||||
|
vo1.setAllNumber(BigDecimal.valueOf(userMap.getOrDefault(team.getId(), List.of()).size()));
|
||||||
|
if (vo1.getAttendanceNumber() != null && vo1.getAllNumber() != null && vo1.getAllNumber().compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
vo1.setAttendanceRate(BigDecimalUtil.toPercentage(vo1.getAttendanceNumber(), vo1.getAllNumber()));
|
||||||
|
} else {
|
||||||
|
vo1.setAttendanceRate(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
teamAttendanceList.add(vo1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
vo.setTeamAttendanceList(teamAttendanceList);
|
||||||
|
return R.ok(vo);
|
||||||
|
// return R.ok(projectBigScreenService.getProjectPeople(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目形象进度
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:imageProgress")
|
||||||
|
@GetMapping("/imageProgress/{projectId}")
|
||||||
|
public R<ProjectImageProgressVo> getProjectImageProgress(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
return R.ok(projectBigScreenService.getProjectImageProgress(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询项目概括
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:generalize")
|
||||||
|
@GetMapping("/generalize/{projectId}")
|
||||||
|
public R<String> getProjectGeneralize(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
BusProject project = projectService.getById(projectId);
|
||||||
|
if (project != null) {
|
||||||
|
Long goId = project.getGoId();
|
||||||
|
if (goId != null) {
|
||||||
|
List<SysProjectIntroduce> sysProjectIntroduces = projectBigScreenMapper.selectByProjectId(goId);
|
||||||
|
if (CollUtil.isNotEmpty(sysProjectIntroduces)) {
|
||||||
|
return R.ok(sysProjectIntroduces.getFirst().getRichText());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// return R.ok(projectBigScreenService.getProjectGeneralize(projectId));
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:getClientList")
|
||||||
|
@GetMapping("/getClientList/{projectId}")
|
||||||
|
public R<List<Map<String, Object>>> getClientList(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long projectId) {
|
||||||
|
List<GpsEquipmentSonVo> voList = gpsEquipmentService.getClientList(projectId);
|
||||||
|
// List<OthYs7Device> othYs7DeviceList = othYs7DeviceService.lambdaQuery()
|
||||||
|
// .eq(OthYs7Device::getProjectId, projectId)
|
||||||
|
// .list();
|
||||||
|
List<Map<String, Object>> maps = new ArrayList<>();
|
||||||
|
Map<String, Object> gpsMap = new HashMap<>();
|
||||||
|
Map<String, Object> wrjMap = new HashMap<>();
|
||||||
|
Map<String, Object> sxtMap = new HashMap<>();
|
||||||
|
List<Map<String, Object>> gpsChildrenMap = new ArrayList<>();
|
||||||
|
// List<Map<String, Object>> wrjChildrenMap = new ArrayList<>();
|
||||||
|
// List<Map<String, Object>> sxtChildrenMap = new ArrayList<>();
|
||||||
|
if (voList != null && !voList.isEmpty()) {
|
||||||
|
for (GpsEquipmentSonVo item : voList) {
|
||||||
|
Map<String, Object> gps = new HashMap<>();
|
||||||
|
gps.put("id", item.getClientId());
|
||||||
|
gps.put("label", item.getClientId());
|
||||||
|
gps.put("name", item.getDeviceName());
|
||||||
|
gps.put("type", "positioningDevice");
|
||||||
|
gps.put("lat", item.getLocLatitude());
|
||||||
|
gps.put("lng", item.getLocLongitude());
|
||||||
|
gps.put("alt", item.getLocAltitude());
|
||||||
|
gpsChildrenMap.add(gps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// if (othYs7DeviceList != null && !othYs7DeviceList.isEmpty()) {
|
||||||
|
// for (OthYs7Device item : othYs7DeviceList) {
|
||||||
|
// Map<String, Object> sxt = new HashMap<>();
|
||||||
|
// sxt.put("id", item.getDeviceSerial());
|
||||||
|
// sxt.put("label", item.getDeviceSerial());
|
||||||
|
// sxt.put("name", item.getDeviceName());
|
||||||
|
// sxt.put("type", "shexiangtou");
|
||||||
|
//// sxt.put("lat", item.getLocLatitude());
|
||||||
|
//// sxt.put("lng", item.getLocLongitude());
|
||||||
|
//// sxt.put("alt", item.getLocAltitude());
|
||||||
|
// sxtChildrenMap.add(sxt);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
List<Map<String, Object>> maps1 = setSxt();
|
||||||
|
List<Map<String, Object>> maps2 = setWrj();
|
||||||
|
|
||||||
|
gpsMap.put("id", 1);
|
||||||
|
gpsMap.put("label", "定位设备");
|
||||||
|
gpsMap.put("children", gpsChildrenMap);
|
||||||
|
sxtMap.put("id", 2);
|
||||||
|
sxtMap.put("label", "摄像头");
|
||||||
|
// sxtMap.put("children",sxtChildrenMap);
|
||||||
|
sxtMap.put("children", maps1);
|
||||||
|
wrjMap.put("id", 3);
|
||||||
|
wrjMap.put("label", "无人机");
|
||||||
|
// wrjMap.put("children",wrjChildrenMap);
|
||||||
|
wrjMap.put("children", maps2);
|
||||||
|
|
||||||
|
|
||||||
|
maps.add(gpsMap);
|
||||||
|
maps.add(wrjMap);
|
||||||
|
maps.add(sxtMap);
|
||||||
|
return R.ok(maps);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询GPS设备用户列表
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:getList")
|
||||||
|
@GetMapping("/getList")
|
||||||
|
public R<List<String>> getList(Long projectId) {
|
||||||
|
return R.ok(projectBigScreenService.getList(projectId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增GPS设备详细
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("project:bigScreen:setList")
|
||||||
|
@Log(title = "GPS设备详细", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping("/setList")
|
||||||
|
public void setList(@RequestBody GpsEquipmentBo bo) {
|
||||||
|
projectBigScreenService.setList(bo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Map<String, Object>> setSxt() {
|
||||||
|
List<Map<String, Object>> sxtChildrenMap = new ArrayList<>();
|
||||||
|
HashMap<String, Object> map1 = new HashMap<>();
|
||||||
|
map1.put("id", "55");
|
||||||
|
map1.put("label", "那荷4号方阵-1");
|
||||||
|
map1.put("name", "22");
|
||||||
|
map1.put("type", "camera");
|
||||||
|
map1.put("lng", 107.111325);
|
||||||
|
map1.put("lat", 23.820919);
|
||||||
|
map1.put("alt", 0);
|
||||||
|
HashMap<String, Object> map2 = new HashMap<>();
|
||||||
|
map2.put("id", "56");
|
||||||
|
map2.put("label", "甫必 1号方阵");
|
||||||
|
map2.put("name", "23");
|
||||||
|
map2.put("type", "camera");
|
||||||
|
map2.put("lng", 107.091297);
|
||||||
|
map2.put("lat", 23.813567);
|
||||||
|
map2.put("alt", 0);
|
||||||
|
HashMap<String, Object> map3 = new HashMap<>();
|
||||||
|
map3.put("id", "57");
|
||||||
|
map3.put("label", "1222224");
|
||||||
|
map3.put("name", "24");
|
||||||
|
map3.put("type", "camera");
|
||||||
|
map3.put("lng", 107.085442);
|
||||||
|
map3.put("lat", 23.811958);
|
||||||
|
map3.put("alt", 0);
|
||||||
|
HashMap<String, Object> map4 = new HashMap<>();
|
||||||
|
map4.put("id", "58");
|
||||||
|
map4.put("label", "甫必2号方阵-1");
|
||||||
|
map4.put("name", "25");
|
||||||
|
map4.put("type", "camera");
|
||||||
|
map4.put("lng", 107.085181);
|
||||||
|
map4.put("lat", 23.810556);
|
||||||
|
map4.put("alt", 0);
|
||||||
|
HashMap<String, Object> map5 = new HashMap<>();
|
||||||
|
map5.put("id", "58");
|
||||||
|
map5.put("label", "甫必 4号方阵");
|
||||||
|
map5.put("name", "25");
|
||||||
|
map5.put("type", "camera");
|
||||||
|
map5.put("lng", 107.081747);
|
||||||
|
map5.put("lat", 23.808131);
|
||||||
|
map5.put("alt", 0);
|
||||||
|
HashMap<String, Object> map6 = new HashMap<>();
|
||||||
|
map6.put("id", "58");
|
||||||
|
map6.put("label", "甫必 7号方阵-1");
|
||||||
|
map6.put("name", "25");
|
||||||
|
map6.put("type", "camera");
|
||||||
|
map6.put("lng", 107.077922);
|
||||||
|
map6.put("lat", 23.798344);
|
||||||
|
map6.put("alt", 0);
|
||||||
|
HashMap<String, Object> map7 = new HashMap<>();
|
||||||
|
map7.put("id", "58");
|
||||||
|
map7.put("label", "68甫必6");
|
||||||
|
map7.put("name", "25");
|
||||||
|
map7.put("type", "camera");
|
||||||
|
map7.put("lng", 107.077333);
|
||||||
|
map7.put("lat", 23.797969);
|
||||||
|
map7.put("alt", 0);
|
||||||
|
HashMap<String, Object> map8 = new HashMap<>();
|
||||||
|
map8.put("id", "58");
|
||||||
|
map8.put("label", "甫必5号方阵");
|
||||||
|
map8.put("name", "25");
|
||||||
|
map8.put("type", "camera");
|
||||||
|
map8.put("lng", 107.075853);
|
||||||
|
map8.put("lat", 23.796711);
|
||||||
|
map8.put("alt", 0);
|
||||||
|
HashMap<String, Object> map9 = new HashMap<>();
|
||||||
|
map9.put("id", "58");
|
||||||
|
map9.put("label", "西牛2号方阵");
|
||||||
|
map9.put("name", "25");
|
||||||
|
map9.put("type", "camera");
|
||||||
|
map9.put("lng", 107.078942);
|
||||||
|
map9.put("lat", 23.789306);
|
||||||
|
map9.put("alt", 0);
|
||||||
|
HashMap<String, Object> map10 = new HashMap<>();
|
||||||
|
map10.put("id", "58");
|
||||||
|
map10.put("label", "福绿1号方阵");
|
||||||
|
map10.put("name", "25");
|
||||||
|
map10.put("type", "camera");
|
||||||
|
map10.put("lng", 107.090061);
|
||||||
|
map10.put("lat", 23.790411);
|
||||||
|
map10.put("alt", 0);
|
||||||
|
HashMap<String, Object> map11 = new HashMap<>();
|
||||||
|
map11.put("id", "58");
|
||||||
|
map11.put("label", "福绿6号方阵-2");
|
||||||
|
map11.put("name", "25");
|
||||||
|
map11.put("type", "camera");
|
||||||
|
map11.put("lng", 107.112883);
|
||||||
|
map11.put("lat", 23.771378);
|
||||||
|
map11.put("alt", 0);
|
||||||
|
|
||||||
|
sxtChildrenMap.add(map1);
|
||||||
|
sxtChildrenMap.add(map2);
|
||||||
|
sxtChildrenMap.add(map3);
|
||||||
|
sxtChildrenMap.add(map4);
|
||||||
|
sxtChildrenMap.add(map5);
|
||||||
|
sxtChildrenMap.add(map6);
|
||||||
|
sxtChildrenMap.add(map7);
|
||||||
|
sxtChildrenMap.add(map8);
|
||||||
|
sxtChildrenMap.add(map9);
|
||||||
|
sxtChildrenMap.add(map10);
|
||||||
|
sxtChildrenMap.add(map11);
|
||||||
|
|
||||||
|
return sxtChildrenMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Map<String, Object>> setWrj() {
|
||||||
|
List<Map<String, Object>> sxtChildrenMap = new ArrayList<>();
|
||||||
|
HashMap<String, Object> map1 = new HashMap<>();
|
||||||
|
map1.put("id", "65");
|
||||||
|
map1.put("label", "田东无人机");
|
||||||
|
map1.put("name", "32");
|
||||||
|
map1.put("type", "drone");
|
||||||
|
map1.put("lng", 107.12744694624267);
|
||||||
|
map1.put("lat", 23.615965741917278);
|
||||||
|
map1.put("alt", 0);
|
||||||
|
// HashMap<String, Object> map2 = new HashMap<>();
|
||||||
|
// map2.put("id", "66");
|
||||||
|
// map2.put("label", "长顺无人机");
|
||||||
|
// map2.put("name", "33");
|
||||||
|
// map2.put("type", "drone");
|
||||||
|
// map2.put("lng", 106.49142431645038);
|
||||||
|
// map2.put("lat", 29.534472802500083);
|
||||||
|
// map2.put("alt", 0);
|
||||||
|
sxtChildrenMap.add(map1);
|
||||||
|
// sxtChildrenMap.add(map2);
|
||||||
|
|
||||||
|
return sxtChildrenMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,58 @@
|
|||||||
|
package org.dromara.bigscreen.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusAttendanceByGo {
|
||||||
|
|
||||||
|
private Long id; // 主键ID
|
||||||
|
|
||||||
|
private String userName; // 人员姓名
|
||||||
|
|
||||||
|
private String pacePhoto; // 人脸照
|
||||||
|
|
||||||
|
private Long projectId; // 项目id
|
||||||
|
|
||||||
|
private String createBy; // 创建者
|
||||||
|
|
||||||
|
private String updateBy; // 更新者
|
||||||
|
|
||||||
|
private LocalDateTime createdAt; // 创建时间
|
||||||
|
|
||||||
|
private LocalDateTime updatedAt; // 更新时间
|
||||||
|
|
||||||
|
private LocalDateTime deletedAt; // 删除时间
|
||||||
|
|
||||||
|
private String clockOn; // 上午打卡
|
||||||
|
|
||||||
|
private String clockOff; // 下午打卡
|
||||||
|
|
||||||
|
private String printingDate; // 年月日打卡时间
|
||||||
|
|
||||||
|
private String isPinch; // 1正常,2迟到,3早退,4缺勤,5补卡
|
||||||
|
|
||||||
|
private String openid; // 微信id
|
||||||
|
|
||||||
|
private String pinchOpenId; // 代打id
|
||||||
|
|
||||||
|
private String clockRecord; // 多次打卡时间记录
|
||||||
|
|
||||||
|
private String pinchUserName; // 代打人姓名
|
||||||
|
|
||||||
|
private String commuter; // 上下班(1上班 2下班)
|
||||||
|
|
||||||
|
private String punchRange; // 打卡范围
|
||||||
|
|
||||||
|
private BigDecimal dailyWage; // 日薪
|
||||||
|
|
||||||
|
private String lng; // 经度
|
||||||
|
|
||||||
|
private String lat; // 纬度
|
||||||
|
|
||||||
|
private String location; // 逆编码地址信息
|
||||||
|
|
||||||
|
private LocalDateTime missing; // 缺卡统一处理时间
|
||||||
|
}
|
@ -0,0 +1,91 @@
|
|||||||
|
package org.dromara.bigscreen.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("bus_construction_user")
|
||||||
|
public class BusConstructionUser {
|
||||||
|
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id; // 主键ID
|
||||||
|
|
||||||
|
private String openid; // 微信id
|
||||||
|
|
||||||
|
private String nickName; // 微信名称
|
||||||
|
|
||||||
|
private Long teamId; // 班组id
|
||||||
|
|
||||||
|
private String headIcon; // 登陆照片
|
||||||
|
|
||||||
|
private String pacePhoto; // 人脸照
|
||||||
|
|
||||||
|
private String userName; // 人员姓名
|
||||||
|
|
||||||
|
private Long projectId; // 项目id
|
||||||
|
|
||||||
|
private String status; // 状态(0在职 1离职)-字典position_status
|
||||||
|
|
||||||
|
private String isPinch; // 是否代打
|
||||||
|
|
||||||
|
private String ifManagement; // 是否班组管理
|
||||||
|
|
||||||
|
private String createBy; // 创建者
|
||||||
|
|
||||||
|
private String updateBy; // 更新者
|
||||||
|
|
||||||
|
private LocalDateTime createdAt; // 创建时间
|
||||||
|
|
||||||
|
private LocalDateTime updatedAt; // 更新时间
|
||||||
|
|
||||||
|
private LocalDateTime deletedAt; // 删除时间
|
||||||
|
|
||||||
|
private String phone; // 电话
|
||||||
|
|
||||||
|
private String sex; // 1:男,2女,3保密
|
||||||
|
|
||||||
|
private String sfzNation; // 身份证民族
|
||||||
|
|
||||||
|
private String sfzNumber; // 身份证号码
|
||||||
|
|
||||||
|
private String sfzStart; // 身份证有效开始期
|
||||||
|
|
||||||
|
private String sfzEnd; // 身份证有效结束期
|
||||||
|
|
||||||
|
private String sfzSite; // 身份证地址
|
||||||
|
|
||||||
|
private String sfzBirth; // 身份证出生日期
|
||||||
|
|
||||||
|
private String nativePlace; // 籍贯
|
||||||
|
|
||||||
|
private String yhkNumber; // 银行卡号
|
||||||
|
|
||||||
|
private String yhkOpeningBank; // 开户行
|
||||||
|
|
||||||
|
private String yhkCardholder; // 持卡人
|
||||||
|
|
||||||
|
private String typeOfWork; // 工种(字典)
|
||||||
|
|
||||||
|
private String clock; // 打卡(1启用打卡 2禁止打卡)
|
||||||
|
|
||||||
|
private Long labourserviceId; // 劳务公司id
|
||||||
|
|
||||||
|
private String entryDate; // 入场时间
|
||||||
|
|
||||||
|
private String leaveDate; // 离场时间
|
||||||
|
|
||||||
|
private BigDecimal salary; // 薪水(为0表示无效)
|
||||||
|
|
||||||
|
private String projectRecord; // 是否开启项目备案(1开启 2不开启)
|
||||||
|
|
||||||
|
private String wxOrPc; // 哪添加的(1表示pc 2表示小程序)
|
||||||
|
|
||||||
|
private String subscription; // 消息订阅状态(1订阅 2无订阅)
|
||||||
|
|
||||||
|
private String devNum; // 安全帽设备标识
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package org.dromara.bigscreen.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业大事记
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("bus_corporate_events")
|
||||||
|
public class BusCorporateEvents {
|
||||||
|
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标题
|
||||||
|
*/
|
||||||
|
private String headline;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private Long createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
private Long updatedBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime updatedAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除时间(软删除标记)
|
||||||
|
*/
|
||||||
|
private LocalDateTime deletedAt;
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package org.dromara.bigscreen.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusProjectTeamByGo {
|
||||||
|
|
||||||
|
private Long id; // 主键id
|
||||||
|
|
||||||
|
private Long projectId; // 项目id
|
||||||
|
|
||||||
|
private String name; // 班组名称
|
||||||
|
|
||||||
|
private String isClockIn; // 范围内打卡(0范围内打卡 1任何地点打卡)
|
||||||
|
|
||||||
|
private String punchRange; // 打卡范围(id串)
|
||||||
|
|
||||||
|
private String remark; // 备注
|
||||||
|
|
||||||
|
private String createBy; // 创建者
|
||||||
|
|
||||||
|
private String updateBy; // 更新者
|
||||||
|
|
||||||
|
private Long createDept; // 创建部门
|
||||||
|
|
||||||
|
private LocalDateTime createTime; // 创建时间
|
||||||
|
|
||||||
|
private LocalDateTime updateTime; // 更新时间
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package org.dromara.bigscreen.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusProjectTeamMemberByGo {
|
||||||
|
|
||||||
|
private Long id; // 主键id
|
||||||
|
|
||||||
|
private Long teamId; // 班组id
|
||||||
|
|
||||||
|
private Long projectId; // 项目id
|
||||||
|
|
||||||
|
private Long memberId; // 施工人员id
|
||||||
|
|
||||||
|
private String postId; // 岗位(0普通员工,1组长)
|
||||||
|
|
||||||
|
private String remark; // 备注
|
||||||
|
|
||||||
|
private LocalDateTime createTime; // 创建时间
|
||||||
|
|
||||||
|
private LocalDateTime updateTime; // 更新时间
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package org.dromara.bigscreen.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class BusTour {
|
||||||
|
|
||||||
|
private Long id; // 主键ID
|
||||||
|
|
||||||
|
private Long projectId; // 项目id
|
||||||
|
|
||||||
|
private String tourCategory; // 类别字典(如:无人机识别、监控拍摄)
|
||||||
|
|
||||||
|
private String tourType; // 类型字典(如:安全帽、安全带)
|
||||||
|
|
||||||
|
private String picture; // 图片路径
|
||||||
|
|
||||||
|
private Integer num; // 违规数量
|
||||||
|
|
||||||
|
private String describe; // 故障描述
|
||||||
|
|
||||||
|
private Date createdAt; // 创建时间
|
||||||
|
|
||||||
|
private Date updatedAt; // 更新时间
|
||||||
|
|
||||||
|
private Date deletedAt; // 删除时间
|
||||||
|
|
||||||
|
private String tableName; // 表名
|
||||||
|
|
||||||
|
private Long tableId; // 表id
|
||||||
|
|
||||||
|
private String sxtName; // 摄像头名称
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package org.dromara.bigscreen.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("sys_project_introduce")
|
||||||
|
public class SysProjectIntroduce {
|
||||||
|
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id; // 主键id
|
||||||
|
|
||||||
|
private Long projectId; // 项目id
|
||||||
|
|
||||||
|
private String headline; // 标题
|
||||||
|
|
||||||
|
private String richText; // 富文本
|
||||||
|
|
||||||
|
private String createdBy; // 创建人
|
||||||
|
|
||||||
|
private String updatedBy; // 更新人
|
||||||
|
|
||||||
|
private LocalDateTime createdAt; // 创建时间
|
||||||
|
|
||||||
|
private LocalDateTime updatedAt; // 更新时间
|
||||||
|
|
||||||
|
private LocalDateTime deletedAt; // 删除时间
|
||||||
|
|
||||||
|
private String files; // 附件
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package org.dromara.bigscreen.domain.dto;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 15:16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class WeatherQueryReq implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -2550570761981859666L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "经度不能为空")
|
||||||
|
private String lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "纬度不能为空")
|
||||||
|
private String lat;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 15:59
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EnterpriseKeyIndexVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -3987781906203623727L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 光伏项目数量
|
||||||
|
*/
|
||||||
|
private Integer photovoltaicCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风电项目数量
|
||||||
|
*/
|
||||||
|
private Integer windElectricityCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 光伏项目总容量
|
||||||
|
*/
|
||||||
|
private BigDecimal photovoltaicTotalCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风电项目总容量
|
||||||
|
*/
|
||||||
|
private BigDecimal windElectricityTotalCapacity;
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MoneyCashVo {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金流入
|
||||||
|
*/
|
||||||
|
private BigDecimal incomeCash ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现金流出
|
||||||
|
*/
|
||||||
|
private BigDecimal expensesCash ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 净现金
|
||||||
|
*/
|
||||||
|
private BigDecimal profitCash ;
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MoneyContractCountVo {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 100W以下
|
||||||
|
*/
|
||||||
|
private Integer firstCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 100W-500W
|
||||||
|
*/
|
||||||
|
private Integer secondCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 500W-1000W
|
||||||
|
*/
|
||||||
|
private Integer thirdCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1000W以上
|
||||||
|
*/
|
||||||
|
private Integer fourthCount;
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MoneyCostVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 材料
|
||||||
|
*/
|
||||||
|
private BigDecimal materialCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包
|
||||||
|
*/
|
||||||
|
private BigDecimal subcontractCost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 劳务
|
||||||
|
*/
|
||||||
|
private BigDecimal LaborCost;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理
|
||||||
|
*/
|
||||||
|
private BigDecimal manageCost;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MoneyMonthVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 月份
|
||||||
|
*/
|
||||||
|
private String month;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收入
|
||||||
|
*/
|
||||||
|
private BigDecimal incomeAmount ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支出
|
||||||
|
*/
|
||||||
|
private BigDecimal expensesAmount ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 净现金
|
||||||
|
*/
|
||||||
|
private BigDecimal profitAmount ;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付KPI
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MoneyPayVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收
|
||||||
|
*/
|
||||||
|
private BigDecimal planAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实收
|
||||||
|
*/
|
||||||
|
private BigDecimal actualAmount;
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MoneyTotalAmountVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收入总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal incomeTotalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支出总金额
|
||||||
|
*/
|
||||||
|
private BigDecimal expensesTotalAmount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 利润
|
||||||
|
*/
|
||||||
|
private BigDecimal profitAmount;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工程变更
|
||||||
|
*/
|
||||||
|
private BigDecimal changeAmount;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 19:12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OutputValueComparisonVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -6902563869975528076L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划产值
|
||||||
|
*/
|
||||||
|
private BigDecimal planValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实际产值
|
||||||
|
*/
|
||||||
|
private BigDecimal actualValue;
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PeopleCountVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 施工人员
|
||||||
|
*/
|
||||||
|
private Long constructionPersonnelCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分包人员
|
||||||
|
*/
|
||||||
|
private Long SubcontractorsCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理人员
|
||||||
|
*/
|
||||||
|
private Long managersCount;
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 16:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PeopleOverviewVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -4353811031023888101L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出勤人数
|
||||||
|
*/
|
||||||
|
private Long attendanceNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出勤率
|
||||||
|
*/
|
||||||
|
private BigDecimal attendanceRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 施工人员数量
|
||||||
|
*/
|
||||||
|
private Long constructorNumber;
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProjectAttendanceCountVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤人数
|
||||||
|
*/
|
||||||
|
private Long attendanceCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤率
|
||||||
|
*/
|
||||||
|
private Double attendanceRate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-08-22 20:05
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProjectImageProgressVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 7963637133004484891L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 场区百分比
|
||||||
|
*/
|
||||||
|
private BigDecimal areaPercentage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 道路百分比
|
||||||
|
*/
|
||||||
|
private BigDecimal roadPercentage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 集电线路百分比
|
||||||
|
*/
|
||||||
|
private BigDecimal collectorLinePercentage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 送出线路百分比
|
||||||
|
*/
|
||||||
|
private BigDecimal exportLinePercentage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 升压站百分比
|
||||||
|
*/
|
||||||
|
private BigDecimal substationPercentage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 箱变百分比
|
||||||
|
*/
|
||||||
|
private BigDecimal boxTransformerPercentage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总百分比
|
||||||
|
*/
|
||||||
|
private BigDecimal totalPercentage;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 土地流转
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProjectLandVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 土地名称
|
||||||
|
*/
|
||||||
|
private String landName;
|
||||||
|
/**
|
||||||
|
* 规划面积
|
||||||
|
*/
|
||||||
|
private BigDecimal designArea;
|
||||||
|
/**
|
||||||
|
* 流转面积
|
||||||
|
*/
|
||||||
|
private BigDecimal transferArea;
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-08-22 20:03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProjectPeopleVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -3169574372374491372L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 施工人员数量
|
||||||
|
*/
|
||||||
|
private BigDecimal peopleCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出勤人员数量
|
||||||
|
*/
|
||||||
|
private BigDecimal attendanceCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出勤率
|
||||||
|
*/
|
||||||
|
private BigDecimal attendanceRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组出勤信息
|
||||||
|
*/
|
||||||
|
private List<ProjectTeamAttendanceVo> teamAttendanceList;
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 16:51
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProjectProgressAnalysisVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -2170524608375159201L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 并网总容量 (MW)
|
||||||
|
*/
|
||||||
|
private BigDecimal gridConnectedCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划总容量 (MW)
|
||||||
|
*/
|
||||||
|
private BigDecimal plannedCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 延期项目数量
|
||||||
|
*/
|
||||||
|
private Integer delayedProjectCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目进度详情
|
||||||
|
*/
|
||||||
|
List<ProjectProgressDetailVo> projectProgressDetailList;
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-12 18:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProjectProgressCapacityVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = -7370580195063977801L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进度百分比
|
||||||
|
*/
|
||||||
|
private BigDecimal progressPercentage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计划容量
|
||||||
|
*/
|
||||||
|
private BigDecimal plannedCapacity;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 16:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ProjectProgressDetailVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目容量
|
||||||
|
*/
|
||||||
|
private BigDecimal projectCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 施工进度百分比 (0~100)
|
||||||
|
*/
|
||||||
|
private BigDecimal completionRate;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-08-22 19:58
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProjectSafetyInspectionVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 5077897258656815177L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 违章类型(多个逗号分隔)
|
||||||
|
*/
|
||||||
|
private String violationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片路径
|
||||||
|
*/
|
||||||
|
private String picture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-08-22 20:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ProjectTeamAttendanceVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组名称
|
||||||
|
*/
|
||||||
|
private String teamName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出勤人数
|
||||||
|
*/
|
||||||
|
private BigDecimal attendanceNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总人数
|
||||||
|
*/
|
||||||
|
private BigDecimal allNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出勤率
|
||||||
|
*/
|
||||||
|
private BigDecimal attendanceRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤时间
|
||||||
|
*/
|
||||||
|
private String attendanceTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 20:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class RiskEarlyWarningVo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 5250172770638676715L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间
|
||||||
|
*/
|
||||||
|
private LocalDate date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 风险类型
|
||||||
|
*/
|
||||||
|
private String riskType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报警内容
|
||||||
|
*/
|
||||||
|
private String alarmContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 威胁等级
|
||||||
|
*/
|
||||||
|
private String dangerLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来源
|
||||||
|
*/
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 告警等级
|
||||||
|
*/
|
||||||
|
private String alarmLevel;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package org.dromara.bigscreen.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TodayAttendanceCountVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 考勤人员数量
|
||||||
|
*/
|
||||||
|
private Long attendanceCount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出勤率
|
||||||
|
*/
|
||||||
|
private Double attendanceRate;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
package org.dromara.bigscreen.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
import org.dromara.bigscreen.domain.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-10 19:32
|
||||||
|
*/
|
||||||
|
@DS("slave")
|
||||||
|
@Mapper
|
||||||
|
public interface ProjectBigScreenMapper {
|
||||||
|
|
||||||
|
@Select("select * from bus_corporate_events limit 10")
|
||||||
|
List<BusCorporateEvents> getBusCorporateEvents();
|
||||||
|
|
||||||
|
@Select("select * from sys_project_introduce where project_id = #{projectId}")
|
||||||
|
List<SysProjectIntroduce> selectByProjectId(@Param("projectId") Long projectId);
|
||||||
|
|
||||||
|
@Select("select count(*) from bus_construction_user where project_id = #{projectId} && deleted_at is NULL")
|
||||||
|
Integer getProjectUserCount(@Param("projectId") Long projectId);
|
||||||
|
|
||||||
|
@Select("select count(*) from bus_construction_user where project_id in (60,59) && deleted_at is NULL")
|
||||||
|
Integer getUserCount();
|
||||||
|
|
||||||
|
@Select("select count(*) from bus_attendance where project_id = #{projectId} && printing_date = #{printingDate} && commuter = '1'")
|
||||||
|
Integer getAttendanceCount(@Param("projectId") Long projectId,
|
||||||
|
@Param("printingDate") String printingDate);
|
||||||
|
|
||||||
|
@Select("SELECT * FROM sys_project_team WHERE project_id = #{projectId} && deleted_at is NULL")
|
||||||
|
List<BusProjectTeamByGo> getTeamList(@Param("projectId") Long projectId);
|
||||||
|
|
||||||
|
@Select("SELECT * FROM bus_construction_user WHERE project_id = #{projectId} && deleted_at is NULL")
|
||||||
|
List<BusConstructionUser> getProjectUserList(@Param("projectId") Long projectId);
|
||||||
|
|
||||||
|
@Select({
|
||||||
|
"<script>",
|
||||||
|
"SELECT count(*) ",
|
||||||
|
"FROM bus_attendance ",
|
||||||
|
"WHERE openid IN ",
|
||||||
|
"<foreach collection='openIds' item='id' open='(' separator=',' close=')'>",
|
||||||
|
" #{id}",
|
||||||
|
"</foreach>",
|
||||||
|
"AND printing_date = #{printingDate} ",
|
||||||
|
"AND commuter = '1'",
|
||||||
|
"</script>"
|
||||||
|
})
|
||||||
|
Integer getAttendanceCountByOpenIds(@Param("openIds") List<String> openIds,
|
||||||
|
@Param("printingDate") LocalDate printingDate);
|
||||||
|
|
||||||
|
@Select("SELECT * FROM bus_tour WHERE project_id = #{projectId} AND deleted_at IS NULL LIMIT 10")
|
||||||
|
List<BusTour> selectTourByProjectId(@Param("projectId") Long projectId);
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package org.dromara.bigscreen.service;
|
||||||
|
|
||||||
|
import org.dromara.bigscreen.domain.dto.WeatherQueryReq;
|
||||||
|
import org.dromara.bigscreen.domain.vo.*;
|
||||||
|
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 15:31
|
||||||
|
*/
|
||||||
|
public interface EnterpriseBigScreenService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取关键指标
|
||||||
|
*
|
||||||
|
* @return 关键指标
|
||||||
|
*/
|
||||||
|
EnterpriseKeyIndexVo getEnterpriseKeyIndex();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目进度分析
|
||||||
|
*
|
||||||
|
* @return 项目进度分析
|
||||||
|
*/
|
||||||
|
ProjectProgressAnalysisVo getProjectProgressAnalysis();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目产值对比
|
||||||
|
*
|
||||||
|
* @return 项目产值对比
|
||||||
|
*/
|
||||||
|
List<OutputValueComparisonVo> getProjectOutputValueComparison();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取风险预警
|
||||||
|
*
|
||||||
|
* @return 风险预警
|
||||||
|
*/
|
||||||
|
List<RiskEarlyWarningVo> getRiskEarlyWarning();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取3天的天气列表
|
||||||
|
*
|
||||||
|
* @param req 查询参数
|
||||||
|
* @return 天气列表
|
||||||
|
*/
|
||||||
|
List<WeatherVo> getWeather3DaysList(WeatherQueryReq req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目进度占比
|
||||||
|
*
|
||||||
|
* @return 项目进度占比
|
||||||
|
*/
|
||||||
|
List<ProjectProgressCapacityVo> getProjectProgressCapacity();
|
||||||
|
}
|
@ -1,8 +1,38 @@
|
|||||||
package org.dromara.bigscreen.service;
|
package org.dromara.bigscreen.service;
|
||||||
|
|
||||||
|
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectGisVo;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-08-21 14:29
|
* @date 2025-08-21 14:29
|
||||||
*/
|
*/
|
||||||
public interface MoneyBigScreenService {
|
public interface MoneyBigScreenService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目位置信息
|
||||||
|
*
|
||||||
|
* @return 项目位置信息
|
||||||
|
*/
|
||||||
|
List<BusProjectGisVo> getProjectGis();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目天气
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目天气
|
||||||
|
*/
|
||||||
|
List<WeatherVo> getProjectWeather(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目安全天数
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目安全天数
|
||||||
|
*/
|
||||||
|
BusProjectSafetyDayVo getProjectSafetyDay(Long projectId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,78 @@
|
|||||||
package org.dromara.bigscreen.service;
|
package org.dromara.bigscreen.service;
|
||||||
|
|
||||||
|
import org.dromara.bigscreen.domain.vo.ProjectImageProgressVo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.ProjectPeopleVo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.ProjectSafetyInspectionVo;
|
||||||
|
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||||
|
import org.dromara.gps.domain.bo.GpsEquipmentBo;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo;
|
||||||
|
import org.dromara.project.domain.vo.projectnews.BusProjectNewsVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-08-21 14:28
|
* @date 2025-08-21 14:28
|
||||||
*/
|
*/
|
||||||
public interface ProjectBigScreenService {
|
public interface ProjectBigScreenService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目天气
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目天气
|
||||||
|
*/
|
||||||
|
List<WeatherVo> getProjectWeather(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目安全天数
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目安全天数
|
||||||
|
*/
|
||||||
|
BusProjectSafetyDayVo getProjectSafetyDay(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目新闻
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目新闻
|
||||||
|
*/
|
||||||
|
List<BusProjectNewsVo> getProjectNews(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目安全检查
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目安全检查
|
||||||
|
*/
|
||||||
|
List<ProjectSafetyInspectionVo> getProjectSafetyInspection(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目人员
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目人员
|
||||||
|
*/
|
||||||
|
ProjectPeopleVo getProjectPeople(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目形象进度
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目形象进度
|
||||||
|
*/
|
||||||
|
ProjectImageProgressVo getProjectImageProgress(Long projectId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目概括
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目概括
|
||||||
|
*/
|
||||||
|
String getProjectGeneralize(Long projectId);
|
||||||
|
|
||||||
|
List<String> getList(Long projectId);
|
||||||
|
|
||||||
|
void setList(GpsEquipmentBo bo);
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,440 @@
|
|||||||
|
package org.dromara.bigscreen.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.dromara.bigscreen.domain.dto.WeatherQueryReq;
|
||||||
|
import org.dromara.bigscreen.domain.vo.*;
|
||||||
|
import org.dromara.bigscreen.service.EnterpriseBigScreenService;
|
||||||
|
import org.dromara.common.core.enums.BusinessStatusEnum;
|
||||||
|
import org.dromara.common.core.utils.DateUtils;
|
||||||
|
import org.dromara.common.utils.BigDecimalUtil;
|
||||||
|
import org.dromara.ctr.service.ICtrExpensesContractService;
|
||||||
|
import org.dromara.ctr.service.ICtrIncomeContractService;
|
||||||
|
import org.dromara.manager.weathermanager.WeatherConstant;
|
||||||
|
import org.dromara.manager.weathermanager.WeatherManager;
|
||||||
|
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||||
|
import org.dromara.out.domain.BusProcurement;
|
||||||
|
import org.dromara.out.domain.OutConstructionValue;
|
||||||
|
import org.dromara.out.domain.OutMonthPlanAudit;
|
||||||
|
import org.dromara.out.domain.OutValueAllocation;
|
||||||
|
import org.dromara.out.service.IBusProcurementService;
|
||||||
|
import org.dromara.out.service.IOutConstructionValueService;
|
||||||
|
import org.dromara.out.service.IOutMonthPlanAuditService;
|
||||||
|
import org.dromara.out.service.IOutValueAllocationService;
|
||||||
|
import org.dromara.progress.domain.PgsProgressCategory;
|
||||||
|
import org.dromara.progress.service.IPgsProgressCategoryService;
|
||||||
|
import org.dromara.progress.service.IPgsProgressPlanDetailService;
|
||||||
|
import org.dromara.project.domain.BusProject;
|
||||||
|
import org.dromara.project.service.IBusProjectService;
|
||||||
|
import org.dromara.safety.domain.HseRecognizeRecord;
|
||||||
|
import org.dromara.safety.domain.HseViolationLevel;
|
||||||
|
import org.dromara.safety.domain.HseViolationRecord;
|
||||||
|
import org.dromara.safety.service.IHseRecognizeRecordService;
|
||||||
|
import org.dromara.safety.service.IHseViolationLevelService;
|
||||||
|
import org.dromara.safety.service.IHseViolationRecordService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lilemy
|
||||||
|
* @date 2025-09-09 15:32
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class EnterpriseBigScreenServiceImpl implements EnterpriseBigScreenService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WeatherManager weatherManager;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProjectService projectService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPgsProgressCategoryService progressCategoryService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPgsProgressPlanDetailService progressPlanDetailService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ICtrIncomeContractService incomeContractService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ICtrExpensesContractService expensesContractService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IOutValueAllocationService outValueAllocationService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IOutMonthPlanAuditService outMonthPlanAuditService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IOutConstructionValueService outConstructionValueService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IHseViolationRecordService hseViolationRecordService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IHseViolationLevelService hseViolationLevelService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProcurementService busProcurementService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IHseRecognizeRecordService hseRecognizeRecordService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取关键指标
|
||||||
|
*
|
||||||
|
* @return 关键指标
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public EnterpriseKeyIndexVo getEnterpriseKeyIndex() {
|
||||||
|
EnterpriseKeyIndexVo vo = new EnterpriseKeyIndexVo();
|
||||||
|
// 在建项目
|
||||||
|
List<BusProject> projectList = projectService.lambdaQuery()
|
||||||
|
.eq(BusProject::getStatus, 0)
|
||||||
|
.eq(BusProject::getPId, 0)
|
||||||
|
.list();
|
||||||
|
// 光伏项目
|
||||||
|
int photovoltaicCount = projectList.stream()
|
||||||
|
.filter(s -> s.getProjectType().equals("1"))
|
||||||
|
.toList()
|
||||||
|
.size();
|
||||||
|
BigDecimal photovoltaicTotalCapacity = projectList.stream()
|
||||||
|
.filter(s -> s.getProjectType().equals("1"))
|
||||||
|
.map(BusProject::getPlan)
|
||||||
|
.filter(s -> s != null && !s.isBlank()) // 过滤掉空值
|
||||||
|
.map(BigDecimal::new) // 转成 BigDecimal
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
// 风电项目
|
||||||
|
int windElectricityCount = projectList.stream()
|
||||||
|
.filter(s -> s.getProjectType().equals("2"))
|
||||||
|
.toList()
|
||||||
|
.size();
|
||||||
|
BigDecimal windElectricityTotalCapacity = projectList.stream()
|
||||||
|
.filter(s -> s.getProjectType().equals("2"))
|
||||||
|
.map(BusProject::getPlan)
|
||||||
|
.filter(s -> s != null && !s.isBlank()) // 过滤掉空值
|
||||||
|
.map(BigDecimal::new) // 转成 BigDecimal
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
vo.setPhotovoltaicCount(photovoltaicCount);
|
||||||
|
vo.setWindElectricityCount(windElectricityCount);
|
||||||
|
vo.setPhotovoltaicTotalCapacity(photovoltaicTotalCapacity);
|
||||||
|
vo.setWindElectricityTotalCapacity(windElectricityTotalCapacity);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目进度分析
|
||||||
|
*
|
||||||
|
* @return 项目进度分析
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ProjectProgressAnalysisVo getProjectProgressAnalysis() {
|
||||||
|
ProjectProgressAnalysisVo vo = new ProjectProgressAnalysisVo();
|
||||||
|
// 1. 查询顶级项目
|
||||||
|
List<BusProject> projectList = projectService.lambdaQuery()
|
||||||
|
.select(BusProject::getId, BusProject::getProjectName, BusProject::getActual, BusProject::getPlan)
|
||||||
|
.eq(BusProject::getStatus, 0)
|
||||||
|
.eq(BusProject::getPId, 0)
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isEmpty(projectList)) {
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
// 2. 拿到顶级项目 id
|
||||||
|
List<Long> projectIds = projectList.stream()
|
||||||
|
.map(BusProject::getId)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
// 3. 查询子项目(pId 在顶级项目id里)
|
||||||
|
List<BusProject> subProject = projectService.lambdaQuery()
|
||||||
|
.select(BusProject::getId, BusProject::getPId)
|
||||||
|
.in(BusProject::getPId, projectIds)
|
||||||
|
.list();
|
||||||
|
// 4. 按父项目id分组子项目
|
||||||
|
Map<Long, List<BusProject>> subProjectMap = subProject.stream()
|
||||||
|
.collect(Collectors.groupingBy(BusProject::getPId));
|
||||||
|
// 5. 查询所有子项目的进度分类
|
||||||
|
List<PgsProgressCategory> progressCategoryList = progressCategoryService.lambdaQuery()
|
||||||
|
.select(PgsProgressCategory::getId,
|
||||||
|
PgsProgressCategory::getProjectId,
|
||||||
|
PgsProgressCategory::getCompleted,
|
||||||
|
PgsProgressCategory::getTotal)
|
||||||
|
.in(CollUtil.isNotEmpty(subProject),
|
||||||
|
PgsProgressCategory::getProjectId,
|
||||||
|
subProject.stream().map(BusProject::getId).toList())
|
||||||
|
.list();
|
||||||
|
// 6. 按子项目id分组进度分类
|
||||||
|
Map<Long, List<PgsProgressCategory>> progressCategoryMap = progressCategoryList.stream()
|
||||||
|
.collect(Collectors.groupingBy(PgsProgressCategory::getProjectId));
|
||||||
|
// 并网容量 =(完工产值/计划总产值)* 计划容量
|
||||||
|
List<OutputValueComparisonVo> list = getProjectOutputValueComparison();
|
||||||
|
BigDecimal actualValue = list.stream()
|
||||||
|
.map(OutputValueComparisonVo::getActualValue)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal planValue = list.stream()
|
||||||
|
.map(OutputValueComparisonVo::getPlanValue)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal plannedCapacity = projectList.stream().map(BusProject::getPlan)
|
||||||
|
.filter(s -> s != null && !s.isBlank()) // 过滤掉空值
|
||||||
|
.map(BigDecimal::new) // 转成 BigDecimal
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal gridConnectedCapacity = BigDecimal.ZERO;
|
||||||
|
if (planValue.compareTo(BigDecimal.ZERO) != 0) {
|
||||||
|
gridConnectedCapacity = plannedCapacity.multiply(actualValue.divide(planValue, 2, RoundingMode.HALF_UP));
|
||||||
|
}
|
||||||
|
vo.setGridConnectedCapacity(gridConnectedCapacity);
|
||||||
|
List<ProjectProgressDetailVo> detailVoList = projectList.stream().map(project -> {
|
||||||
|
ProjectProgressDetailVo detailVo = new ProjectProgressDetailVo();
|
||||||
|
detailVo.setProjectName(project.getProjectName());
|
||||||
|
detailVo.setProjectCapacity(new BigDecimal(project.getActual()));
|
||||||
|
List<BusProject> children = subProjectMap.getOrDefault(project.getId(), List.of());
|
||||||
|
List<PgsProgressCategory> categoryList = new ArrayList<>();
|
||||||
|
for (BusProject child : children) {
|
||||||
|
categoryList.addAll(progressCategoryMap.getOrDefault(child.getId(), List.of()));
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(categoryList)) {
|
||||||
|
BigDecimal completed = categoryList.stream().map(PgsProgressCategory::getCompleted)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal total = categoryList.stream().map(PgsProgressCategory::getTotal)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
detailVo.setCompletionRate(BigDecimalUtil.toPercentage(completed, total));
|
||||||
|
}
|
||||||
|
return detailVo;
|
||||||
|
}).toList();
|
||||||
|
vo.setGridConnectedCapacity(gridConnectedCapacity);
|
||||||
|
vo.setPlannedCapacity(plannedCapacity);
|
||||||
|
// todo 获取延迟项目数
|
||||||
|
vo.setDelayedProjectCount(0);
|
||||||
|
vo.setProjectProgressDetailList(detailVoList);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目产值对比
|
||||||
|
*
|
||||||
|
* @return 项目产值对比
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<OutputValueComparisonVo> getProjectOutputValueComparison() {
|
||||||
|
// 查询顶级项目
|
||||||
|
List<BusProject> projectList = projectService.lambdaQuery()
|
||||||
|
.select(BusProject::getId, BusProject::getProjectName, BusProject::getActual, BusProject::getPlan)
|
||||||
|
.eq(BusProject::getStatus, 0)
|
||||||
|
.eq(BusProject::getPId, 0)
|
||||||
|
.list();
|
||||||
|
// 计划产值
|
||||||
|
List<OutValueAllocation> planList = outValueAllocationService.lambdaQuery()
|
||||||
|
.select(OutValueAllocation::getProjectId, OutValueAllocation::getOwnerTotalValue)
|
||||||
|
.list();
|
||||||
|
Map<Long, BigDecimal> planMap = planList.stream()
|
||||||
|
.collect(Collectors.toMap(OutValueAllocation::getProjectId, OutValueAllocation::getOwnerTotalValue));
|
||||||
|
// 实际产值
|
||||||
|
// 施工产值
|
||||||
|
List<OutConstructionValue> constructionValueList = outConstructionValueService.lambdaQuery()
|
||||||
|
.select(OutConstructionValue::getProjectId, OutConstructionValue::getOwnerValue)
|
||||||
|
.eq(OutConstructionValue::getAuditStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||||
|
.list();
|
||||||
|
// 采购产值
|
||||||
|
List<BusProcurement> purchaseValueList = busProcurementService.lambdaQuery()
|
||||||
|
.select(BusProcurement::getProjectId, BusProcurement::getAcceptedQuantity, BusProcurement::getUnitPrice)
|
||||||
|
.list();
|
||||||
|
// 设计产值
|
||||||
|
List<OutMonthPlanAudit> designValueList = outMonthPlanAuditService.lambdaQuery()
|
||||||
|
.select(OutMonthPlanAudit::getProjectId, OutMonthPlanAudit::getDesignValue)
|
||||||
|
.eq(OutMonthPlanAudit::getType, "1")
|
||||||
|
.list();
|
||||||
|
// 封装数据
|
||||||
|
return projectList.stream().map(project -> {
|
||||||
|
OutputValueComparisonVo vo = new OutputValueComparisonVo();
|
||||||
|
vo.setProjectId(project.getId());
|
||||||
|
vo.setProjectName(project.getProjectName());
|
||||||
|
vo.setPlanValue(planMap.getOrDefault(project.getId(), BigDecimal.ZERO));
|
||||||
|
BigDecimal actualValue = BigDecimal.ZERO;
|
||||||
|
// 设计产值
|
||||||
|
List<OutMonthPlanAudit> designValue = designValueList.stream()
|
||||||
|
.filter(design -> design.getProjectId().equals(project.getId()))
|
||||||
|
.toList();
|
||||||
|
if (CollUtil.isNotEmpty(designValue)) {
|
||||||
|
BigDecimal dValue = designValue.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(OutMonthPlanAudit::getDesignValue)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
actualValue = actualValue.add(dValue);
|
||||||
|
}
|
||||||
|
// 施工产值
|
||||||
|
List<OutConstructionValue> constructionValue = constructionValueList.stream()
|
||||||
|
.filter(construction -> construction.getProjectId().equals(project.getId()))
|
||||||
|
.toList();
|
||||||
|
if (CollUtil.isNotEmpty(constructionValue)) {
|
||||||
|
BigDecimal cValue = constructionValue.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.map(OutConstructionValue::getOwnerValue)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
actualValue = actualValue.add(cValue);
|
||||||
|
}
|
||||||
|
// 采购产值
|
||||||
|
List<BusProcurement> purchaseValue = purchaseValueList.stream()
|
||||||
|
.filter(purchase -> purchase.getProjectId().equals(project.getId()))
|
||||||
|
.toList();
|
||||||
|
if (CollUtil.isNotEmpty(purchaseValue)) {
|
||||||
|
BigDecimal pValue = purchaseValue.stream()
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.filter(purchase -> purchase.getAcceptedQuantity() != null && purchase.getUnitPrice() != null)
|
||||||
|
.map(purchase -> purchase.getAcceptedQuantity().multiply(purchase.getUnitPrice()))
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
actualValue = actualValue.add(pValue);
|
||||||
|
}
|
||||||
|
vo.setActualValue(actualValue);
|
||||||
|
return vo;
|
||||||
|
}).filter(vo -> vo.getActualValue().compareTo(BigDecimal.ZERO) > 0)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取风险预警
|
||||||
|
*
|
||||||
|
* @return 风险预警
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<RiskEarlyWarningVo> getRiskEarlyWarning() {
|
||||||
|
List<HseViolationRecord> recordList = hseViolationRecordService.lambdaQuery()
|
||||||
|
.last("limit 10")
|
||||||
|
.list();
|
||||||
|
recordList = recordList.stream()
|
||||||
|
.filter(record -> record.getReviewType() == null || record.getReviewType().equals("2"))
|
||||||
|
.toList();
|
||||||
|
if (CollUtil.isEmpty(recordList)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
// 项目映射
|
||||||
|
Set<Long> projectIds = recordList.stream()
|
||||||
|
.map(HseViolationRecord::getProjectId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
List<BusProject> projectList = projectService.lambdaQuery()
|
||||||
|
.select(BusProject::getId, BusProject::getProjectName)
|
||||||
|
.in(BusProject::getId, projectIds)
|
||||||
|
.list();
|
||||||
|
Map<Long, String> projectMap = projectList.stream()
|
||||||
|
.collect(Collectors.toMap(BusProject::getId, BusProject::getProjectName));
|
||||||
|
// 风险映射
|
||||||
|
Set<Long> levelIds = recordList.stream()
|
||||||
|
.map(HseViolationRecord::getLevelId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
List<HseViolationLevel> levelList = hseViolationLevelService.lambdaQuery()
|
||||||
|
.select(HseViolationLevel::getId, HseViolationLevel::getRiskType, HseViolationLevel::getViolationLevel)
|
||||||
|
.in(HseViolationLevel::getId, levelIds)
|
||||||
|
.list();
|
||||||
|
Map<Long, HseViolationLevel> levelMap = levelList.stream()
|
||||||
|
.collect(Collectors.toMap(HseViolationLevel::getId, level -> level));
|
||||||
|
// 识别记录映射
|
||||||
|
Set<Long> recognizeIds = recordList.stream()
|
||||||
|
.map(HseViolationRecord::getRecognizeId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
List<HseRecognizeRecord> recognizeRecordList = hseRecognizeRecordService.lambdaQuery()
|
||||||
|
.in(HseRecognizeRecord::getId, recognizeIds)
|
||||||
|
.list();
|
||||||
|
Map<Long, HseRecognizeRecord> recognizeRecordMap = recognizeRecordList.stream()
|
||||||
|
.collect(Collectors.toMap(HseRecognizeRecord::getId, recognize -> recognize));
|
||||||
|
return recordList.stream().map(record -> {
|
||||||
|
RiskEarlyWarningVo vo = new RiskEarlyWarningVo();
|
||||||
|
Date violationTime = record.getViolationTime() != null ? record.getViolationTime() : record.getCreateTime();
|
||||||
|
vo.setDate(DateUtils.toLocalDate(violationTime));
|
||||||
|
vo.setSource(projectMap.getOrDefault(record.getProjectId(), "未知项目"));
|
||||||
|
vo.setRiskType(record.getViolationType());
|
||||||
|
if (levelMap.containsKey(record.getLevelId())) {
|
||||||
|
HseViolationLevel level = levelMap.get(record.getLevelId());
|
||||||
|
vo.setAlarmLevel(level.getRiskType());
|
||||||
|
vo.setDangerLevel(level.getViolationLevel());
|
||||||
|
}
|
||||||
|
if (recognizeRecordMap.containsKey(record.getRecognizeId())) {
|
||||||
|
HseRecognizeRecord hseRecognizeRecord = recognizeRecordMap.get(record.getRecognizeId());
|
||||||
|
vo.setAlarmContent(hseRecognizeRecord.getDescription());
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取3天的天气列表
|
||||||
|
*
|
||||||
|
* @param req 查询参数
|
||||||
|
* @return 天气列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<WeatherVo> getWeather3DaysList(WeatherQueryReq req) {
|
||||||
|
return weatherManager.getWeatherListVo(req.getLng(), req.getLat(), WeatherConstant.THREE_DAYS_WEATHER_PATH);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目进度占比
|
||||||
|
*
|
||||||
|
* @return 项目进度占比
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ProjectProgressCapacityVo> getProjectProgressCapacity() {
|
||||||
|
// 1. 查询顶级项目
|
||||||
|
List<BusProject> projectList = projectService.lambdaQuery()
|
||||||
|
.select(BusProject::getId, BusProject::getProjectName, BusProject::getActual, BusProject::getPlan)
|
||||||
|
.eq(BusProject::getStatus, 0)
|
||||||
|
.eq(BusProject::getPId, 0)
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isEmpty(projectList)) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
|
// 2. 拿到顶级项目 id
|
||||||
|
List<Long> projectIds = projectList.stream()
|
||||||
|
.map(BusProject::getId)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
// 3. 查询子项目(pId 在顶级项目id里)
|
||||||
|
List<BusProject> subProject = projectService.lambdaQuery()
|
||||||
|
.select(BusProject::getId, BusProject::getPId)
|
||||||
|
.in(BusProject::getPId, projectIds)
|
||||||
|
.list();
|
||||||
|
// 4. 按父项目id分组子项目
|
||||||
|
Map<Long, List<BusProject>> subProjectMap = subProject.stream()
|
||||||
|
.collect(Collectors.groupingBy(BusProject::getPId));
|
||||||
|
// 5. 查询所有子项目的进度分类
|
||||||
|
List<PgsProgressCategory> progressCategoryList = progressCategoryService.lambdaQuery()
|
||||||
|
.select(PgsProgressCategory::getId,
|
||||||
|
PgsProgressCategory::getProjectId,
|
||||||
|
PgsProgressCategory::getCompleted,
|
||||||
|
PgsProgressCategory::getTotal)
|
||||||
|
.in(CollUtil.isNotEmpty(subProject),
|
||||||
|
PgsProgressCategory::getProjectId,
|
||||||
|
subProject.stream().map(BusProject::getId).toList())
|
||||||
|
.list();
|
||||||
|
// 6. 按子项目id分组进度分类
|
||||||
|
Map<Long, List<PgsProgressCategory>> progressCategoryMap = progressCategoryList.stream()
|
||||||
|
.collect(Collectors.groupingBy(PgsProgressCategory::getProjectId));
|
||||||
|
return projectList.stream().map(project -> {
|
||||||
|
ProjectProgressCapacityVo detailVo = new ProjectProgressCapacityVo();
|
||||||
|
detailVo.setProjectId(project.getId());
|
||||||
|
detailVo.setProjectName(project.getProjectName());
|
||||||
|
detailVo.setPlannedCapacity(new BigDecimal(project.getPlan()));
|
||||||
|
List<BusProject> children = subProjectMap.getOrDefault(project.getId(), List.of());
|
||||||
|
List<PgsProgressCategory> categoryList = new ArrayList<>();
|
||||||
|
for (BusProject child : children) {
|
||||||
|
categoryList.addAll(progressCategoryMap.getOrDefault(child.getId(), List.of()));
|
||||||
|
}
|
||||||
|
if (CollUtil.isNotEmpty(categoryList)) {
|
||||||
|
BigDecimal completed = categoryList.stream().map(PgsProgressCategory::getCompleted)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
BigDecimal total = categoryList.stream().map(PgsProgressCategory::getTotal)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||||
|
detailVo.setProgressPercentage(BigDecimalUtil.toPercentage(completed, total));
|
||||||
|
}
|
||||||
|
return detailVo;
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +1,71 @@
|
|||||||
package org.dromara.bigscreen.service.impl;
|
package org.dromara.bigscreen.service.impl;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
import org.dromara.bigscreen.service.MoneyBigScreenService;
|
import org.dromara.bigscreen.service.MoneyBigScreenService;
|
||||||
|
import org.dromara.common.core.constant.HttpStatus;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
|
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||||
|
import org.dromara.project.domain.BusProject;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectGisVo;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo;
|
||||||
|
import org.dromara.project.service.IBusProjectService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-08-21 14:29
|
* @date 2025-08-21 14:29
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class MoneyBigScreenServiceImpl implements MoneyBigScreenService {
|
public class MoneyBigScreenServiceImpl implements MoneyBigScreenService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProjectService projectService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目位置信息
|
||||||
|
*
|
||||||
|
* @return 项目位置信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BusProjectGisVo> getProjectGis() {
|
||||||
|
return projectService.getGisList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目天气
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目天气
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<WeatherVo> getProjectWeather(Long projectId) {
|
||||||
|
checkProject(projectId);
|
||||||
|
return projectService.getWeather(projectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目安全天数
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目安全天数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BusProjectSafetyDayVo getProjectSafetyDay(Long projectId) {
|
||||||
|
checkProject(projectId);
|
||||||
|
return projectService.getSafetyDay(projectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查项目是否存在
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
*/
|
||||||
|
private void checkProject(Long projectId) {
|
||||||
|
BusProject project = projectService.getById(projectId);
|
||||||
|
if (project == null) {
|
||||||
|
throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,387 @@
|
|||||||
package org.dromara.bigscreen.service.impl;
|
package org.dromara.bigscreen.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.json.JSONArray;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.dromara.bigscreen.domain.vo.ProjectImageProgressVo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.ProjectPeopleVo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.ProjectSafetyInspectionVo;
|
||||||
|
import org.dromara.bigscreen.domain.vo.ProjectTeamAttendanceVo;
|
||||||
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
import org.dromara.bigscreen.service.ProjectBigScreenService;
|
||||||
|
import org.dromara.common.core.constant.HttpStatus;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
|
import org.dromara.common.utils.BigDecimalUtil;
|
||||||
|
import org.dromara.contractor.domain.SubConstructionUser;
|
||||||
|
import org.dromara.contractor.service.ISubConstructionUserService;
|
||||||
|
import org.dromara.gps.domain.bo.GpsEquipmentBo;
|
||||||
|
import org.dromara.manager.weathermanager.vo.WeatherVo;
|
||||||
|
import org.dromara.progress.domain.PgsProgressCategory;
|
||||||
|
import org.dromara.progress.domain.enums.PgsProgressUnitTypeEnum;
|
||||||
|
import org.dromara.progress.service.IPgsProgressCategoryService;
|
||||||
|
import org.dromara.project.domain.BusProject;
|
||||||
|
import org.dromara.project.domain.BusProjectTeam;
|
||||||
|
import org.dromara.project.domain.BusProjectTeamMember;
|
||||||
|
import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo;
|
||||||
|
import org.dromara.project.domain.vo.projectnews.BusProjectNewsVo;
|
||||||
|
import org.dromara.project.service.*;
|
||||||
|
import org.dromara.safety.domain.HseRecognizeRecord;
|
||||||
|
import org.dromara.safety.service.IHseRecognizeRecordService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lilemy
|
* @author lilemy
|
||||||
* @date 2025-08-21 14:29
|
* @date 2025-08-21 14:29
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
public class ProjectBigScreenServiceImpl implements ProjectBigScreenService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProjectService projectService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProjectNewsService projectNewsService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IHseRecognizeRecordService recognizeRecordService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISubConstructionUserService constructionUserService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusAttendanceService attendanceService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProjectTeamService projectTeamService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IBusProjectTeamMemberService projectTeamMemberService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IPgsProgressCategoryService progressCategoryService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目天气
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目天气
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<WeatherVo> getProjectWeather(Long projectId) {
|
||||||
|
checkProject(projectId);
|
||||||
|
return projectService.getWeather(projectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目安全天数
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目安全天数
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BusProjectSafetyDayVo getProjectSafetyDay(Long projectId) {
|
||||||
|
checkProject(projectId);
|
||||||
|
return projectService.getSafetyDay(projectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目新闻
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目新闻
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BusProjectNewsVo> getProjectNews(Long projectId) {
|
||||||
|
checkProject(projectId);
|
||||||
|
return projectNewsService.queryListByProject(projectId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目安全检查
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目安全检查
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<ProjectSafetyInspectionVo> getProjectSafetyInspection(Long projectId) {
|
||||||
|
checkProject(projectId);
|
||||||
|
List<HseRecognizeRecord> recordList = recognizeRecordService.lambdaQuery()
|
||||||
|
.eq(HseRecognizeRecord::getProjectId, projectId)
|
||||||
|
.orderByDesc(HseRecognizeRecord::getCreateTime) // 按创建时间倒序
|
||||||
|
.last("limit 10") // 只取前10条
|
||||||
|
.list();
|
||||||
|
return recordList.stream().map(record -> {
|
||||||
|
ProjectSafetyInspectionVo vo = new ProjectSafetyInspectionVo();
|
||||||
|
BeanUtils.copyProperties(record, vo);
|
||||||
|
return vo;
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目人员
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目人员
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ProjectPeopleVo getProjectPeople(Long projectId) {
|
||||||
|
// 参数校验
|
||||||
|
BusProject project = projectService.getById(projectId);
|
||||||
|
if (project == null) {
|
||||||
|
throw new ServiceException("项目信息不存在", HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
// 获取大屏数据
|
||||||
|
ProjectPeopleVo vo = new ProjectPeopleVo();
|
||||||
|
// 获取施工人员总数
|
||||||
|
Long count = constructionUserService.lambdaQuery()
|
||||||
|
.eq(SubConstructionUser::getProjectId, projectId).count();
|
||||||
|
BigDecimal countDec = BigDecimal.valueOf(count);
|
||||||
|
vo.setPeopleCount(countDec);
|
||||||
|
// 获取考勤数据
|
||||||
|
List<Long> attendancePeopleList = attendanceService.listAttendancePeopleByProjectId(projectId);
|
||||||
|
BigDecimal attendanceSize = BigDecimal.valueOf(attendancePeopleList.size());
|
||||||
|
vo.setAttendanceCount(attendanceSize);
|
||||||
|
// 计算考勤率
|
||||||
|
vo.setAttendanceRate(BigDecimalUtil.toPercentage(attendanceSize, countDec));
|
||||||
|
if (count != 0) {
|
||||||
|
// 统计班组人数
|
||||||
|
List<BusProjectTeamMember> memberList = projectTeamMemberService.lambdaQuery()
|
||||||
|
.select(BusProjectTeamMember::getId, BusProjectTeamMember::getTeamId)
|
||||||
|
.eq(BusProjectTeamMember::getProjectId, projectId)
|
||||||
|
.list();
|
||||||
|
Map<Long, List<BusProjectTeamMember>> memberMap = memberList.stream()
|
||||||
|
.collect(Collectors.groupingBy(BusProjectTeamMember::getTeamId));
|
||||||
|
// 统计班组考勤数据
|
||||||
|
Map<Long, List<SubConstructionUser>> userTeamMap = new HashMap<>();
|
||||||
|
if (CollUtil.isNotEmpty(attendancePeopleList)) {
|
||||||
|
List<SubConstructionUser> users = constructionUserService.listByIds(attendancePeopleList);
|
||||||
|
userTeamMap = users.stream()
|
||||||
|
.collect(Collectors.groupingBy(SubConstructionUser::getTeamId));
|
||||||
|
}
|
||||||
|
List<BusProjectTeam> teamList = projectTeamService.lambdaQuery()
|
||||||
|
.eq(BusProjectTeam::getProjectId, projectId)
|
||||||
|
.list();
|
||||||
|
String punchRange = project.getPunchRange();
|
||||||
|
String punchTime = "";
|
||||||
|
if (punchRange != null) {
|
||||||
|
String start = punchRange.split(",")[0];
|
||||||
|
punchTime = LocalDate.now() + " " + start;
|
||||||
|
}
|
||||||
|
List<ProjectTeamAttendanceVo> listVo = new ArrayList<>();
|
||||||
|
for (BusProjectTeam projectTeam : teamList) {
|
||||||
|
ProjectTeamAttendanceVo teamAttendanceVo = new ProjectTeamAttendanceVo();
|
||||||
|
Long id = projectTeam.getId();
|
||||||
|
teamAttendanceVo.setId(id);
|
||||||
|
teamAttendanceVo.setTeamName(projectTeam.getTeamName());
|
||||||
|
teamAttendanceVo.setAttendanceTime(punchTime);
|
||||||
|
BigDecimal allNumber = BigDecimal.ZERO;
|
||||||
|
if (memberMap.containsKey(id)) {
|
||||||
|
allNumber = BigDecimal.valueOf(memberMap.get(id).size());
|
||||||
|
}
|
||||||
|
BigDecimal attendanceNumber = BigDecimal.ZERO;
|
||||||
|
if (CollUtil.isNotEmpty(userTeamMap) && userTeamMap.containsKey(id)) {
|
||||||
|
attendanceNumber = BigDecimal.valueOf(userTeamMap.get(id).size());
|
||||||
|
}
|
||||||
|
teamAttendanceVo.setAttendanceNumber(attendanceNumber);
|
||||||
|
teamAttendanceVo.setAllNumber(allNumber);
|
||||||
|
teamAttendanceVo.setAttendanceRate(BigDecimalUtil.toPercentage(attendanceNumber, allNumber));
|
||||||
|
listVo.add(teamAttendanceVo);
|
||||||
|
}
|
||||||
|
vo.setTeamAttendanceList(listVo);
|
||||||
|
}
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目形象进度
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目形象进度
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ProjectImageProgressVo getProjectImageProgress(Long projectId) {
|
||||||
|
checkProject(projectId);
|
||||||
|
ProjectImageProgressVo vo = new ProjectImageProgressVo();
|
||||||
|
// 获取所有子项目列表
|
||||||
|
List<BusProject> subProjectList = projectService.lambdaQuery()
|
||||||
|
.eq(BusProject::getPId, projectId)
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isEmpty(subProjectList)) {
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
// 子项目id列表
|
||||||
|
List<Long> subProjectIds = subProjectList.stream().map(BusProject::getId).toList();
|
||||||
|
// 计算集电线路
|
||||||
|
vo.setCollectorLinePercentage(BigDecimal.valueOf(0.00));
|
||||||
|
// 计算送出线路
|
||||||
|
vo.setExportLinePercentage(BigDecimal.valueOf(0.00));
|
||||||
|
// 计算升压站
|
||||||
|
vo.setSubstationPercentage(BigDecimal.valueOf(0.00));
|
||||||
|
// 计算光伏场区
|
||||||
|
vo.setAreaPercentage(BigDecimal.valueOf(0.00));
|
||||||
|
// 计算道路
|
||||||
|
vo.setRoadPercentage(BigDecimal.valueOf(0.00));
|
||||||
|
// 计算箱变
|
||||||
|
vo.setBoxTransformerPercentage(BigDecimal.ZERO);
|
||||||
|
// 获取集电线路、送出线路、升压站数据
|
||||||
|
List<PgsProgressCategory> progressCategoryList = progressCategoryService.lambdaQuery()
|
||||||
|
.in(PgsProgressCategory::getProjectId, subProjectIds)
|
||||||
|
.in(PgsProgressCategory::getName, "集电线路", "送出线路", "升压站", "光伏场区")
|
||||||
|
.eq(PgsProgressCategory::getParentId, 0L)
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isNotEmpty(progressCategoryList)) {
|
||||||
|
List<Long> categoryIds = progressCategoryList.stream().map(PgsProgressCategory::getId).distinct().toList();
|
||||||
|
List<PgsProgressCategory> leafNodesByTopIds = progressCategoryService.getLeafNodesByTopIds(categoryIds);
|
||||||
|
Map<String, List<PgsProgressCategory>> categoryMap = progressCategoryList.stream()
|
||||||
|
.collect(Collectors.groupingBy(PgsProgressCategory::getName));
|
||||||
|
// 计算集电线路
|
||||||
|
if (categoryMap.containsKey("集电线路")) {
|
||||||
|
List<PgsProgressCategory> categoryList = categoryMap.get("集电线路");
|
||||||
|
List<Long> ids = categoryList.stream().map(PgsProgressCategory::getId).distinct().toList();
|
||||||
|
List<PgsProgressCategory> list = leafNodesByTopIds.stream()
|
||||||
|
.filter(node -> {
|
||||||
|
Set<Long> ancestorSet = Arrays.stream(node.getAncestors().split(",")).map(Long::parseLong).collect(Collectors.toSet());
|
||||||
|
return ids.stream().anyMatch(ancestorSet::contains);
|
||||||
|
}).toList();
|
||||||
|
BigDecimal percentage = progressCategoryService.getCompletedPercentage(list);
|
||||||
|
if (percentage.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
vo.setCollectorLinePercentage(percentage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算送出线路
|
||||||
|
if (categoryMap.containsKey("送出线路")) {
|
||||||
|
List<PgsProgressCategory> categoryList = categoryMap.get("送出线路");
|
||||||
|
List<Long> ids = categoryList.stream().map(PgsProgressCategory::getId).distinct().toList();
|
||||||
|
List<PgsProgressCategory> list = leafNodesByTopIds.stream()
|
||||||
|
.filter(node -> {
|
||||||
|
Set<Long> ancestorSet = Arrays.stream(node.getAncestors().split(",")).map(Long::parseLong).collect(Collectors.toSet());
|
||||||
|
return ids.stream().anyMatch(ancestorSet::contains);
|
||||||
|
}).toList();
|
||||||
|
BigDecimal percentage = progressCategoryService.getCompletedPercentage(list);
|
||||||
|
if (percentage.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
vo.setExportLinePercentage(percentage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算升压站
|
||||||
|
if (categoryMap.containsKey("升压站")) {
|
||||||
|
List<PgsProgressCategory> categoryList = categoryMap.get("升压站");
|
||||||
|
List<Long> ids = categoryList.stream().map(PgsProgressCategory::getId).distinct().toList();
|
||||||
|
List<PgsProgressCategory> list = leafNodesByTopIds.stream()
|
||||||
|
.filter(node -> {
|
||||||
|
Set<Long> ancestorSet = Arrays.stream(node.getAncestors().split(",")).map(Long::parseLong).collect(Collectors.toSet());
|
||||||
|
return ids.stream().anyMatch(ancestorSet::contains);
|
||||||
|
}).toList();
|
||||||
|
BigDecimal percentage = progressCategoryService.getCompletedPercentage(list);
|
||||||
|
if (percentage.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
vo.setSubstationPercentage(percentage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算光伏场区
|
||||||
|
if (categoryMap.containsKey("光伏场区")) {
|
||||||
|
List<PgsProgressCategory> categoryList = categoryMap.get("光伏场区");
|
||||||
|
List<Long> ids = categoryList.stream().map(PgsProgressCategory::getId).distinct().toList();
|
||||||
|
List<PgsProgressCategory> list = leafNodesByTopIds.stream()
|
||||||
|
.filter(node -> {
|
||||||
|
Set<Long> ancestorSet = Arrays.stream(node.getAncestors().split(",")).map(Long::parseLong).collect(Collectors.toSet());
|
||||||
|
return ids.stream().anyMatch(ancestorSet::contains);
|
||||||
|
}).toList();
|
||||||
|
BigDecimal percentage = progressCategoryService.getCompletedPercentage(list);
|
||||||
|
if (percentage.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
vo.setAreaPercentage(percentage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算道路
|
||||||
|
List<PgsProgressCategory> roadCategoryList = progressCategoryService.lambdaQuery()
|
||||||
|
.in(PgsProgressCategory::getProjectId, subProjectIds)
|
||||||
|
.like(PgsProgressCategory::getName, "道路")
|
||||||
|
.ne(PgsProgressCategory::getUnitType, PgsProgressUnitTypeEnum.NULL.getValue())
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isNotEmpty(roadCategoryList)) {
|
||||||
|
BigDecimal percentage = progressCategoryService.getCompletedPercentage(roadCategoryList);
|
||||||
|
if (percentage.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
vo.setRoadPercentage(percentage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算箱变
|
||||||
|
List<PgsProgressCategory> boxTransformerCategoryList = progressCategoryService.lambdaQuery()
|
||||||
|
.in(PgsProgressCategory::getProjectId, subProjectIds)
|
||||||
|
.like(PgsProgressCategory::getName, "箱变")
|
||||||
|
.ne(PgsProgressCategory::getUnitType, PgsProgressUnitTypeEnum.NULL.getValue())
|
||||||
|
.list();
|
||||||
|
if (CollUtil.isNotEmpty(boxTransformerCategoryList)) {
|
||||||
|
BigDecimal percentage = progressCategoryService.getCompletedPercentage(boxTransformerCategoryList);
|
||||||
|
if (percentage.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
vo.setBoxTransformerPercentage(percentage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 计算总进度
|
||||||
|
vo.setTotalPercentage(
|
||||||
|
vo.getCollectorLinePercentage()
|
||||||
|
.add(vo.getExportLinePercentage())
|
||||||
|
.add(vo.getSubstationPercentage())
|
||||||
|
.add(vo.getAreaPercentage())
|
||||||
|
.add(vo.getRoadPercentage())
|
||||||
|
.add(vo.getBoxTransformerPercentage())
|
||||||
|
.divide(BigDecimal.valueOf(6), 2, RoundingMode.HALF_UP) // 保留两位小数
|
||||||
|
);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取项目概括
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @return 项目概括
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String getProjectGeneralize(Long projectId) {
|
||||||
|
BusProject project = projectService.getById(projectId);
|
||||||
|
if (project == null) {
|
||||||
|
throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
return project.getProjectGeneralize();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查项目是否存在
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
*/
|
||||||
|
private void checkProject(Long projectId) {
|
||||||
|
BusProject project = projectService.getById(projectId);
|
||||||
|
if (project == null) {
|
||||||
|
throw new ServiceException("项目不存在", HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getList(Long projectId) {
|
||||||
|
if (projectId == null){
|
||||||
|
throw new ServiceException("项目id不能为空!!!");
|
||||||
|
}
|
||||||
|
Object object = RedisUtils.getCacheObject("xmjdp:" + projectId);
|
||||||
|
if (object == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
JSONArray objects = JSONUtil.parseArray(object);
|
||||||
|
return objects.toList(String.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setList(GpsEquipmentBo bo) {
|
||||||
|
if (bo.getProjectId() == null){
|
||||||
|
throw new ServiceException("项目id不能为空!!!");
|
||||||
|
}
|
||||||
|
RedisUtils.setCacheObject("xmjdp:"+bo.getProjectId(), bo.getIdList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import org.dromara.cailiaoshebei.domain.bo.*;
|
|||||||
import org.dromara.cailiaoshebei.domain.vo.*;
|
import org.dromara.cailiaoshebei.domain.vo.*;
|
||||||
import org.dromara.cailiaoshebei.service.IBusCailiaoshebeiPiciService;
|
import org.dromara.cailiaoshebei.service.IBusCailiaoshebeiPiciService;
|
||||||
import org.dromara.common.utils.BatchNumberGenerator;
|
import org.dromara.common.utils.BatchNumberGenerator;
|
||||||
import org.dromara.design.domain.bo.ObtainTheListReq;
|
import org.dromara.design.domain.bo.CoryObtainTheListReq;
|
||||||
import org.dromara.design.domain.vo.ObtainTheListRes;
|
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@ -244,8 +244,9 @@ public class BusCailiaoshebeiController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@SaCheckPermission("design:cailiaoshebei:obtainTheList")
|
@SaCheckPermission("design:cailiaoshebei:obtainTheList")
|
||||||
@GetMapping("/obtainTheList")
|
@GetMapping("/obtainTheList")
|
||||||
public R<List<ObtainTheListRes>> obtainTheList(ObtainTheListReq bo, PageQuery pageQuery) {
|
public R<List<ObtainTheListRes>> obtainTheList(CoryObtainTheListReq bo, PageQuery pageQuery) {
|
||||||
return R.ok(busBillofquantitiesVersionsService.obtainTheList(bo));
|
return R.ok(busBillofquantitiesVersionsService.obtainTheList(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
package org.dromara.cailiaoshebei.controller;
|
package org.dromara.cailiaoshebei.controller;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -14,10 +19,12 @@ import org.dromara.common.core.enums.BusinessStatusEnum;
|
|||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.design.domain.BusBillofquantities;
|
import org.dromara.design.domain.BusBillofquantities;
|
||||||
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
import org.dromara.design.domain.BusBillofquantitiesVersions;
|
||||||
import org.dromara.design.domain.dto.desCollect.DesCollectBatchDto;
|
import org.dromara.design.domain.bo.CoryObtainTheListReq;
|
||||||
import org.dromara.design.domain.vo.DesCollectVo;
|
import org.dromara.design.domain.vo.ObtainTheListRes;
|
||||||
import org.dromara.design.service.IBusBillofquantitiesService;
|
import org.dromara.design.service.IBusBillofquantitiesService;
|
||||||
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
@ -122,17 +129,26 @@ public class BusMrpBaseController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 批量新增或修改
|
* 批量新增或修改
|
||||||
*/
|
*/
|
||||||
|
@SaCheckPermission("cailiaoshebei:mrpBase:addbatch")
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/batch")
|
@PostMapping("/batch")
|
||||||
public R<Void> batchAddOrUpdate(@RequestBody BusMrpDto dto) {
|
public R<Void> batchAddOrUpdate(@RequestBody BusMrpDto dto) {
|
||||||
return toAjax(busMrpBaseService.batchAddOrUpdate(dto));
|
return toAjax(busMrpBaseService.batchAddOrUpdate(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取剩余量
|
||||||
|
*/
|
||||||
|
@GetMapping("/remaining")
|
||||||
|
public R<Map<String,Object>> remaining(Long suppliespriceId,Long mrpBaseId) {
|
||||||
|
return R.ok(busMrpBaseService.remaining(suppliespriceId,mrpBaseId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入物资需求批次计划
|
* 导入物资需求批次计划
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("cailiaoshebei:mrpBase:add")
|
@SaCheckPermission("cailiaoshebei:mrpBase:import")
|
||||||
@Log(title = "物资-批次需求计划基础信息", businessType = BusinessType.INSERT)
|
@Log(title = "物资-批次需求计划基础信息", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/import")
|
@PostMapping("/import")
|
||||||
@ -140,16 +156,34 @@ public class BusMrpBaseController extends BaseController {
|
|||||||
return toAjax(busMrpBaseService.importData(dto));
|
return toAjax(busMrpBaseService.importData(dto));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取到物资状态为已完成的版本
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("cailiaoshebei:purchaseDoc:obtainTheVersion")
|
||||||
|
@GetMapping("/obtainTheVersion")
|
||||||
|
public R<List<BusBillofquantitiesVersions>> obtainTheVersion(Long projectId) {
|
||||||
|
List<BusBillofquantitiesVersions> list = busBillofquantitiesVersionsService.list(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
|
||||||
|
.eq(BusBillofquantitiesVersions::getProjectId, projectId)
|
||||||
|
.eq(BusBillofquantitiesVersions::getWorkOrderType, "3")
|
||||||
|
.eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||||
|
);
|
||||||
|
if (CollectionUtils.isEmpty(list)){
|
||||||
|
throw new ServiceException("请先完成物资工程量清单");
|
||||||
|
}
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取工程量清单列表
|
* 获取工程量清单列表
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:add")
|
@SaCheckPermission("cailiaoshebei:purchaseDoc:coryEngineeringList")
|
||||||
@GetMapping("/engineeringList")
|
@GetMapping("/coryEngineeringList")
|
||||||
public R<List<BusBillofquantities>> obtainTheList(Long projectId) {
|
public R<List<ObtainTheListRes>> obtainTheList(CoryObtainTheListReq req) {
|
||||||
|
|
||||||
BusBillofquantitiesVersions one = busBillofquantitiesVersionsService.getOne(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
|
BusBillofquantitiesVersions one = busBillofquantitiesVersionsService.getOne(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
|
||||||
.eq(BusBillofquantitiesVersions::getWorkOrderType, "3") //物资工程量清单
|
.eq(BusBillofquantitiesVersions::getWorkOrderType, "3") //物资工程量清单
|
||||||
.eq(BusBillofquantitiesVersions::getProjectId, projectId)
|
.eq(BusBillofquantitiesVersions::getProjectId, req.getProjectId())
|
||||||
|
.eq(BusBillofquantitiesVersions::getVersions, req.getVersions())
|
||||||
.eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
|
.eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||||
.last("limit 1")
|
.last("limit 1")
|
||||||
);
|
);
|
||||||
@ -159,7 +193,36 @@ public class BusMrpBaseController extends BaseController {
|
|||||||
List<BusBillofquantities> list = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
|
List<BusBillofquantities> list = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
|
||||||
.eq(BusBillofquantities::getVersions, one.getVersions())
|
.eq(BusBillofquantities::getVersions, one.getVersions())
|
||||||
);
|
);
|
||||||
|
List<ObtainTheListRes> obtainTheListRes = new ArrayList<>();
|
||||||
|
list.forEach(billofquantities -> {
|
||||||
|
ObtainTheListRes res = new ObtainTheListRes();
|
||||||
|
BeanUtils.copyProperties(billofquantities, res);
|
||||||
|
obtainTheListRes.add(res);
|
||||||
|
});
|
||||||
|
|
||||||
return R.ok(list);
|
Map<String, List<ObtainTheListRes>> parentMap = obtainTheListRes.stream()
|
||||||
|
.collect(Collectors.groupingBy(ObtainTheListRes::getPid));
|
||||||
|
|
||||||
|
// 3. 递归组装树形结构,从顶级节点(pid=0)开始
|
||||||
|
List<ObtainTheListRes> treeList = buildTree("0", parentMap);
|
||||||
|
return R.ok(treeList);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<ObtainTheListRes> buildTree(String parentId, Map<String, List<ObtainTheListRes>> parentMap) {
|
||||||
|
// 获取当前父节点的所有直接子节点
|
||||||
|
List<ObtainTheListRes> children = parentMap.getOrDefault(parentId, Collections.emptyList());
|
||||||
|
if (children.isEmpty()) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 为每个子节点递归设置其下一级子节点
|
||||||
|
for (ObtainTheListRes child : children) {
|
||||||
|
// 递归查询当前子节点的子节点,设置为它的子树
|
||||||
|
List<ObtainTheListRes> subChildren = buildTree(child.getSid(), parentMap);
|
||||||
|
// 注意:需要在Vo中添加子节点列表字段,用于存储子树
|
||||||
|
child.setChildren(subChildren);
|
||||||
|
}
|
||||||
|
|
||||||
|
return children;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.cailiaoshebei.controller;
|
package org.dromara.cailiaoshebei.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
@ -33,8 +34,12 @@ import org.dromara.design.service.IBusBillofquantitiesVersionsService;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物资-采购联系单
|
* 物资-采购联系单
|
||||||
@ -67,6 +72,8 @@ public class BusPurchaseDocController extends BaseController {
|
|||||||
return busPurchaseDocService.queryPageList(bo, pageQuery);
|
return busPurchaseDocService.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出物资-采购联系单列表
|
* 导出物资-采购联系单列表
|
||||||
*/
|
*/
|
||||||
@ -81,7 +88,7 @@ public class BusPurchaseDocController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 根据主键导出物资-采购联系单
|
* 根据主键导出物资-采购联系单
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:downloadWord")
|
@SaCheckPermission("cailiaoshebei:purchaseDoc:exportWord")
|
||||||
@Log(title = "物资-采购联系单", businessType = BusinessType.EXPORT)
|
@Log(title = "物资-采购联系单", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export/word")
|
@PostMapping("/export/word")
|
||||||
public void exportWordById(@NotNull(message = "主键不能为空") Long id,
|
public void exportWordById(@NotNull(message = "主键不能为空") Long id,
|
||||||
@ -106,7 +113,7 @@ public class BusPurchaseDocController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param id 主键
|
* @param id 主键
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:queryPdf")
|
@SaCheckPermission("cailiaoshebei:purchaseDoc:pdf")
|
||||||
@GetMapping("/pdf/{id}")
|
@GetMapping("/pdf/{id}")
|
||||||
public R<String> getPic(@NotNull(message = "主键不能为空")
|
public R<String> getPic(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
@ -157,36 +164,45 @@ public class BusPurchaseDocController extends BaseController {
|
|||||||
@PathVariable("id") Long id) {
|
@PathVariable("id") Long id) {
|
||||||
List<BusPlanDocAssociation> list = planDocAssociationService.list(Wrappers.lambdaQuery(BusPlanDocAssociation.class)
|
List<BusPlanDocAssociation> list = planDocAssociationService.list(Wrappers.lambdaQuery(BusPlanDocAssociation.class)
|
||||||
.eq(BusPlanDocAssociation::getDocId, id));
|
.eq(BusPlanDocAssociation::getDocId, id));
|
||||||
List<Long> list1 = list.stream().map(BusPlanDocAssociation::getPlanId).toList();
|
if (CollectionUtil.isEmpty(list)) {
|
||||||
if (list1.isEmpty()) {
|
|
||||||
return R.ok(new ArrayList<>());
|
return R.ok(new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
Map<Long, BigDecimal> collect = list.stream()
|
||||||
|
.filter(Objects::nonNull) // 过滤空对象
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
BusPlanDocAssociation::getPlanId,
|
||||||
|
BusPlanDocAssociation::getDemandQuantity,
|
||||||
|
(existing, replacement) -> existing // 保留第一个遇到的重复键
|
||||||
|
));
|
||||||
BusMaterialbatchdemandplanBo bo = new BusMaterialbatchdemandplanBo();
|
BusMaterialbatchdemandplanBo bo = new BusMaterialbatchdemandplanBo();
|
||||||
bo.setIds(list1);
|
bo.setIds(new ArrayList<>(collect.keySet()));
|
||||||
return R.ok(materialbatchdemandplanService.queryList(bo));
|
List<BusMaterialbatchdemandplanVo> busMaterialbatchdemandplanVos = materialbatchdemandplanService.queryList(bo);
|
||||||
}
|
for (BusMaterialbatchdemandplanVo busMaterialbatchdemandplanVo : busMaterialbatchdemandplanVos) {
|
||||||
|
busMaterialbatchdemandplanVo.setDemandQuantity(collect.get(busMaterialbatchdemandplanVo.getId()).longValue());
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取工程量清单列表
|
|
||||||
*/
|
|
||||||
@SaCheckPermission("cailiaoshebei:purchaseDoc:add")
|
|
||||||
@GetMapping("/engineeringList")
|
|
||||||
public R<List<BusBillofquantities>> obtainTheList(Long projectId) {
|
|
||||||
|
|
||||||
BusBillofquantitiesVersions one = busBillofquantitiesVersionsService.getOne(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
|
|
||||||
.eq(BusBillofquantitiesVersions::getWorkOrderType, "3") //物资工程量清单
|
|
||||||
.eq(BusBillofquantitiesVersions::getProjectId, projectId)
|
|
||||||
.eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
|
|
||||||
.last("limit 1")
|
|
||||||
);
|
|
||||||
if (one == null) {
|
|
||||||
throw new ServiceException("请先完成物资工程量清单");
|
|
||||||
}
|
}
|
||||||
List<BusBillofquantities> list = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
|
return R.ok(busMaterialbatchdemandplanVos);
|
||||||
.eq(BusBillofquantities::getVersions, one.getVersions())
|
|
||||||
);
|
|
||||||
|
|
||||||
return R.ok(list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取工程量清单列表
|
||||||
|
// */
|
||||||
|
// @SaCheckPermission("cailiaoshebei:purchaseDoc:add")
|
||||||
|
// @GetMapping("/engineeringList")
|
||||||
|
// public R<List<BusBillofquantities>> obtainTheList(Long projectId) {
|
||||||
|
// BusBillofquantitiesVersions one = busBillofquantitiesVersionsService.getOne(Wrappers.<BusBillofquantitiesVersions>lambdaQuery()
|
||||||
|
// .eq(BusBillofquantitiesVersions::getWorkOrderType, "3") //物资工程量清单
|
||||||
|
// .eq(BusBillofquantitiesVersions::getProjectId, projectId)
|
||||||
|
// .eq(BusBillofquantitiesVersions::getStatus, BusinessStatusEnum.FINISH.getStatus())
|
||||||
|
// .last("limit 1")
|
||||||
|
// );
|
||||||
|
// if (one == null) {
|
||||||
|
// throw new ServiceException("请先完成物资工程量清单");
|
||||||
|
// }
|
||||||
|
// List<BusBillofquantities> list = busBillofquantitiesService.list(Wrappers.<BusBillofquantities>lambdaQuery()
|
||||||
|
// .eq(BusBillofquantities::getVersions, one.getVersions())
|
||||||
|
// );
|
||||||
|
//
|
||||||
|
// return R.ok(list);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public class BusPurchaseUserController extends BaseController {
|
|||||||
/**
|
/**
|
||||||
* 新增或修改物资采购人员
|
* 新增或修改物资采购人员
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("cailiaoshebei:purchaseUser:add")
|
@SaCheckPermission("cailiaoshebei:purchaseUser:addOrUpdate")
|
||||||
@Log(title = "物资采购人员", businessType = BusinessType.INSERT)
|
@Log(title = "物资采购人员", businessType = BusinessType.INSERT)
|
||||||
@RepeatSubmit()
|
@RepeatSubmit()
|
||||||
@PostMapping("/addOrUpdate")
|
@PostMapping("/addOrUpdate")
|
||||||
@ -121,7 +121,7 @@ public class BusPurchaseUserController extends BaseController {
|
|||||||
*
|
*
|
||||||
* @param projectId 项目id
|
* @param projectId 项目id
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("cailiaoshebei:purchaseUser:query")
|
@SaCheckPermission("cailiaoshebei:purchaseUser:byProject")
|
||||||
@GetMapping("/byProject/{projectId}")
|
@GetMapping("/byProject/{projectId}")
|
||||||
public R<BusPurchaseUserVo> getInfoByProject(@NotNull(message = "主键不能为空")
|
public R<BusPurchaseUserVo> getInfoByProject(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long projectId) {
|
@PathVariable Long projectId) {
|
||||||
|
@ -1,32 +1,33 @@
|
|||||||
package org.dromara.cailiaoshebei.controller;
|
package org.dromara.cailiaoshebei.controller;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
|
||||||
import jakarta.validation.constraints.*;
|
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanAuditBo;
|
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanAuditBo;
|
||||||
|
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
||||||
import org.dromara.cailiaoshebei.domain.bo.MasterDataReq;
|
import org.dromara.cailiaoshebei.domain.bo.MasterDataReq;
|
||||||
import org.dromara.cailiaoshebei.domain.bo.TotalsupplyplanQueryListReq;
|
import org.dromara.cailiaoshebei.domain.bo.TotalsupplyplanQueryListReq;
|
||||||
import org.dromara.cailiaoshebei.domain.dto.MasterDataReqDto;
|
import org.dromara.cailiaoshebei.domain.dto.MasterDataReqDto;
|
||||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanAuditVo;
|
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanAuditVo;
|
||||||
|
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
||||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanAuditService;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
||||||
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.domain.R;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.cailiaoshebei.domain.vo.BusTotalsupplyplanVo;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.cailiaoshebei.domain.bo.BusTotalsupplyplanBo;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.cailiaoshebei.service.IBusTotalsupplyplanService;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 物资-总供应计划
|
* 物资-总供应计划
|
||||||
@ -82,6 +83,16 @@ public class BusTotalsupplyplanController extends BaseController {
|
|||||||
ExcelUtil.exportExcel(list, "物资-总供应计划", BusTotalsupplyplanVo.class, response);
|
ExcelUtil.exportExcel(list, "物资-总供应计划", BusTotalsupplyplanVo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入物资-总供应计划数据
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("design:totalsupplyplan:import")
|
||||||
|
@Log(title = "物资-总供应计划", businessType = BusinessType.IMPORT)
|
||||||
|
@PostMapping("/import")
|
||||||
|
public R<Void> importData(@RequestPart("file") MultipartFile file) {
|
||||||
|
return toAjax(busTotalsupplyplanService.importData(file));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取物资-总供应计划详细信息
|
* 获取物资-总供应计划详细信息
|
||||||
*
|
*
|
||||||
@ -90,7 +101,7 @@ public class BusTotalsupplyplanController extends BaseController {
|
|||||||
@SaCheckPermission("design:totalsupplyplan:query")
|
@SaCheckPermission("design:totalsupplyplan:query")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<BusTotalsupplyplanVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<BusTotalsupplyplanVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Long id) {
|
@PathVariable Long id) {
|
||||||
return R.ok(busTotalsupplyplanService.queryById(id));
|
return R.ok(busTotalsupplyplanService.queryById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,6 +127,17 @@ public class BusTotalsupplyplanController extends BaseController {
|
|||||||
return toAjax(busTotalsupplyplanService.updateByBo(bo));
|
return toAjax(busTotalsupplyplanService.updateByBo(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量修改物资-总供应计划
|
||||||
|
*/
|
||||||
|
@SaCheckPermission("design:totalsupplyplan:batchEdit")
|
||||||
|
@Log(title = "物资-总供应计划", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping("/batchEdit")
|
||||||
|
public R<Void> batchEdit(@Validated(EditGroup.class) @RequestBody List<BusTotalsupplyplanBo> boList) {
|
||||||
|
return toAjax(busTotalsupplyplanService.updateBatch(boList));
|
||||||
|
}
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * 删除物资-总供应计划
|
// * 删除物资-总供应计划
|
||||||
// *
|
// *
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user