APP接口修改

This commit is contained in:
cwchen 2024-08-21 09:41:32 +08:00
parent 92d001f569
commit 79e3b7b7c2
5 changed files with 64 additions and 33 deletions

View File

@ -52,8 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
tw.warn_content AS warnContent tw.warn_content AS warnContent
FROM tb_warn tw FROM tb_warn tw
LEFT JOIN tb_device td ON tw.dev_id = td.id LEFT JOIN tb_device td ON tw.dev_id = td.id
LEFT JOIN tb_dev_ly tdl ON td.id = tdl.dev_id WHERE tw.team_id = #{id} AND td.dev_type = #{devType}
WHERE tdl.team_id = #{id} AND td.dev_type = #{devType}
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''"> <if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
AND DATE_FORMAT(tw.warn_time, '%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} AND DATE_FORMAT(tw.warn_time, '%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
</if> </if>

View File

@ -47,27 +47,27 @@ public class PersonMgeController extends BaseController {
@Resource(name = "PersonMgeMapper") @Resource(name = "PersonMgeMapper")
private PersonMgeMapper mapper; private PersonMgeMapper mapper;
// @RequiresPermissions("basic:person:list") // @RequiresPermissions("basic:person:list")
@GetMapping("list") @GetMapping("list")
@SysLog(title = "人员管理", businessType = OperaType.QUERY,logType = 0,module = "基础管理->人员管理",details ="查询人员列表") @SysLog(title = "人员管理", businessType = OperaType.QUERY, logType = 0, module = "基础管理->人员管理", details = "查询人员列表")
public TableDataInfo list(BraceletParamsDto dto) { public TableDataInfo list(BraceletParamsDto dto) {
System.err.println("开始"+DateTimeHelper.getNowTime()); System.err.println("开始" + DateTimeHelper.getNowTime());
startPage(); startPage();
TableDataInfo tableDataInfo = service.getPersonLists(dto); TableDataInfo tableDataInfo = service.getPersonLists(dto);
System.err.println("结束"+DateTimeHelper.getNowTime()); System.err.println("结束" + DateTimeHelper.getNowTime());
return tableDataInfo; return tableDataInfo;
} }
// @RequiresPermissions("basic:person:add") // @RequiresPermissions("basic:person:add")
@PostMapping("addPerson") @PostMapping("addPerson")
@SysLog(title = "人员管理", businessType = OperaType.INSERT,logType = 0,module = "基础管理->人员管理",details ="新增人员" ) @SysLog(title = "人员管理", businessType = OperaType.INSERT, logType = 0, module = "基础管理->人员管理", details = "新增人员")
public AjaxResult add(HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file, String params) { public AjaxResult add(HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file, String params) {
return service.addPerson(file, params); return service.addPerson(file, params);
} }
// @RequiresPermissions("basic:person:edit") // @RequiresPermissions("basic:person:edit")
@PostMapping("editPerson") @PostMapping("editPerson")
@SysLog(title = "人员管理", businessType = OperaType.INSERT,logType = 0,module = "基础管理->人员管理",details ="修改人员" ) @SysLog(title = "人员管理", businessType = OperaType.INSERT, logType = 0, module = "基础管理->人员管理", details = "修改人员")
public AjaxResult editPerson(HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file, String params) { public AjaxResult editPerson(HttpServletRequest request, @RequestParam(value = "file", required = false) MultipartFile file, String params) {
return service.editPerson(file, params); return service.editPerson(file, params);
} }
@ -77,31 +77,43 @@ public class PersonMgeController extends BaseController {
return service.getPersonInfo(dto); return service.getPersonInfo(dto);
} }
// @RequiresPermissions("basic:person:del") // @RequiresPermissions("basic:person:del")
@PostMapping("delPerson") @PostMapping("delPerson")
@SysLog(title = "人员管理", businessType = OperaType.DELETE,logType = 0,module = "基础管理->人员管理",details ="删除人员" ) @SysLog(title = "人员管理", businessType = OperaType.DELETE, logType = 0, module = "基础管理->人员管理", details = "删除人员")
public AjaxResult delPerson(@RequestBody BraceletParamsDto dto) { public AjaxResult delPerson(@RequestBody BraceletParamsDto dto) {
return service.delPerson(dto); return service.delPerson(dto);
} }
// @RequiresPermissions("basic:person:push") // @RequiresPermissions("basic:person:push")
@PostMapping("pushFace") @PostMapping("pushFace")
@SysLog(title = "人员管理", businessType = OperaType.DELETE,logType = 0,module = "基础管理->人员管理",details ="推送人脸库" ) @SysLog(title = "人员管理", businessType = OperaType.DELETE, logType = 0, module = "基础管理->人员管理", details = "推送人脸库")
public AjaxResult pushFace(@RequestBody BraceletParamsDto dto) { public AjaxResult pushFace(@RequestBody BraceletParamsDto dto) {
return service.pushFace(dto); return service.pushFace(dto);
} }
@PostMapping("excelUpload") @PostMapping("excelUpload")
// @RequiresPermissions("basic:person:excelUpload") // @RequiresPermissions("basic:person:excelUpload")
@SysLog(title = "人员管理", businessType = OperaType.IMPORT,logType = 0,module = "基础管理->人员管理",details ="人员导入" ) @SysLog(title = "人员管理", businessType = OperaType.IMPORT, logType = 0, module = "基础管理->人员管理", details = "人员导入")
public AjaxResult excelUpload(MultipartFile file, HttpServletRequest request, HttpServletResponse response){ public AjaxResult excelUpload(MultipartFile file, HttpServletRequest request, HttpServletResponse response) {
String result = UploadCheckUtils.uploadExcelVerify(file); String result = UploadCheckUtils.uploadExcelVerify(file);
if(StringUtils.isNotBlank(result)){ if (StringUtils.isNotBlank(result)) {
return AjaxResult.error(result); return AjaxResult.error(result);
} }
return service.excelUpload(file, request, response); return service.excelUpload(file, request, response);
} }
/**
* 获取人脸照片
* @param dto
* @return AjaxResult
* @author cwchen
* @date 2024/8/21 9:27
*/
@GetMapping("getPersonFace")
public AjaxResult getPersonFace(BraceletParamsDto dto) {
return service.getPersonFace(dto);
}
/** /**
* 根据人员id获取证书详细信息 * 根据人员id获取证书详细信息
*/ */
@ -116,57 +128,57 @@ public class PersonMgeController extends BaseController {
*/ */
@RequiresPermissions("bracelet:person:edit") @RequiresPermissions("bracelet:person:edit")
@PostMapping("updateCertificate") @PostMapping("updateCertificate")
@SysLog(title = "人员管理", businessType = OperaType.UPDATE,module = "基础管理->人员管理") @SysLog(title = "人员管理", businessType = OperaType.UPDATE, module = "基础管理->人员管理")
public AjaxResult editCertificate(@RequestParam(value = "highfile", required = false) MultipartFile[] highfile, @RequestParam(value = "electfile", required = false) MultipartFile[] electfile, public AjaxResult editCertificate(@RequestParam(value = "highfile", required = false) MultipartFile[] highfile, @RequestParam(value = "electfile", required = false) MultipartFile[] electfile,
@RequestParam(value = "elsefile", required = false) MultipartFile[] elsefile,Long id,@RequestParam(value = "delHighFileIdList", required = false) String[] delhighfile, @RequestParam(value = "elsefile", required = false) MultipartFile[] elsefile, Long id, @RequestParam(value = "delHighFileIdList", required = false) String[] delhighfile,
@RequestParam(value = "delElectFileIdList", required = false) String[] delelectfile,@RequestParam(value = "delElseFileIdList", required = false) String[] delelsefile) { @RequestParam(value = "delElectFileIdList", required = false) String[] delelectfile, @RequestParam(value = "delElseFileIdList", required = false) String[] delelsefile) {
try{ try {
if(delhighfile != null) { if (delhighfile != null) {
for (int i = 0; i < delhighfile.length; i++) { for (int i = 0; i < delhighfile.length; i++) {
String high = String.valueOf(delhighfile[i]); String high = String.valueOf(delhighfile[i]);
Integer certicificateId = mapper.getHighId(high); Integer certicificateId = mapper.getHighId(high);
// if(certicificateId==null){ // if(certicificateId==null){
// return AjaxResult.error("被删除的高出作业证图片资源无法找到"); // return AjaxResult.error("被删除的高出作业证图片资源无法找到");
// } // }
if(certicificateId!=null) { if (certicificateId != null) {
mapper.delHigh(certicificateId); mapper.delHigh(certicificateId);
mapper.delHighFile(high, certicificateId); mapper.delHighFile(high, certicificateId);
remoteFileService.delFile(high, SecurityConstants.INNER); remoteFileService.delFile(high, SecurityConstants.INNER);
} }
} }
} }
if(delelectfile != null) { if (delelectfile != null) {
for (int i = 0; i < delelectfile.length; i++) { for (int i = 0; i < delelectfile.length; i++) {
String elect = String.valueOf(delelectfile[i]); String elect = String.valueOf(delelectfile[i]);
Integer certicificateId = mapper.getElectId(elect); Integer certicificateId = mapper.getElectId(elect);
// if(certicificateId==null){ // if(certicificateId==null){
// return AjaxResult.error("被删除的电工作业证作业证图片资源无法找到"); // return AjaxResult.error("被删除的电工作业证作业证图片资源无法找到");
// } // }
if(certicificateId!=null) { if (certicificateId != null) {
mapper.delElect(certicificateId); mapper.delElect(certicificateId);
mapper.delElectFile(elect, certicificateId); mapper.delElectFile(elect, certicificateId);
remoteFileService.delFile(elect, SecurityConstants.INNER); remoteFileService.delFile(elect, SecurityConstants.INNER);
} }
} }
} }
if(delelsefile != null){ if (delelsefile != null) {
for (int i = 0; i < delelsefile.length; i++) { for (int i = 0; i < delelsefile.length; i++) {
String elseFile = String.valueOf(delelsefile[i]); String elseFile = String.valueOf(delelsefile[i]);
Integer certicificateId = mapper.getElseId(elseFile); Integer certicificateId = mapper.getElseId(elseFile);
// if(certicificateId==null){ // if(certicificateId==null){
// return AjaxResult.error("被删除的其他作业证作业证图片资源无法找到"); // return AjaxResult.error("被删除的其他作业证作业证图片资源无法找到");
// } // }
if(certicificateId!=null){ if (certicificateId != null) {
mapper.delElse(certicificateId); mapper.delElse(certicificateId);
mapper.delElseFile(elseFile,certicificateId); mapper.delElseFile(elseFile, certicificateId);
remoteFileService.delFile(elseFile,SecurityConstants.INNER); remoteFileService.delFile(elseFile, SecurityConstants.INNER);
} }
} }
} }
return service.updateCertificate(highfile,electfile,elsefile,id); return service.updateCertificate(highfile, electfile, elsefile, id);
}catch (Exception e){ } catch (Exception e) {
log.error(e.toString(),e); log.error(e.toString(), e);
} }
return error("系统异常"); return error("系统异常");
} }

View File

@ -1,5 +1,6 @@
package com.bonus.bracelet.mapper; package com.bonus.bracelet.mapper;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.common.entity.bracelet.BraceletParamsDto; import com.bonus.common.entity.bracelet.BraceletParamsDto;
import com.bonus.common.entity.bracelet.vo.CertificateVo; import com.bonus.common.entity.bracelet.vo.CertificateVo;
import com.bonus.common.entity.bracelet.vo.PersonVo; import com.bonus.common.entity.bracelet.vo.PersonVo;
@ -261,4 +262,5 @@ public interface PersonMgeMapper {
* @date 2024/8/19 18:31 * @date 2024/8/19 18:31
*/ */
List<Map<String, String>> mjCodeIsExist(); List<Map<String, String>> mjCodeIsExist();
} }

View File

@ -110,4 +110,13 @@ public interface IPersonMgeService {
* @date 2024/8/12 14:11 * @date 2024/8/12 14:11
*/ */
AjaxResult pushFace(BraceletParamsDto dto); AjaxResult pushFace(BraceletParamsDto dto);
/**
* 获取人脸照片
* @param dto
* @return AjaxResult
* @author cwchen
* @date 2024/8/21 9:32
*/
AjaxResult getPersonFace(BraceletParamsDto dto);
} }

View File

@ -517,6 +517,15 @@ public class PersonMgeServiceImpl implements IPersonMgeService {
return AjaxResult.success(); return AjaxResult.success();
} }
@Override
public AjaxResult getPersonFace(BraceletParamsDto dto) {
if (StringUtils.isBlank(dto.getFilePath())) {
return AjaxResult.success("查询成功",null);
}
String imgBase64 = getPersonImgBase64(dto.getFilePath());
return AjaxResult.success("查询成功",imgBase64);
}
/** /**
* 验证身份证号是否存在 * 验证身份证号是否存在
* *