Browse Source

企业备案信息:优化回执单数据写入

heguanxun 2 months ago
parent
commit
6e1679d10b

+ 57 - 20
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/qyrecordinfo/service/impl/QyRecordInfoServiceImpl.java

@@ -124,10 +124,36 @@ public class QyRecordInfoServiceImpl extends ServiceImpl<QyRecordInfoMapper, QyR
             qyRecordInfoCheckList.setCheckTime(new Date());
             qyRecordInfoCheckList.setStatus("审核中");
             qyRecordInfoCheckList.setResult("提交成功,待审核");
-            qyRecordInfoCheckList.setApplyType("备案");
+            if ("basq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList.setApplyType("备案");
+            }
+            if ("bgsq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList.setApplyType("变更");
+            }
+            if ("zxsq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList.setApplyType("注销");
+            }
             String nickname = StpLoginUserUtil.getLoginUser().getName();
             qyRecordInfoCheckList.setCompanyName(nickname);
             qyRecordInfoCheckListService.save(qyRecordInfoCheckList);
+
+            QyRecordInfoCheckList qyRecordInfoCheckList_ = new QyRecordInfoCheckList();
+            qyRecordInfoCheckList_.setYlTzCode(qyRecordInfo.getYlTzCode());
+            qyRecordInfoCheckList_.setCheckTime(new Date());
+            qyRecordInfoCheckList_.setStatus("审核通过");
+            qyRecordInfoCheckList_.setApplyMan("张白龙");
+            qyRecordInfoCheckList_.setResult("提交成功,审核通过");
+            if ("basq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList_.setApplyType("备案");
+            }
+            if ("bgsq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList_.setApplyType("变更");
+            }
+            if ("zxsq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList_.setApplyType("注销");
+            }
+            qyRecordInfoCheckList_.setCompanyName(StpLoginUserUtil.getLoginUser().getName());
+            qyRecordInfoCheckListService.save(qyRecordInfoCheckList_);
         }
     }
 
@@ -137,24 +163,8 @@ public class QyRecordInfoServiceImpl extends ServiceImpl<QyRecordInfoMapper, QyR
         QyRecordInfo qyRecordInfo = this.queryEntity(qyRecordInfoEditParam.getId());
         BeanUtil.copyProperties(qyRecordInfoEditParam, qyRecordInfo);
         this.updateById(qyRecordInfo);
-        List<QyRecardBody> list = qyRecardBodyService.list(new LambdaQueryWrapper<QyRecardBody>().eq(QyRecardBody::getQyRecordInfoId, qyRecordInfo.getId()));
-        if(CollectionUtil.isNotEmpty(list)){
-            List<String> ids = list.stream().map(qyRecardBody -> qyRecardBody.getId()).collect(Collectors.toList());
-            List<QyRecardBodyIdParam> bodyIdParams = new ArrayList<>();
-            ids.forEach(id ->{
-                bodyIdParams.add(new QyRecardBodyIdParam(id));
-            });
-            qyRecardBodyService.delete(bodyIdParams);
-        }
-        List<QyRecordAttachment> list_ = qyRecordAttachmentService.list(new LambdaQueryWrapper<QyRecordAttachment>().eq(QyRecordAttachment::getQyRecordInfoId, qyRecordInfo.getId()));
-        if(CollectionUtil.isNotEmpty(list_)){
-            List<String> ids = list.stream().map(qyRecordAttachment -> qyRecordAttachment.getId()).collect(Collectors.toList());
-            List<QyRecordAttachmentIdParam> attachmentIdParams = new ArrayList<>();
-            ids.forEach(id ->{
-                attachmentIdParams.add(new QyRecordAttachmentIdParam(id));
-            });
-            qyRecordAttachmentService.delete(attachmentIdParams);
-        }
+        qyRecardBodyService.remove(new LambdaQueryWrapper<QyRecardBody>().eq(QyRecardBody::getQyRecordInfoId, qyRecordInfo.getId()));
+        qyRecordAttachmentService.remove(new LambdaQueryWrapper<QyRecordAttachment>().eq(QyRecordAttachment::getQyRecordInfoId, qyRecordInfo.getId()));
 
         List<QyRecardBodyEditParam> bodyAddParams = qyRecordInfoEditParam.getQyRecardBodyEditParams();
         if (CollectionUtil.isNotEmpty(bodyAddParams)){
@@ -181,10 +191,37 @@ public class QyRecordInfoServiceImpl extends ServiceImpl<QyRecordInfoMapper, QyR
             qyRecordInfoCheckList.setCheckTime(new Date());
             qyRecordInfoCheckList.setStatus("审核中");
             qyRecordInfoCheckList.setResult("提交成功,待审核");
-            qyRecordInfoCheckList.setApplyType("备案");
+            if ("basq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList.setApplyType("备案");
+            }
+            if ("bgsq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList.setApplyType("变更");
+            }
+            if ("zxsq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList.setApplyType("注销");
+            }
+
             String nickname = StpLoginUserUtil.getLoginUser().getName();
             qyRecordInfoCheckList.setCompanyName(nickname);
             qyRecordInfoCheckListService.save(qyRecordInfoCheckList);
+
+            QyRecordInfoCheckList qyRecordInfoCheckList_ = new QyRecordInfoCheckList();
+            qyRecordInfoCheckList_.setYlTzCode(qyRecordInfo.getYlTzCode());
+            qyRecordInfoCheckList_.setCheckTime(new Date());
+            qyRecordInfoCheckList_.setStatus("审核通过");
+            qyRecordInfoCheckList_.setResult("提交成功,待审核");
+            if ("basq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList_.setApplyType("备案");
+            }
+            if ("bgsq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList_.setApplyType("变更");
+            }
+            if ("zxsq".equals(qyRecordInfo.getApplyType())){
+                qyRecordInfoCheckList_.setApplyType("注销");
+            }
+            qyRecordInfoCheckList_.setCompanyName(StpLoginUserUtil.getLoginUser().getName());
+            qyRecordInfoCheckList_.setApplyMan("张白龙");
+            qyRecordInfoCheckListService.save(qyRecordInfoCheckList_);
         }
     }