Compare commits

...

11 Commits

Author SHA1 Message Date
29e5591653 验收修改 2024-07-04 13:56:39 +08:00
df7cc88165 BUG修复 2024-05-17 11:35:09 +08:00
b052aa9fe1 优化 2023-12-05 15:37:07 +08:00
80540895cd 优化 2023-09-21 09:08:08 +08:00
1cdc297a9b 文件上传 2023-09-08 10:30:46 +08:00
f9306c82d5 中文乱码错误 2023-09-07 11:44:57 +08:00
2be6c852ef 登录加密 2023-08-07 10:23:58 +08:00
2183a89192 优化 2023-08-01 10:41:20 +08:00
a1e863568b 密码复杂度 2023-07-19 17:30:43 +08:00
552c19bfeb 优化 2023-07-19 16:44:09 +08:00
49d213e988 优化 2023-07-19 16:40:32 +08:00
13 changed files with 107 additions and 79 deletions

View File

@ -107,7 +107,7 @@ public class Aes {
cipher.init(Cipher.DECRYPT_MODE, skey); cipher.init(Cipher.DECRYPT_MODE, skey);
byte[] result = cipher.doFinal(new Base64().decode(content)); byte[] result = cipher.doFinal(new Base64().decode(content));
// 解密 // 解密
return new String(result); return new String(result, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage()); log.error(e.getMessage());
} }
@ -115,9 +115,9 @@ public class Aes {
} }
public static void main(String[] args) { public static void main(String[] args) {
String content = "RaxMRsBUfFDjz_U_7LB_TJHqPNDVlpiOtkdqhZMTDoW3bHbfHnQ8_wuKIcVJemVn".replace("-", "+").replace("_", "/"); String content = "grWn9TcbYmxu0KjA5utvyX38gGTPleC86M5PM8CuFmnqBaSNY0UV2xjn4EyijUZdkQtOPmES+ElFMTEXaiWo0Q==";
// System.out.println("RaxMRsBUfFDjz/U/7LB/TBRIDE/1I6ZZ9kmQFWqgLCID42evqzeC8kpDSd3GM7YB".replace("+", "-").replace("/", "_")); // System.out.println("RaxMRsBUfFDjz/U/7LB/TBRIDE/1I6ZZ9kmQFWqgLCID42evqzeC8kpDSd3GM7YB".replace("+", "-").replace("/", "_"));
// System.out.println(encrypt("{\"uid\":\"test\",\"exp\":1686559180478}", "ssologin66!@#$%^")); // System.out.println(encrypt("{\"uid\":\"test\",\"exp\":1686559180478}", "ssologin66!@#$%^"));
System.out.println(decrypt(content, "ssologin66!@#$%^")); System.out.println(decrypt(content, KEY));
} }
} }

View File

@ -97,11 +97,6 @@ public class DataScopeHandler implements DataPermissionHandler {
inExpression(getAliasColumn(plainSelect, getEngineeringSn()), engineeringSns, plainSelect); inExpression(getAliasColumn(plainSelect, getEngineeringSn()), engineeringSns, plainSelect);
} }
if (user.getAccountType() == 2) { if (user.getAccountType() == 2) {
Expression plainSelectWhere = plainSelect.getWhere();
String whereString = plainSelectWhere.toString();
if (!whereString.contains(getEngineeringSn() + " =") && !plainSelect.getFromItem().toString().split(" ")[0].equals("engineering")) {
equalsTo(getAliasColumn(plainSelect, getEngineeringSn()), "", plainSelect);
}
List<String> projectSns = projectService.getSnListForGov(user.getSn()); List<String> projectSns = projectService.getSnListForGov(user.getSn());
if (projectSns.size() == 0) { if (projectSns.size() == 0) {
projectSns.add("0"); projectSns.add("0");

View File

@ -1,12 +1,6 @@
package com.zhgd.xmgl.config; package com.zhgd.xmgl.config;
import com.arcsoft.face.ActiveFileInfo;
import com.arcsoft.face.EngineConfiguration;
import com.arcsoft.face.FaceEngine; import com.arcsoft.face.FaceEngine;
import com.arcsoft.face.FunctionConfiguration;
import com.arcsoft.face.enums.DetectMode;
import com.arcsoft.face.enums.DetectOrient;
import com.arcsoft.face.enums.ErrorInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner; import org.springframework.boot.CommandLineRunner;
@ -38,55 +32,55 @@ public class FaceRunner implements CommandLineRunner {
@Override @Override
public void run(String... args) throws Exception { public void run(String... args) throws Exception {
String os = System.getProperty("os.name"); // String os = System.getProperty("os.name");
log.info("服务器系统" + os); // log.info("服务器系统" + os);
//如果是Windows系统 // //如果是Windows系统
if (os.toLowerCase().startsWith("win") || os.toLowerCase().startsWith("linux")) { // if (os.toLowerCase().startsWith("win") || os.toLowerCase().startsWith("linux")) {
String sdkKey = ""; // String sdkKey = "";
if (os.toLowerCase().startsWith("linux")) { // if (os.toLowerCase().startsWith("linux")) {
sdkKey = linuxSdkKey; // sdkKey = linuxSdkKey;
} else { // } else {
sdkKey = winsSdkKey; // sdkKey = winsSdkKey;
} // }
//log.info(HCNetSDKPath.DLL_PATH+"dll"); // //log.info(HCNetSDKPath.DLL_PATH+"dll");
log.info(dllPath); // log.info(dllPath);
faceEngine = new FaceEngine(dllPath); // faceEngine = new FaceEngine(dllPath);
//激活引擎 // //激活引擎
int errorCode = faceEngine.activeOnline(appId, sdkKey); // int errorCode = faceEngine.activeOnline(appId, sdkKey);
//
if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) { // if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {
log.info("引擎激活失败,errorCode:" + errorCode); // log.info("引擎激活失败,errorCode:" + errorCode);
} // }
//
//
ActiveFileInfo activeFileInfo = new ActiveFileInfo(); // ActiveFileInfo activeFileInfo = new ActiveFileInfo();
errorCode = faceEngine.getActiveFileInfo(activeFileInfo); // errorCode = faceEngine.getActiveFileInfo(activeFileInfo);
if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) { // if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {
log.info("获取激活文件信息失败"); // log.info("获取激活文件信息失败");
} // }
//
//引擎配置 // //引擎配置
EngineConfiguration engineConfiguration = new EngineConfiguration(); // EngineConfiguration engineConfiguration = new EngineConfiguration();
engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE); // engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);
engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_ALL_OUT); // engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_ALL_OUT);
engineConfiguration.setDetectFaceMaxNum(10); // engineConfiguration.setDetectFaceMaxNum(10);
engineConfiguration.setDetectFaceScaleVal(16); // engineConfiguration.setDetectFaceScaleVal(16);
//功能配置 // //功能配置
FunctionConfiguration functionConfiguration = new FunctionConfiguration(); // FunctionConfiguration functionConfiguration = new FunctionConfiguration();
functionConfiguration.setSupportAge(true); // functionConfiguration.setSupportAge(true);
functionConfiguration.setSupportFace3dAngle(true); // functionConfiguration.setSupportFace3dAngle(true);
functionConfiguration.setSupportFaceDetect(true); // functionConfiguration.setSupportFaceDetect(true);
functionConfiguration.setSupportFaceRecognition(true); // functionConfiguration.setSupportFaceRecognition(true);
functionConfiguration.setSupportGender(true); // functionConfiguration.setSupportGender(true);
functionConfiguration.setSupportLiveness(true); // functionConfiguration.setSupportLiveness(true);
functionConfiguration.setSupportIRLiveness(true); // functionConfiguration.setSupportIRLiveness(true);
engineConfiguration.setFunctionConfiguration(functionConfiguration); // engineConfiguration.setFunctionConfiguration(functionConfiguration);
//初始化引擎 // //初始化引擎
errorCode = faceEngine.init(engineConfiguration); // errorCode = faceEngine.init(engineConfiguration);
//
if (errorCode != ErrorInfo.MOK.getValue()) { // if (errorCode != ErrorInfo.MOK.getValue()) {
log.info("初始化引擎失败"); // log.info("初始化引擎失败");
} // }
} // }
} }
} }

View File

@ -67,12 +67,10 @@ public class FileController {
@ApiOperation(value = "BASE64文件上传", notes = "BASE64文件上传", httpMethod="POST") @ApiOperation(value = "BASE64文件上传", notes = "BASE64文件上传", httpMethod="POST")
@ApiImplicitParam(name = "base64", value = "BASE64字符串", required = true, dataType = "String") @ApiImplicitParam(name = "base64", value = "BASE64字符串", required = true, dataType = "String")
@PostMapping("/uploadBase64") @PostMapping("/uploadBase64")
public Result<FileInfo> uploadBase64(@ApiIgnore @RequestBody Map<String, Object> map) { public Result<Map<String, Object>> uploadBase64(@ApiIgnore @RequestBody Map<String, Object> map) {
String base64 = MapUtils.getString(map, "base64"); String base64 = MapUtils.getString(map, "base64");
MultipartFile multipartFile = FileUtil.base64toMultipart(base64, "text.jpg"); MultipartFile multipartFile = FileUtil.base64toMultipart(base64, "text.jpg");
return Result.success(fileStorageService.of(multipartFile) return Result.success(fileDetailService.upload(multipartFile));
.setPlatform("minio-1") //使用指定的存储平台
.upload());
} }

View File

@ -78,8 +78,8 @@ public class SystemUserAuthController {
public Result<SystemUserAuthDto> login(@ApiIgnore @RequestBody SystemUser systemUser) { public Result<SystemUserAuthDto> login(@ApiIgnore @RequestBody SystemUser systemUser) {
Result<SystemUserAuthDto> result = new Result<SystemUserAuthDto>(); Result<SystemUserAuthDto> result = new Result<SystemUserAuthDto>();
SystemUser user = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery() SystemUser user = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery()
.eq(SystemUser::getAccount, systemUser.getAccount()) .eq(SystemUser::getAccount, Aes.decrypt(systemUser.getAccount()))
.eq(SystemUser::getShowPassword, systemUser.getShowPassword())); .eq(SystemUser::getShowPassword, Aes.decrypt(systemUser.getShowPassword())));
SystemUserAuthDto userInfo = new SystemUserAuthDto(); SystemUserAuthDto userInfo = new SystemUserAuthDto();
checkLogin(user, userInfo, result); checkLogin(user, userInfo, result);
if (result.getCode() != CommonConstant.SC_INTERNAL_SERVER_ERROR_500) { if (result.getCode() != CommonConstant.SC_INTERNAL_SERVER_ERROR_500) {

View File

@ -8,6 +8,7 @@ import com.zhgd.xmgl.modules.basicdata.entity.SystemUser;
import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService; import com.zhgd.xmgl.modules.basicdata.service.IEnterpriseService;
import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService; import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo; import com.zhgd.xmgl.modules.basicdata.vo.EnterpriseVo;
import com.zhgd.xmgl.util.CommonUtil;
import com.zhgd.xmgl.valid.AddGroup; import com.zhgd.xmgl.valid.AddGroup;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@ -51,6 +52,10 @@ public class EntEnterpriseController {
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<Enterprise> add(@RequestBody @Validated(AddGroup.class) EnterpriseVo enterpriseVo) { public Result<Enterprise> add(@RequestBody @Validated(AddGroup.class) EnterpriseVo enterpriseVo) {
Result<Enterprise> result = new Result<Enterprise>(); Result<Enterprise> result = new Result<Enterprise>();
if (!CommonUtil.checkStrongPwd(enterpriseVo.getPassword())) {
result.error500("密码必须包含数字、大小写字母、特殊符号且大于8位");
return result;
}
// 检验企业账号是否已存在 // 检验企业账号是否已存在
SystemUser systemUser = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, enterpriseVo.getAccount())); SystemUser systemUser = systemUserService.getOne(Wrappers.<SystemUser>lambdaQuery().eq(SystemUser::getAccount, enterpriseVo.getAccount()));
if (systemUser != null) { if (systemUser != null) {

View File

@ -13,6 +13,7 @@ import com.zhgd.xmgl.modules.basicdata.service.ISystemUserService;
import com.zhgd.xmgl.modules.basicdata.vo.ProjectVo; import com.zhgd.xmgl.modules.basicdata.vo.ProjectVo;
import com.zhgd.xmgl.security.SecurityUser; import com.zhgd.xmgl.security.SecurityUser;
import com.zhgd.xmgl.security.SecurityUtil; import com.zhgd.xmgl.security.SecurityUtil;
import com.zhgd.xmgl.util.CommonUtil;
import com.zhgd.xmgl.valid.AddGroup; import com.zhgd.xmgl.valid.AddGroup;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
@ -60,6 +61,10 @@ public class ProjectController {
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<Project> add(@RequestBody @Validated(AddGroup.class) ProjectVo projectVo) { public Result<Project> add(@RequestBody @Validated(AddGroup.class) ProjectVo projectVo) {
Result<Project> result = new Result<Project>(); Result<Project> result = new Result<Project>();
if (!CommonUtil.checkStrongPwd(projectVo.getPassword())) {
result.error500("密码必须包含数字、大小写字母、特殊符号且大于8位");
return result;
}
// 检验该政务项目数是否已满 // 检验该政务项目数是否已满
int install = projectService.count(Wrappers.<Project>lambdaQuery().eq(Project::getGovernmentSn, projectVo.getGovernmentSn())); int install = projectService.count(Wrappers.<Project>lambdaQuery().eq(Project::getGovernmentSn, projectVo.getGovernmentSn()));
int auth = governmentService.getOne(Wrappers.<Government>lambdaQuery().eq(Government::getGovernmentSn, projectVo.getGovernmentSn())).getAuthProject(); int auth = governmentService.getOne(Wrappers.<Government>lambdaQuery().eq(Government::getGovernmentSn, projectVo.getGovernmentSn())).getAuthProject();

View File

@ -60,11 +60,13 @@ public class EngineeringSingleServiceImpl extends ServiceImpl<EngineeringSingleM
for (EngineeringMain engineeringMain : engineeringVo.getEngineeringMains()) { for (EngineeringMain engineeringMain : engineeringVo.getEngineeringMains()) {
engineeringMain.setEngineeringSn(engineeringVo.getEngineeringSn()); engineeringMain.setEngineeringSn(engineeringVo.getEngineeringSn());
engineeringMainService.save(engineeringMain); engineeringMainService.save(engineeringMain);
for (EngineeringMainPerson engineeringMainPerson : engineeringMain.getEngineeringMainPersonList()) { if(engineeringMain.getEngineeringMainPersonList() != null) {
engineeringMainPerson.setMainId(engineeringMain.getId()); for (EngineeringMainPerson engineeringMainPerson : engineeringMain.getEngineeringMainPersonList()) {
engineeringMainPerson.setEngineeringSn(engineeringVo.getEngineeringSn()); engineeringMainPerson.setMainId(engineeringMain.getId());
engineeringMainPerson.setEngineeringSn(engineeringVo.getEngineeringSn());
}
engineeringMainPersonService.saveBatch(engineeringMain.getEngineeringMainPersonList());
} }
engineeringMainPersonService.saveBatch(engineeringMain.getEngineeringMainPersonList());
EnterpriseScore enterpriseScore = new EnterpriseScore(); EnterpriseScore enterpriseScore = new EnterpriseScore();
enterpriseScore.setEnterpriseSn(engineeringMain.getEnterpriseSn()); enterpriseScore.setEnterpriseSn(engineeringMain.getEnterpriseSn());
enterpriseScore.setEngineeringSn(engineeringVo.getEngineeringSn()); enterpriseScore.setEngineeringSn(engineeringVo.getEngineeringSn());

View File

@ -110,6 +110,9 @@ public class FileDetailServiceImpl extends ServiceImpl<FileDetailMapper, FileDet
result.put("url", imagePath + rName); result.put("url", imagePath + rName);
result.put("originalFilename", orgName); result.put("originalFilename", orgName);
result.put("filename", rName); result.put("filename", rName);
result.put("size", file.getSize());
result.put("contentType", file.getContentType());
result.put("ext", fileExtension);
} catch (Exception ex) { } catch (Exception ex) {
log.error(ex.getMessage()); log.error(ex.getMessage());
} }

View File

@ -3,7 +3,7 @@ http.port=6023
server.port=6688 server.port=6688
# 数据库配置 # 数据库配置
#182.90.224.147 #182.90.224.147
spring.datasource.url=jdbc:mysql://localhost:3306/wisdomsitezw?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false spring.datasource.url=jdbc:mysql://localhost:3306/wisdomsitezw_huancui?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&autoReconnect=true&useSSL=false
# 数据库加密配置 # 数据库加密配置
#spring.datasource.username=ENC(XR4C/hvTYCUqudS49Wh/jA==) #spring.datasource.username=ENC(XR4C/hvTYCUqudS49Wh/jA==)
#spring.datasource.password=ENC(hHkiHEc6vSWjqfOtg2/2Uiihs0vX3l7V) #spring.datasource.password=ENC(hHkiHEc6vSWjqfOtg2/2Uiihs0vX3l7V)

View File

@ -5,7 +5,7 @@
"groupId" : "1f3d3e5b9fe340bab84de67b0de08f44", "groupId" : "1f3d3e5b9fe340bab84de67b0de08f44",
"name" : "在建项目指标", "name" : "在建项目指标",
"createTime" : null, "createTime" : null,
"updateTime" : 1688352901714, "updateTime" : 1689678565388,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : "admin", "updateBy" : "admin",
@ -34,4 +34,4 @@
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
return db.selectOne("SELECT IFNULL(SUM(IF(major_project_type = 1, 1, 0)), 0) importance, IFNULL(SUM(IF(project_type = 1 AND state = 1, 1, 0)), 0) bridge, IFNULL(SUM(IF(project_type = 2 AND state = 1, 1, 0)), 0) tunnel, IFNULL(SUM(IF(project_type = 3 AND state = 1, 1, 0)), 0) station, IFNULL(SUM(IF(build_status in (0,1), 1, 0)), 0) newBuild, IFNULL(SUM(IF(build_status = 5, 1, 0)), 0) reBuild, IFNULL(SUM(IF(build_status = 6, 1, 0)), 0) extension, IFNULL(SUM(IF(build_status in (1, 5, 6), 1, 0)), 0) total, IFNULL(SUM(IF(build_status = 4, 1, 0)), 0) finished, IFNULL(SUM(IF(build_status = 2, 1, 0)), 0) shutdown, IFNULL(SUM(IF(build_status in (1, 2, 4), 1, 0)), 0) total1 FROM project WHERE #project ") return db.selectOne("SELECT IFNULL(SUM(IF(major_project_type = 1 AND state = 1, 1, 0)), 0) importance, IFNULL(SUM(IF(project_type = 1 AND state = 1, 1, 0)), 0) bridge, IFNULL(SUM(IF(project_type = 2 AND state = 1, 1, 0)), 0) tunnel, IFNULL(SUM(IF(project_type = 3 AND state = 1, 1, 0)), 0) station, IFNULL(SUM(IF(build_status in (0,1) AND state = 1, 1, 0)), 0) newBuild, IFNULL(SUM(IF(build_status = 5, 1, 0)), 0) reBuild, IFNULL(SUM(IF(build_status = 6, 1, 0)), 0) extension, IFNULL(SUM(IF(build_status in (0, 1, 5, 6) AND state = 1, 1, 0)), 0) total, IFNULL(SUM(IF(build_status = 4, 1, 0)), 0) finished, IFNULL(SUM(IF(build_status = 2, 1, 0)), 0) shutdown, IFNULL(SUM(IF(build_status in (1, 2, 4), 1, 0)), 0) total1 FROM project WHERE #project ")

View File

@ -5,7 +5,7 @@
"groupId" : "1f3d3e5b9fe340bab84de67b0de08f44", "groupId" : "1f3d3e5b9fe340bab84de67b0de08f44",
"name" : "投资管理", "name" : "投资管理",
"createTime" : null, "createTime" : null,
"updateTime" : 1688970096225, "updateTime" : 1689561440845,
"lock" : null, "lock" : null,
"createBy" : "admin", "createBy" : "admin",
"updateBy" : "admin", "updateBy" : "admin",
@ -39,7 +39,8 @@ BigDecimal big = new BigDecimal(10000);
result.put("paymentByMonth", paymentByMonth.divide(big)) result.put("paymentByMonth", paymentByMonth.divide(big))
result.put("applyAmountByMonth", applyAmountByMonth.divide(big)) result.put("applyAmountByMonth", applyAmountByMonth.divide(big))
result.put("realPayAmountByMonth", realPayAmountByMonth.divide(big)) result.put("realPayAmountByMonth", realPayAmountByMonth.divide(big))
result.put("unPayAmountByMonth", applyAmountByMonth.subtract(realPayAmountByMonth).divide(big)) var unPayAmountByMonth = applyAmountByMonth.subtract(realPayAmountByMonth);
result.put("unPayAmountByMonth", unPayAmountByMonth > 0 ? unPayAmountByMonth.divide(big) : 0)
result.put("totalAmount", totalAmount.divide(big)) result.put("totalAmount", totalAmount.divide(big))
result.put("payRatio", realPayAmountTotal == 0 ? 0 : realPayAmountTotal.divide(totalAmount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).doubleValue()) result.put("payRatio", realPayAmountTotal == 0 ? 0 : realPayAmountTotal.divide(totalAmount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")).doubleValue())

View File

@ -0,0 +1,25 @@
{
"properties" : { },
"id" : "3f938e315b6a4570aa511131dec63fbd",
"script" : null,
"groupId" : "485e36d471af4f809398babc4abadafe",
"name" : "查询项目详细信息",
"createTime" : null,
"updateTime" : 1689755920273,
"lock" : null,
"createBy" : null,
"updateBy" : "admin",
"path" : "/api/index/projectList",
"method" : "GET",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null
}
================================
return db.select("SELECT * FROM project WHERE state = 1 AND #gov")