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