Bläddra i källkod

add:资源保障

caozixuan 1 år sedan
förälder
incheckning
6b268f1145

+ 3 - 2
sop-api/src/main/java/com/qmth/sop/server/api/TBUserArchivesController.java

@@ -14,6 +14,7 @@ import com.qmth.sop.business.service.TBUserArchivesService;
 import com.qmth.sop.business.templete.execute.AsyncUserArchivesExportService;
 import com.qmth.sop.business.templete.execute.AsyncUserArchivesImportService;
 import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.ExceptionResultEnum;
 import com.qmth.sop.common.enums.RoleTypeEnum;
 import com.qmth.sop.common.enums.SequenceEnum;
 import com.qmth.sop.common.enums.TaskTypeEnum;
@@ -76,7 +77,7 @@ public class TBUserArchivesController {
                                        @ApiParam(value = "入档时间-截止") @RequestParam(required = false) Long archivesTimeEnd,
                                        @ApiParam(value = "剩余有效天数") @RequestParam(required = false) Integer remainValidDay,
                                        @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
-                                       @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) throws ParseException {
+                                       @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) throws Exception {
 
         return ResultUtil.ok(tbUserArchivesService.findUserArchivesPage(city, SystemConstant.convertIdToLong(supplierId), archivesName,
                 roleType, authenticationStatus, archivesTimeStart, archivesTimeEnd, remainValidDay, pageNumber, pageSize));
@@ -103,7 +104,7 @@ public class TBUserArchivesController {
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
     @OperationLog
     public Result createUserArchivesCode() throws InterruptedException {
-        return ResultUtil.ok(sequenceService.createSerialNo(SequenceEnum.USER_ARCHIVES_CODE));
+        return ResultUtil.ok(sequenceService.createSerialNo(SequenceEnum.USER_ARCHIVES_CODE), ExceptionResultEnum.SUCCESS.getMessage());
     }
 
     @ApiOperation(value = "人员档案管理-编辑")

+ 8 - 0
sop-business/src/main/java/com/qmth/sop/business/service/BasicAttachmentService.java

@@ -87,4 +87,12 @@ public interface BasicAttachmentService extends IService<BasicAttachment> {
      * @return
      */
     public String filePreview(BasicAttachment basicAttachment) throws Exception;
+
+    /**
+     * 文件预览
+     *
+     * @param path
+     * @return
+     */
+    public String filePreviewPath(String filePath) throws Exception;
 }

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/service/TBUserArchivesService.java

@@ -41,7 +41,7 @@ public interface TBUserArchivesService extends IService<TBUserArchives> {
      */
     IPage<UserArchivesResult> findUserArchivesPage(String city, Long supplierId, String archivesName, RoleTypeEnum roleType,
                                                    Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd,
-                                                   Integer remainValidDay, Integer pageNumber, Integer pageSize) throws ParseException;
+                                                   Integer remainValidDay, Integer pageNumber, Integer pageSize) throws Exception;
 
     /**
      * 编辑用户档案

+ 11 - 4
sop-business/src/main/java/com/qmth/sop/business/service/impl/BasicAttachmentServiceImpl.java

@@ -150,11 +150,12 @@ public class BasicAttachmentServiceImpl extends ServiceImpl<BasicAttachmentMappe
         if (Objects.nonNull(attachmentInfoDto)) {
             String fileName = SystemConstant.getNanoId();
             StringJoiner stringJoiner = SystemConstant.getDirName(type, true).add(fileName).add(attachmentInfoDto.getFormat());
+            String path = stringJoiner.toString().replaceAll("\\\\", SystemConstant.ORG_SPLIT);
             JSONObject jsonObject = new JSONObject();
             jsonObject.put(SystemConstant.TYPE, fileStoreUtil.uploadFileEnumIsOss(type) ? SystemConstant.OSS : SystemConstant.LOCAL);
-            fileStoreUtil.ossUpload(stringJoiner.toString(), new FileInputStream(file), attachmentInfoDto.getMd5(), type.getFssType());
+            fileStoreUtil.ossUpload(path, new FileInputStream(file), attachmentInfoDto.getMd5(), type.getFssType());
             jsonObject.put(SystemConstant.UPLOAD_TYPE, type);
-            jsonObject.put(SystemConstant.PATH, stringJoiner.toString());
+            jsonObject.put(SystemConstant.PATH, path);
             attachmentInfoDto.setFileName(fileName);
             basicAttachment = new BasicAttachment(jsonObject.toJSONString(), attachmentInfoDto, null);
             this.save(basicAttachment);
@@ -178,12 +179,13 @@ public class BasicAttachmentServiceImpl extends ServiceImpl<BasicAttachmentMappe
         AttachmentInfoDto attachmentInfoDto = this.validateAttachment(file);
         if (Objects.nonNull(attachmentInfoDto)) {
             StringJoiner stringJoiner = SystemConstant.getDirName(type, true).add(SystemConstant.getNanoId()).add(attachmentInfoDto.getFormat());
+            String path = stringJoiner.toString().replaceAll("\\\\", SystemConstant.ORG_SPLIT);
             JSONObject jsonObject = new JSONObject();
             jsonObject.put(SystemConstant.TYPE, fileStoreUtil.uploadFileEnumIsOss(type) ? SystemConstant.OSS : SystemConstant.LOCAL);
-            fileStoreUtil.ossUpload(stringJoiner.toString(), file.getInputStream(), attachmentInfoDto.getMd5(), type.getFssType());
+            fileStoreUtil.ossUpload(path, file.getInputStream(), attachmentInfoDto.getMd5(), type.getFssType());
             SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
             jsonObject.put(SystemConstant.UPLOAD_TYPE, type);
-            jsonObject.put(SystemConstant.PATH, stringJoiner.toString());
+            jsonObject.put(SystemConstant.PATH, path);
             basicAttachment = new BasicAttachment(jsonObject.toJSONString(), attachmentInfoDto, sysUser.getId());
             this.save(basicAttachment);
         }
@@ -253,4 +255,9 @@ public class BasicAttachmentServiceImpl extends ServiceImpl<BasicAttachmentMappe
     public String filePreview(BasicAttachment basicAttachment) throws Exception {
         return this.filePreview(basicAttachment.getPath());
     }
+
+    @Override
+    public String filePreviewPath(String filePath) {
+        return fileStoreUtil.getDictionaryConfig().fssPublicDomain().getServer() + SystemConstant.ORG_SPLIT + filePath;
+    }
 }

+ 4 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBUserArchivesServiceImpl.java

@@ -47,9 +47,11 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
     private TBCrmService tbCrmService;
     @Resource
     private SysRoleService sysRoleService;
+    @Resource
+    private BasicAttachmentService basicAttachmentService;
 
     @Override
-    public IPage<UserArchivesResult> findUserArchivesPage(String city, Long supplierId, String archivesName, RoleTypeEnum roleType, Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay, Integer pageNumber, Integer pageSize) throws ParseException {
+    public IPage<UserArchivesResult> findUserArchivesPage(String city, Long supplierId, String archivesName, RoleTypeEnum roleType, Boolean authenticationStatus, Long archivesTimeStart, Long archivesTimeEnd, Integer remainValidDay, Integer pageNumber, Integer pageSize) throws Exception {
         if (city != null && city.length() > 0) {
             city = SystemConstant.translateSpecificSign(city);
         }
@@ -85,6 +87,7 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
             record.setRoleInfoList(roleResultList);
             record.setAge(this.getAgeByIdentity(record.getIdentity()));
             record.setAuthenticationStatus(record.getAuthenticationValidTime() != null && record.getAuthenticationValidTime() > currentTime);
+            record.setBasePhotoPath(basicAttachmentService.filePreviewPath(record.getBasePhotoPath()));
         }
         return page;
     }

+ 4 - 0
sop-business/src/main/resources/db/log/caozixuan_update_log.sql

@@ -303,3 +303,7 @@ ALTER TABLE t_b_ding_history
     CHANGE COLUMN axis_in_x axis_x VARCHAR(20) NULL DEFAULT NULL COMMENT '坐标轴X' ,
     CHANGE COLUMN axis_in_y axis_y VARCHAR(20) NULL DEFAULT NULL COMMENT '坐标轴Y' ,
     CHANGE COLUMN face_in_error face_pass TINYINT NULL DEFAULT NULL COMMENT '人脸识别是否通过,0:未通过,1:通过' ;
+
+-- 2023-09-18
+INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (2048, '考勤打卡-查询进行中的sop', '/api/admin/tb/ding/ding_find_running_sop', 'URL', 26, 4, 'SYS', NULL, 1, 1, 0);
+INSERT INTO sys_privilege(id, name, url, type, parent_id, sequence, property, related, enable, default_auth, front_display) VALUES (2049, '考勤打卡-查询所有sop', '/api/admin/tb/ding/ding_find_all_sop', 'URL', 26, 5, 'SYS', NULL, 1, 1, 0);