Browse Source

签章数据存储bug调整

user5 1 year ago
parent
commit
4bcf72114b

+ 1 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/projectReport/mapper/CwProjectReportMapper.java

@@ -37,7 +37,7 @@ public interface CwProjectReportMapper extends BaseMapper<CwProjectReport> {
     @InterceptorIgnore(tenantLine = "true")
     List<WorkAttachmentInfo> findFileList(@Param("id") String id);
     @InterceptorIgnore(tenantLine = "true")
-    List<WorkAttachmentInfo> findFileListOnAttachmentFlag(@Param("id") String id,String attachmentFlag);
+    List<WorkAttachmentInfo> findFileListOnAttachmentFlag(@Param("id") String id,@Param("attachmentFlag") String attachmentFlag);
 
     Integer findIsExit(@Param("id") String id, @Param("name")String name);
 

+ 2 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/service/EnrollmentKeyCardService.java

@@ -9,6 +9,7 @@ import com.jeeplus.human.enrollment.enrollmentRegistration.domain.EnrollmentKeyC
 import com.jeeplus.human.enrollment.enrollmentRegistration.domain.EnrollmentRiceCard;
 import com.jeeplus.human.enrollment.enrollmentRegistration.domain.EnrollmentWageCard;
 import com.jeeplus.human.enrollment.enrollmentRegistration.mapper.EnrollmentKeyCardMapper;
+import com.jeeplus.human.enrollment.enrollmentRegistration.utils.SnowFlake;
 import com.jeeplus.sys.feign.IUserApi;
 import com.jeeplus.sys.service.dto.UserDTO;
 import org.apache.commons.lang3.StringUtils;
@@ -120,7 +121,7 @@ public class EnrollmentKeyCardService extends ServiceImpl<EnrollmentKeyCardMappe
             Map map2 = SpringUtil.getBean(IFlowableApi.class).getByNameForFen("完善餐补卡号");
             String procDefId = map2.get("id")+"";
             //发起完善餐补卡号流程
-            String uid = UUID.randomUUID().toString().replace("-", "");
+            String uid = SnowFlake.getId();
             EnrollmentRiceCard wageCard = new EnrollmentRiceCard();
             wageCard.setId(uid);
             wageCard.setCreateById("1");

+ 8 - 7
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/enrollment/enrollmentRegistration/service/EnrollmentRegistrationService.java

@@ -17,6 +17,7 @@ import com.jeeplus.human.enrollment.enrollmentRegistration.domain.EnrollmentSoci
 import com.jeeplus.human.enrollment.enrollmentRegistration.domain.EnrollmentWageCard;
 import com.jeeplus.human.enrollment.enrollmentRegistration.mapper.EnrollmentRegistrationMapper;
 import com.jeeplus.human.enrollment.enrollmentRegistration.mapper.EnrollmentSocialSecurityCardMapper;
+import com.jeeplus.human.enrollment.enrollmentRegistration.utils.SnowFlake;
 import com.jeeplus.human.practice.register.domain.Registration;
 import com.jeeplus.sys.feign.IOfficeApi;
 import com.jeeplus.sys.feign.IPostApi;
@@ -123,7 +124,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
 
         if (integer <=0 && mobilePhoneOnly <=0 ) {
 
-            String id = UUID.randomUUID().toString().replace("-", "");
+            String id = SnowFlake.getId();
             BeanUtils.copyProperties(reportData, report);
             report.setId(id);
             report.setCreateById("1");
@@ -133,7 +134,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
 
             if (StringUtils.isNotBlank(report.getSocialSecurityNumber())){
                 EnrollmentSocialSecurityCard securityCard = new EnrollmentSocialSecurityCard();
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 securityCard.setId(amountId);
                 securityCard.setCreateById("1");
                 securityCard.setCreateTime(new Date());
@@ -230,7 +231,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
         // 生成id
         String amountId = "";
         if (StringUtils.isBlank(report.getUserId())) {
-            amountId = UUID.randomUUID().toString().replace("-", "");
+            amountId = SnowFlake.getId();
             report.setUserId(amountId);
         } else {
             amountId = report.getUserId();
@@ -324,7 +325,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
                 String procDefId = map.get("id")+"";
 
                 //当流程结束的时候,发起工资卡信息完善流程
-                String uid = UUID.randomUUID().toString().replace("-", "");
+                String uid = SnowFlake.getId();
                 EnrollmentWageCard wageCard = new EnrollmentWageCard();
                 wageCard.setId(uid);
                 wageCard.setCreateById("1");
@@ -359,7 +360,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
                     String procDefId2 = cardMap.get("id")+"";
 
                     //当流程结束的时候,发起工资卡信息完善流程
-                    String uuid = UUID.randomUUID().toString().replace("-", "");
+                    String uuid = SnowFlake.getId();
                     EnrollmentSocialSecurityCard securityCard = new EnrollmentSocialSecurityCard();
                     securityCard.setId(uuid);
                     securityCard.setCreateById("1");
@@ -393,7 +394,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
                 String keyProcDefId = keyMap.get("id")+"";
 
                 //当流程结束的时候,发起工资卡信息完善流程
-                String keyUid = UUID.randomUUID().toString().replace("-", "");
+                String keyUid = SnowFlake.getId();
                 EnrollmentKeyCard keyCard = new EnrollmentKeyCard();
                 keyCard.setId(keyUid);
                 keyCard.setCreateById("1");
@@ -521,7 +522,7 @@ public class EnrollmentRegistrationService extends ServiceImpl<EnrollmentRegistr
 
         if (StringUtils.isNotBlank(report.getSocialSecurityNumber())){
             EnrollmentSocialSecurityCard securityCard = new EnrollmentSocialSecurityCard();
-            String amountId = UUID.randomUUID().toString().replace("-", "");
+            String amountId = SnowFlake.getId();
             securityCard.setId(amountId);
             securityCard.setCreateById("1");
             securityCard.setCreateTime(new Date());

+ 4 - 3
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/logwrite/service/RegistrationWorkLogService.java

@@ -11,6 +11,7 @@ import com.jeeplus.common.SecurityUtils;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.human.enrollment.enrollmentRegistration.utils.SnowFlake;
 import com.jeeplus.human.practice.logwrite.domain.RegistrationWorkLog;
 import com.jeeplus.human.practice.logwrite.domain.RegistrationWorkLogDetail;
 import com.jeeplus.human.practice.logwrite.mapper.RegistrationWorkLogDetailMapper;
@@ -140,7 +141,7 @@ public class RegistrationWorkLogService extends ServiceImpl<RegistrationWorkLogM
             List<RegistrationWorkLogDetail> amountInfos = report.getAmountInfos();
             for (RegistrationWorkLogDetail amountInfo : amountInfos) {
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 amountInfo.setId(amountId);
                 amountInfo.setCreateById(userDTO.getId());
                 amountInfo.setCreateTime(new Date());
@@ -172,13 +173,13 @@ public class RegistrationWorkLogService extends ServiceImpl<RegistrationWorkLogM
         RegistrationWorkLog report = new RegistrationWorkLog();
         BeanUtils.copyProperties(reportData, report);
 
-        String id = UUID.randomUUID().toString().replace("-", "");
+        String id = SnowFlake.getId();
         report.setId(id);
         if (CollectionUtils.isNotEmpty(report.getAmountInfos())){
             List<RegistrationWorkLogDetail> amountInfos = reportData.getAmountInfos();
             for (RegistrationWorkLogDetail amountInfo : amountInfos) {
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 amountInfo.setId(amountId);
                 amountInfo.setCreateById(userDTO.getId());
                 amountInfo.setCreateTime(new Date());

+ 10 - 9
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/register/service/RegistrationService.java

@@ -13,6 +13,7 @@ import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.flowable.feign.IFlowableApi;
 import com.jeeplus.human.enrollment.enrollmentRegistration.service.EnrollmentRegistrationService;
+import com.jeeplus.human.enrollment.enrollmentRegistration.utils.SnowFlake;
 import com.jeeplus.human.practice.register.domain.Registration;
 import com.jeeplus.human.practice.register.domain.RegistrationBank;
 import com.jeeplus.human.practice.register.domain.RegistrationExperience;
@@ -167,7 +168,7 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
                 UserDTO dto = new UserDTO();
                 //设置信息
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 dto.setId(amountId);
                 dto.setName(report.getName());
                 dto.setPassword(SecurityUtils.encryptPassword("123456"));
@@ -244,7 +245,7 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
                 String procDefId = map.get("id")+"";
 
                 //当流程结束的时候,发起工资卡信息完善流程
-                String uid = UUID.randomUUID().toString().replace("-", "");
+                String uid = SnowFlake.getId();
                 RegistrationBank wageCard = new RegistrationBank();
                 wageCard.setId(uid);
                 wageCard.setCreateById("1");
@@ -279,7 +280,7 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
         if (CollectionUtils.isNotEmpty(familyMembers)){
             familyMembers.forEach(fa->{
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 fa.setId(amountId);
                 fa.setCreateById(userDTO.getId());
                 fa.setCreateTime(new Date());
@@ -333,14 +334,14 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
         // 删除基础信息表
         if (integer <=0 && mobilePhoneOnly <=0){
 
-            String id = UUID.randomUUID().toString().replace("-", "");
+            String id = SnowFlake.getId();
             report.setId(id);
             report.setCreateById("1");
             report.setCreateTime(new Date());
             report.setUpdateById("1");
             report.setUpdateTime(new Date());
 
-            String uid = UUID.randomUUID().toString().replace("-", "");
+            String uid = SnowFlake.getId();
             report.setId(uid);
 
             //先删除家庭成员信息,在重新添加
@@ -350,7 +351,7 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
 
                 for (RegistrationFamilyMembers familyMember : familyMembers) {
                     // 生成id
-                    String amountId = UUID.randomUUID().toString().replace("-", "");
+                    String amountId = SnowFlake.getId();
                     familyMember.setId(amountId);
                     familyMember.setCreateById("1");
                     familyMember.setCreateTime(new Date());
@@ -367,7 +368,7 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
             if (CollectionUtils.isNotEmpty(experiences)){
                 for (RegistrationExperience experience : experiences) {
                     // 生成id
-                    String amountId = UUID.randomUUID().toString().replace("-", "");
+                    String amountId = SnowFlake.getId();
                     experience.setId(amountId);
                     experience.setCreateById("1");
                     experience.setCreateTime(new Date());
@@ -488,7 +489,7 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
         if (CollectionUtils.isNotEmpty(familyMembers)){
             familyMembers.forEach(fa->{
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 fa.setId(amountId);
                 fa.setCreateById(userDTO.getId());
                 fa.setCreateTime(new Date());
@@ -506,7 +507,7 @@ public class RegistrationService extends ServiceImpl<InterRegistrationMapper, Re
         if (CollectionUtils.isNotEmpty(experiences)){
             experiences.forEach(fa->{
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 fa.setId(amountId);
                 fa.setCreateById(userDTO.getId());
                 fa.setCreateTime(new Date());

+ 4 - 3
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/reimburseRegister/service/ReimburseRegisterService.java

@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.human.enrollment.enrollmentRegistration.utils.SnowFlake;
 import com.jeeplus.human.practice.logwrite.service.RegistrationWorkLogService;
 import com.jeeplus.human.practice.register.service.RegistrationService;
 import com.jeeplus.human.practice.reimburseRegister.domain.ReimburseRegister;
@@ -197,7 +198,7 @@ public class ReimburseRegisterService extends ServiceImpl<ReimburseRegisterMappe
             List<ReimburseRegisterDetail> amountInfos = report.getDetailList();
             for (ReimburseRegisterDetail amountInfo : amountInfos) {
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 amountInfo.setId(amountId);
                 amountInfo.setCreateById(userDTO.getId());
                 amountInfo.setCreateTime(new Date());
@@ -269,13 +270,13 @@ public class ReimburseRegisterService extends ServiceImpl<ReimburseRegisterMappe
         ReimburseRegister report = new ReimburseRegister();
         BeanUtils.copyProperties(reportData, report);
 
-        String id = UUID.randomUUID().toString().replace("-", "");
+        String id = SnowFlake.getId();
         report.setId(id);
         if (CollectionUtils.isNotEmpty(report.getDetailList())){
             List<ReimburseRegisterDetail> amountInfos = reportData.getDetailList();
             for (ReimburseRegisterDetail amountInfo : amountInfos) {
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 amountInfo.setId(amountId);
                 amountInfo.setCreateById(userDTO.getId());
                 amountInfo.setCreateTime(new Date());

+ 4 - 3
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/practice/reimburseRegister/service/ReimburseSubmitAccountService.java

@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.core.query.QueryWrapperGenerator;
 import com.jeeplus.flowable.feign.IFlowableApi;
+import com.jeeplus.human.enrollment.enrollmentRegistration.utils.SnowFlake;
 import com.jeeplus.human.practice.reimburseRegister.domain.ReimburseRegister;
 import com.jeeplus.human.practice.reimburseRegister.domain.ReimburseRegisterDetail;
 import com.jeeplus.human.practice.reimburseRegister.domain.ReimburseSubmitAccount;
@@ -133,7 +134,7 @@ public class ReimburseSubmitAccountService extends ServiceImpl<ReimburseSubmitAc
             List<ReimburseSubmitAccountDetail> amountInfos = report.getAccountDetails();
             for (ReimburseSubmitAccountDetail amountInfo : amountInfos) {
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 amountInfo.setId(amountId);
                 amountInfo.setCreateById(userDTO.getId());
                 amountInfo.setCreateTime(new Date());
@@ -171,7 +172,7 @@ public class ReimburseSubmitAccountService extends ServiceImpl<ReimburseSubmitAc
         //报销编号生成
         String serialNum = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), ReimburseSubmitAccount.BIZ_CODE, TokenProvider.getCurrentToken());
         report.setNo(serialNum);
-        String id = UUID.randomUUID().toString().replace("-", "");
+        String id = SnowFlake.getId();
         report.setId(id);
 
         //保存报销明细前先删除一下
@@ -180,7 +181,7 @@ public class ReimburseSubmitAccountService extends ServiceImpl<ReimburseSubmitAc
             List<ReimburseSubmitAccountDetail> amountInfos = report.getAccountDetails();
             for (ReimburseSubmitAccountDetail amountInfo : amountInfos) {
                 // 生成id
-                String amountId = UUID.randomUUID().toString().replace("-", "");
+                String amountId = SnowFlake.getId();
                 amountInfo.setId(amountId);
                 amountInfo.setCreateById(userDTO.getId());
                 amountInfo.setCreateTime(new Date());

+ 2 - 1
jeeplus-modules/jeeplus-human/src/main/java/com/jeeplus/human/signature/controller/HumanSignatureCallBackController.java

@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
 import com.jeeplus.common.TokenProvider;
 import com.jeeplus.human.depart.handover.domain.Handover;
 import com.jeeplus.human.depart.handover.service.HandoverService;
+import com.jeeplus.human.enrollment.enrollmentRegistration.utils.SnowFlake;
 import com.jeeplus.human.signature.entity.PresignCallBack;
 import com.jeeplus.human.signature.utils.*;
 import com.jeeplus.sys.domain.WorkAttachmentInfo;
@@ -140,7 +141,7 @@ public class HumanSignatureCallBackController {
                     workattachment.setFileSize(String.valueOf(f.length()));
                     workattachment.setAttachmentId(handover.getId());
                     workattachment.setAttachmentType("");
-                    String id = UUID.randomUUID().toString().replace("-", "");
+                    String id = SnowFlake.getId();
                     workattachment.setId(id);
                     workattachment.setCreateTime(new Date());
                     workattachment.setUpdateTime(new Date());

+ 27 - 6
jeeplus-modules/jeeplus-public-modules/src/main/java/com/jeeplus/pubmodules/oss/service/OssService.java

@@ -338,12 +338,25 @@ public class OssService extends ServiceImpl<OssServiceMapper, WorkAttachment> {
                 return false;
             }).map(WorkAttachmentDto::getId).collect(Collectors.toList());
             if(CollectionUtil.isNotEmpty(ids)){
-                ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
-                        .eq(WorkAttachment::getAttachmentId, attachmentId)
-                        .notIn(WorkAttachment::getId,ids));
+                if(StringUtils.isNotBlank(attachmentFlag)){
+                    ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                            .eq(WorkAttachment::getAttachmentId, attachmentId)
+                            .eq(WorkAttachment::getAttachmentFlag, attachmentFlag)
+                            .notIn(WorkAttachment::getId,ids));
+                }else{
+                    ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                            .eq(WorkAttachment::getAttachmentId, attachmentId)
+                            .notIn(WorkAttachment::getId,ids));
+                }
             }else{
-                ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
-                        .eq(WorkAttachment::getAttachmentId, attachmentId));
+                if(StringUtils.isNotBlank(attachmentFlag)){
+                    ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                            .eq(WorkAttachment::getAttachmentId, attachmentId)
+                            .eq(WorkAttachment::getAttachmentFlag, attachmentFlag));
+                }else{
+                    ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                            .eq(WorkAttachment::getAttachmentId, attachmentId));
+                }
             }
 
             List<WorkAttachmentDto> dtoList = fileList.stream().filter(item -> {
@@ -355,7 +368,15 @@ public class OssService extends ServiceImpl<OssServiceMapper, WorkAttachment> {
 
             this.saveFileList(dtoList, userDTO, attachmentId,attachmentFlag);
         } else {
-            ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda().eq(WorkAttachment::getAttachmentId, attachmentId));
+            if(StringUtils.isNotBlank(attachmentFlag)){
+                ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                                .eq(WorkAttachment::getAttachmentId, attachmentId)
+                                .eq(WorkAttachment::getAttachmentFlag, attachmentFlag));
+            }else{
+                ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda()
+                        .eq(WorkAttachment::getAttachmentId, attachmentId));
+            }
+
         }
     }