兴安优化提交

This commit is contained in:
zc
2025-07-14 15:48:19 +08:00
parent 7fe428453d
commit 25c48baa86
16 changed files with 84 additions and 29 deletions

View File

@@ -362,10 +362,10 @@ public class SysLoginService
smsDTO.setTemplateId(smsProperties.getTemplate11());
smsDTO.setCaptcha(smsCode);
smsDTO.setPhone(register.getPhone());
// AjaxResult ajaxResult = remoteUserService.sendMessage(smsDTO, SecurityConstants.INNER);
// if (!ajaxResult.isSuccess()) {
// throw new ServiceException(ajaxResult.get("msg").toString());
// }
AjaxResult ajaxResult = remoteUserService.sendMessage(smsDTO, SecurityConstants.INNER);
if (!ajaxResult.isSuccess()) {
throw new ServiceException(ajaxResult.get("msg").toString());
}
//缓存次数
int i = 1;

View File

@@ -294,10 +294,54 @@ public class SysFileController
throw new RuntimeException(e);
}
}
// initFlowRules();
// //上传前进行人脸检测
// String imgBase64 = MinioUtil.getBase64String(file);
// checkPhoto(imgBase64);
initFlowRules();
//上传前进行人脸检测
String imgBase64 = MinioUtil.getBase64String(file);
checkPhoto(imgBase64);
// 上传并返回访问地址
String fileNames = FileUploadUtils.uploadMinio(file, this.bucketName1, fileName);
SysFile sysFile = new SysFile();
sysFile.setName(FileUtils.getName(fileNames));
fileNames = fileNames.replace(miniourl, miniogwurl);
sysFile.setUrl(fileNames);
return R.ok(sysFile);
} catch (Exception e) {
log.error("上传文件失败", e);
return R.fail(e.getMessage());
}
}
/**
* 文件非证件照上传请求
*/
@PostMapping("uploadMinio3")
public R<SysFile> uploadMinio3(MultipartFile file, String fileName) {
try {
//判断压缩图片
if ((1024 * 1024 * 0.1) <= file.getSize()) {
// 小于 1M 的
try {
String fileNames1 = file.getOriginalFilename();
File newFile = new File(fileNames1);
if ((1024 * 1024 * 0.1) <= file.getSize() && file.getSize() <= (1024 * 1024)) {
Thumbnails.of(file.getInputStream()).scale(1f).outputQuality(0.4f).toFile(newFile);
}
// 1 - 2M 的
else if ((1024 * 1024) < file.getSize() && file.getSize() <= (1024 * 1024 * 2)) {
Thumbnails.of(file.getInputStream()).scale(1f).outputQuality(0.2f).toFile(newFile);
}
// 2M 以上的
else if ((1024 * 1024 * 2) < file.getSize()) {
Thumbnails.of(file.getInputStream()).scale(1f).outputQuality(0.1f).toFile(newFile);
}
// 转为 MultipartFile
file = PictureUtils.getMultipartFile(newFile);
newFile.delete();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
// 上传并返回访问地址
String fileNames = FileUploadUtils.uploadMinio(file, this.bucketName1, fileName);

View File

@@ -148,7 +148,7 @@ public class SysEmpowerRecordController extends BaseController
if("true".equals(cloud)){
for(Long id:ids){
SysEmpowerRecord record=sysEmpowerRecordService.selectSysEmpowerRecordById(id);
String data=sysApiService.authDeviceRevoke(equipmentService.selectSysEquipmentById(record.getEquipmentId()),peopleService.selectSysPeopleById(Long.parseLong(record.getPeopleId())));
String data=sysApiService.authDeviceRevoke(equipmentService.selectSysEquipmentById(record.getEquipmentId()),peopleService.selectSysPeopleById(record.getPeopleId()));
JSONObject json= JSONObject.parseObject(data);
if(!"1".equals(json.get("result")+"")){
return error(json.get("msg")+"");
@@ -204,13 +204,13 @@ public class SysEmpowerRecordController extends BaseController
SysEmpowerRecord record = sysEmpowerRecordService.selectSysEmpowerRecordById(id);
record.setStatus(type);
if ("1".equals(type)) {//禁用
String data = sysApiService.authDeviceRevoke(equipmentService.selectSysEquipmentById(record.getEquipmentId()), peopleService.selectSysPeopleById(Long.parseLong(record.getPeopleId())));
String data = sysApiService.authDeviceRevoke(equipmentService.selectSysEquipmentById(record.getEquipmentId()), peopleService.selectSysPeopleById(record.getPeopleId()));
JSONObject json = JSONObject.parseObject(data);
if (!"1".equals(json.get("result") + "")) {
return error(json.get("msg") + "");
}
} else {
String data = sysApiService.authDevice(ruleService.selectSysRuleById(record.getRuleId()), peopleService.selectSysPeopleById(Long.parseLong(record.getPeopleId())), equipmentService.selectSysEquipmentById(record.getEquipmentId()));
String data = sysApiService.authDevice(ruleService.selectSysRuleById(record.getRuleId()), peopleService.selectSysPeopleById(record.getPeopleId()), equipmentService.selectSysEquipmentById(record.getEquipmentId()));
JSONObject json = JSONObject.parseObject(data);
if (!"1".equals(json.get("result") + "")) {
return error(json.get("msg") + "");
@@ -230,7 +230,7 @@ public class SysEmpowerRecordController extends BaseController
sdkService.personDelete(peopleEquipment.getGuid(), equipment.getIp(), equipment.getPassword());
}
} else {
String data = sdkService.authDevice(ruleService.selectSysRuleById(record.getRuleId()), peopleService.selectSysPeopleById(Long.parseLong(record.getPeopleId())), equipmentService.selectSysEquipmentById(record.getEquipmentId()));
String data = sdkService.authDevice(ruleService.selectSysRuleById(record.getRuleId()), peopleService.selectSysPeopleById(record.getPeopleId()), equipmentService.selectSysEquipmentById(record.getEquipmentId()));
JSONObject json = JSONObject.parseObject(data);
if (!"1".equals(json.get("result") + "")) {
return error(json.get("msg") + "");

View File

@@ -471,7 +471,6 @@ public class SysPeopleController extends BaseController
}
}
SysPeople peopleInfo = sysPeopleService.selectSysPeopleById(sysPeople.getId());
return toAjax(sysPeopleService.updateSysPeople(sysPeople));
}

View File

@@ -28,7 +28,7 @@ public class SysEmpowerRecord extends BaseEntity
/** 人员id */
@Excel(name = "人员id")
private String peopleId;
private Long peopleId;
/** 信息下发0成功 1失败 */
@Excel(name = "信息下发", readConverterExp = "0=成功,1=失败")

View File

@@ -120,7 +120,7 @@ public class SysPeople extends BaseEntity
private String visitorRegisterId;
/**
* 携物出门审核人员,01一级审核人2二级审核人3三级审核人
* 携物出门审核人员1一级审核人2二级审核人3三级审核人
*/
private String carryStuffExamine;

View File

@@ -61,7 +61,7 @@ public interface SysPeopleEquipmentMapper
public SysPeopleEquipment selectSysPeopleEquipmentByGuId(String guid);
public List<SysPeopleEquipment> selectSysPeopleEquipmentByPeopleId(String peopleId);
public List<SysPeopleEquipment> selectSysPeopleEquipmentByPeopleId(Long peopleId);
public List<SysPeopleEquipment> selectSysPeopleEquipmentByVisitorId(Long visitorId);

View File

@@ -73,7 +73,7 @@ public interface ISysPeopleEquipmentService
* @param id 人员设备下发信息主键
* @return 人员设备下发信息
*/
public List<SysPeopleEquipment> selectSysPeopleEquipmentByPeopleId(String peopleId);
public List<SysPeopleEquipment> selectSysPeopleEquipmentByPeopleId(Long peopleId);
public List<SysPeopleEquipment> selectSysPeopleEquipmentByVisitorId(Long visitorId);

View File

@@ -110,7 +110,7 @@ public class SysPeopleEquipmentServiceImpl implements ISysPeopleEquipmentService
* @return 人员设备下发信息
*/
@Override
public List<SysPeopleEquipment> selectSysPeopleEquipmentByPeopleId(String peopleId)
public List<SysPeopleEquipment> selectSysPeopleEquipmentByPeopleId(Long peopleId)
{
return sysPeopleEquipmentMapper.selectSysPeopleEquipmentByPeopleId(peopleId);
}

View File

@@ -186,7 +186,7 @@ public class SysSdkController {
Visitor visitor1 = visitorService.selectVisitorById(Long.parseLong(split[0]));
SysEmpowerRecord sysEmpowerRecord=new SysEmpowerRecord();
sysEmpowerRecord.setEquipmentId(equipment.getId());
sysEmpowerRecord.setPeopleId(String.valueOf(visitor1.getUserId()));
sysEmpowerRecord.setPeopleId(visitor1.getUserId());
List<SysEmpowerRecord> sysEmpowerRecordList = sysEmpowerRecordService.selectSysEmpowerRecordList(sysEmpowerRecord);
if(!CollectionUtils.isEmpty(sysEmpowerRecordList)){
SysRule rule=sysRuleService.selectSysRuleById(sysEmpowerRecordList.get(0).getRuleId());

View File

@@ -357,7 +357,7 @@ public class SysApiServiceImpl implements ISysApiService {
JSONObject json= JSONObject.parseObject(response);
if("1".equals(json.get("result")+"")){//授权记录保存
SysEmpowerRecord manageRecordDto=new SysEmpowerRecord();
manageRecordDto.setPeopleId(people.getId()+"");
manageRecordDto.setPeopleId(people.getId());
manageRecordDto.setEmpower(rule.getType());
manageRecordDto.setEquipmentId(e.getId());
manageRecordDto.setStatus("0");
@@ -366,7 +366,7 @@ public class SysApiServiceImpl implements ISysApiService {
empowerRecordService.insertSysEmpowerRecord(manageRecordDto);
}else{
SysEmpowerRecord manageRecordDto=new SysEmpowerRecord();
manageRecordDto.setPeopleId(people.getId()+"");
manageRecordDto.setPeopleId(people.getId());
manageRecordDto.setEmpower(rule.getType());
manageRecordDto.setEquipmentId(e.getId());
manageRecordDto.setStatus("0");

View File

@@ -375,7 +375,7 @@ public class SysSdkServiceImpl implements ISysSdkService {
//授权记录保存
if("1".equals(jsons.get("result")+"")){
SysEmpowerRecord manageRecordDto=new SysEmpowerRecord();
manageRecordDto.setPeopleId(people.getId()+"");
manageRecordDto.setPeopleId(people.getId());
manageRecordDto.setEmpower(rule.getType());
manageRecordDto.setEquipmentId(e.getId());
manageRecordDto.setStatus("0");
@@ -384,7 +384,7 @@ public class SysSdkServiceImpl implements ISysSdkService {
empowerRecordService.insertSysEmpowerRecord(manageRecordDto);
}else{
SysEmpowerRecord manageRecordDto=new SysEmpowerRecord();
manageRecordDto.setPeopleId(people.getId()+"");
manageRecordDto.setPeopleId(people.getId());
manageRecordDto.setEmpower(rule.getType());
manageRecordDto.setEquipmentId(e.getId());
manageRecordDto.setStatus("0");
@@ -608,7 +608,7 @@ public class SysSdkServiceImpl implements ISysSdkService {
sysPeopleEquipment.setFaceGuid(people.getFaceGuid());
peopleEquipmentService.insertSysPeopleEquipment(sysPeopleEquipment);
SysEmpowerRecord manageRecordDto=new SysEmpowerRecord();
manageRecordDto.setPeopleId(people.getId()+"");
manageRecordDto.setPeopleId(people.getId());
manageRecordDto.setEmpower(rule.getType());
manageRecordDto.setEquipmentId(e.getId());
manageRecordDto.setStatus("0");

View File

@@ -202,7 +202,7 @@ public class VisCarryStuffController extends BaseController {
//发送企微信息
try {
visitorController.sendWeCom(people.getPhone(), url + " --访客姓名:" + vo.getName());
// visitorController.sendWeCom(people.getPhone(), url + " --访客姓名:" + vo.getName());
} catch (Exception e) {
log.error("出门证申请add-sendWeCom异常", e);
throw new ServiceException("系统异常,请重新提交或联系管理员!");
@@ -308,10 +308,10 @@ public class VisCarryStuffController extends BaseController {
//发送企微信息
try {
visitorController.sendWeCom(people.getPhone(), url + " --访客姓名:" + vo.getName());
// visitorController.sendWeCom(people.getPhone(), url + " --访客姓名:" + vo.getName());
} catch (Exception e) {
log.error("出门证申请add-sendWeCom异常", e);
throw new ServiceException("系统异常,请重新提交或联系管理员!");
throw new ServiceException("系统异常,请重新审核或联系管理员!");
}
//审核拒绝
@@ -320,9 +320,10 @@ public class VisCarryStuffController extends BaseController {
visVisitorExamineService.insertVisVisitorExamine(examine);
try {
visitorController.sendWeCom(telephone, vo.getName() + "的访客审核已驳回");
// visitorController.sendWeCom(telephone, vo.getName() + "的访客审核已驳回");
} catch (Exception e) {
log.error("访客approve-sendWeCom驳回异常", e);
throw new ServiceException("系统异常,请重新审核或联系管理员!");
}
// 申请人发送短信(审核不通过)
SysPeople sysPeople1 = sysPeopleService.selectSysPeopleById(stuffVo.getUserId());

View File

@@ -1580,6 +1580,14 @@ public class VisitorController extends BaseController {
return AjaxResult.success();
}
@PostMapping("/test")
public AjaxResult test(@RequestBody JSONObject js) throws Exception {
String code = js.getString("code");
String template = js.getString("template");
return sendMessage("15155304840", code, template);
}
/**
* 查询访客记录列表
*

View File

@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectSysEmpowerRecordVo"/>
<where>
<if test="name != null and name != ''"> and ser.name like concat('%', #{name}, '%')</if>
<if test="peopleId != null and peopleId != ''"> and ser.people_id = #{peopleId}</if>
<if test="peopleId != null"> and ser.people_id = #{peopleId}</if>
<if test="peopleName != null and peopleName != ''"> and p.name like concat('%', #{peopleName}, '%')</if>
<if test="infoDown != null and infoDown != ''"> and ser.info_down = #{infoDown}</if>
<if test="empower != null and empower != ''"> and ser.empower = #{empower}</if>

View File

@@ -139,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="joinTime != null">join_time,</if>
<if test="down != null">down,</if>
<if test="delFlag != null">del_flag,</if>
<if test="carryStuffExamine != null and carryStuffExamine != ''">carry_stuff_examine,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
@@ -163,6 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="joinTime != null">#{joinTime},</if>
<if test="down != null">#{down},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="carryStuffExamine != null and carryStuffExamine != ''">#{carryStuffExamine},</if>
</trim>
</insert>
@@ -192,6 +194,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="down != null">down = #{down},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="openid != null">openid = #{openid},</if>
<if test="carryStuffExamine != null and carryStuffExamine != ''">carry_stuff_examine = #{carryStuffExamine},</if>
</trim>
where id = #{id}
</update>