bug
This commit is contained in:
@ -179,7 +179,7 @@ sms:
|
|||||||
# 配置源类型用于标定配置来源(interface,yaml)
|
# 配置源类型用于标定配置来源(interface,yaml)
|
||||||
config-type: yaml
|
config-type: yaml
|
||||||
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
|
# 用于标定yml中的配置是否开启短信拦截,接口配置不受此限制
|
||||||
restricted: true
|
restricted: false
|
||||||
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
|
# 短信拦截限制单手机号每分钟最大发送,只对开启了拦截的配置有效
|
||||||
minute-max: 1
|
minute-max: 1
|
||||||
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
|
# 短信拦截限制单手机号每日最大发送量,只对开启了拦截的配置有效
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import org.dromara.sms4j.core.factory.SmsFactory;
|
|||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
@ -21,7 +22,7 @@ public class AsyncUtil {
|
|||||||
public void sendSms(List<String> mobileList, String config) {
|
public void sendSms(List<String> mobileList, String config) {
|
||||||
SmsBlend smsBlend = SmsFactory.getSmsBlend(config);
|
SmsBlend smsBlend = SmsFactory.getSmsBlend(config);
|
||||||
for (String mobile : mobileList) {
|
for (String mobile : mobileList) {
|
||||||
SmsResponse smsResponse = smsBlend.sendMessage(mobile, (String) null);
|
SmsResponse smsResponse = smsBlend.sendMessage(mobile, new LinkedHashMap<String, String>());
|
||||||
if (!smsResponse.isSuccess()) {
|
if (!smsResponse.isSuccess()) {
|
||||||
log.error("验证码短信发送异常 => {}", smsResponse);
|
log.error("验证码短信发送异常 => {}", smsResponse);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package org.dromara.contractor.controller.app;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
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;
|
||||||
@ -136,7 +135,7 @@ public class SubConstructionUserAppController {
|
|||||||
@Log(title = "施工人员", businessType = BusinessType.OTHER)
|
@Log(title = "施工人员", businessType = BusinessType.OTHER)
|
||||||
@PostMapping("/face/comparison")
|
@PostMapping("/face/comparison")
|
||||||
public R<Boolean> faceComparison(@RequestParam("file") MultipartFile file) {
|
public R<Boolean> faceComparison(@RequestParam("file") MultipartFile file) {
|
||||||
return R.ok(constructionUserService.faceComparison(file));
|
return R.ok(constructionUserService.faceComparison(file,null ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -214,9 +214,10 @@ public interface ISubConstructionUserService extends IService<SubConstructionUse
|
|||||||
* 人脸识别
|
* 人脸识别
|
||||||
*
|
*
|
||||||
* @param file 图片文件
|
* @param file 图片文件
|
||||||
|
* @param userId
|
||||||
* @return 是否匹配成功
|
* @return 是否匹配成功
|
||||||
*/
|
*/
|
||||||
Boolean faceComparison(MultipartFile file);
|
Boolean faceComparison(MultipartFile file, Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据系统用户id查询施工人员
|
* 根据系统用户id查询施工人员
|
||||||
|
|||||||
@ -1419,14 +1419,17 @@ public class SubConstructionUserServiceImpl extends ServiceImpl<SubConstructionU
|
|||||||
* 人脸识别
|
* 人脸识别
|
||||||
*
|
*
|
||||||
* @param file 图片文件
|
* @param file 图片文件
|
||||||
|
* @param userId
|
||||||
* @return 是否匹配成功
|
* @return 是否匹配成功
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean faceComparison(MultipartFile file) {
|
public Boolean faceComparison(MultipartFile file, Long userId) {
|
||||||
String reqBase64 = this.getPicBase64(file);
|
String reqBase64 = this.getPicBase64(file);
|
||||||
HumanFaceReq request = new HumanFaceReq();
|
HumanFaceReq request = new HumanFaceReq();
|
||||||
request.setImage(reqBase64);
|
request.setImage(reqBase64);
|
||||||
Long userId = LoginHelper.getUserId();
|
if(userId == null){
|
||||||
|
userId = LoginHelper.getUserId();
|
||||||
|
}
|
||||||
SubConstructionUser constructionUser = this.getBySysUserId(userId);
|
SubConstructionUser constructionUser = this.getBySysUserId(userId);
|
||||||
if (constructionUser == null || StringUtils.isBlank(constructionUser.getFacePic())) {
|
if (constructionUser == null || StringUtils.isBlank(constructionUser.getFacePic())) {
|
||||||
throw new ServiceException("未进行实名认证");
|
throw new ServiceException("未进行实名认证");
|
||||||
|
|||||||
@ -621,7 +621,9 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D
|
|||||||
|
|
||||||
//异步发送消息 项目经理 设计部主任(1961028169115197442)
|
//异步发送消息 项目经理 设计部主任(1961028169115197442)
|
||||||
DesVolumeCatalog byId = volumeCatalogService.getById(desVolumeFile.getVolumeCatalogId());
|
DesVolumeCatalog byId = volumeCatalogService.getById(desVolumeFile.getVolumeCatalogId());
|
||||||
List<Long> longs = roleService.selectRoleIdsByName("项目经理");
|
ArrayList<Long> longs = new ArrayList<>();
|
||||||
|
List<Long> longs1 = roleService.selectRoleIdsByName("项目经理");
|
||||||
|
longs.addAll(longs1);
|
||||||
longs.add(1961028169115197442L);
|
longs.add(1961028169115197442L);
|
||||||
|
|
||||||
List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, byId.getProjectId());
|
List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, byId.getProjectId());
|
||||||
@ -693,9 +695,10 @@ public class DesVolumeFileServiceImpl extends ServiceImpl<DesVolumeFileMapper, D
|
|||||||
});
|
});
|
||||||
//异步发送消息 项目经理 设计部主任(1961028169115197442)
|
//异步发送消息 项目经理 设计部主任(1961028169115197442)
|
||||||
DesVolumeCatalog byId = volumeCatalogService.getById(desVolumeFile.getVolumeCatalogId());
|
DesVolumeCatalog byId = volumeCatalogService.getById(desVolumeFile.getVolumeCatalogId());
|
||||||
List<Long> longs = roleService.selectRoleIdsByName("项目经理");
|
ArrayList<Long> longs = new ArrayList<>();
|
||||||
|
List<Long> longs1 = roleService.selectRoleIdsByName("项目经理");
|
||||||
|
longs.addAll(longs1);
|
||||||
longs.add(1961028169115197442L);
|
longs.add(1961028169115197442L);
|
||||||
|
|
||||||
List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, byId.getProjectId());
|
List<SysUser> sysUsers = userService.selectUserByRoleIdsAndProjectId(longs, byId.getProjectId());
|
||||||
asyncUtil.sendSms(sysUsers.stream().map(SysUser::getPhonenumber).toList(), "config5");
|
asyncUtil.sendSms(sysUsers.stream().map(SysUser::getPhonenumber).toList(), "config5");
|
||||||
asyncUtil.sendSse(sysUsers.stream().map(SysUser::getUserId).toList(), "有新的蓝图审批完成");
|
asyncUtil.sendSse(sysUsers.stream().map(SysUser::getUserId).toList(), "有新的蓝图审批完成");
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import org.springframework.stereotype.Component;
|
|||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ -62,7 +63,7 @@ public class InspectionJob {
|
|||||||
if (phonenumber == null) {
|
if (phonenumber == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, (String) null);
|
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, new LinkedHashMap<String, String>());
|
||||||
if (!smsResponse.isSuccess()) {
|
if (!smsResponse.isSuccess()) {
|
||||||
log.error("验证码短信发送异常 => {}", smsResponse);
|
log.error("验证码短信发送异常 => {}", smsResponse);
|
||||||
}
|
}
|
||||||
@ -105,7 +106,7 @@ public class InspectionJob {
|
|||||||
if (phonenumber == null) {
|
if (phonenumber == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, (String) null);
|
SmsResponse smsResponse = smsBlend.sendMessage(phonenumber, new LinkedHashMap<String, String>());
|
||||||
if (!smsResponse.isSuccess()) {
|
if (!smsResponse.isSuccess()) {
|
||||||
log.error("验证码短信发送异常 => {}", smsResponse);
|
log.error("验证码短信发送异常 => {}", smsResponse);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,6 @@ import jakarta.annotation.Resource;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.apache.poi.ss.util.CellRangeAddress;
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
@ -356,7 +355,7 @@ public class BusAttendanceServiceImpl extends ServiceImpl<BusAttendanceMapper, B
|
|||||||
Boolean result = false;
|
Boolean result = false;
|
||||||
// 进行人脸比对
|
// 进行人脸比对
|
||||||
try {
|
try {
|
||||||
result = constructionUserService.faceComparison(file);
|
result = constructionUserService.faceComparison(file, userId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new ServiceException("人脸识别失败,请重新识别", HttpStatus.ERROR);
|
throw new ServiceException("人脸识别失败,请重新识别", HttpStatus.ERROR);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user