|
@@ -76,7 +76,6 @@ public class AgreementLogic {
|
|
|
WebsitUserService websitUserService;
|
|
|
|
|
|
|
|
|
-
|
|
|
public IPage<AgreementVo> list(Page page, ZfireParamBean zfireParam) {
|
|
|
|
|
|
//获取当前登录企业id
|
|
@@ -86,7 +85,7 @@ public class AgreementLogic {
|
|
|
//1.组装查询条件
|
|
|
zfireParam = FieldUtils.supplyParam(zfireParam, AgreementVo.class);
|
|
|
|
|
|
- IPage<AgreementVo> agreementVoIPage = policyCMapper.listAgreement(page, zfireParam,adminCompanyIds);
|
|
|
+ IPage<AgreementVo> agreementVoIPage = policyCMapper.listAgreement(page, zfireParam, adminCompanyIds);
|
|
|
return agreementVoIPage;
|
|
|
}
|
|
|
|
|
@@ -138,7 +137,7 @@ public class AgreementLogic {
|
|
|
|
|
|
agreementAddUp.updateById();
|
|
|
|
|
|
- agreementPolicyService.lambdaUpdate().eq(AgreementPolicy::getAgreementId,agreementAddUp.getId()).remove();
|
|
|
+ agreementPolicyService.lambdaUpdate().eq(AgreementPolicy::getAgreementId, agreementAddUp.getId()).remove();
|
|
|
|
|
|
List<AgreementPolicy> agreementPolicies = new ArrayList<>();
|
|
|
|
|
@@ -154,7 +153,7 @@ public class AgreementLogic {
|
|
|
|
|
|
public MailboxAdd detailMailbox() {
|
|
|
|
|
|
- if (mailboxService.lambdaQuery().eq(Mailbox::getId,"1").count() < 1)
|
|
|
+ if (mailboxService.lambdaQuery().eq(Mailbox::getId, "1").count() < 1)
|
|
|
return new MailboxAdd();
|
|
|
|
|
|
Mailbox mailbox = mailboxService.getById("1");
|
|
@@ -170,7 +169,7 @@ public class AgreementLogic {
|
|
|
}
|
|
|
|
|
|
public void addDetail(MailboxAdd mailbox) {
|
|
|
- if (mailboxService.lambdaQuery().eq(Mailbox::getId,"1").count() < 1){
|
|
|
+ if (mailboxService.lambdaQuery().eq(Mailbox::getId, "1").count() < 1) {
|
|
|
mailbox.setId("1");
|
|
|
mailbox.insert();
|
|
|
return;
|
|
@@ -178,7 +177,7 @@ public class AgreementLogic {
|
|
|
mailbox.setId("1");
|
|
|
mailbox.updateById();
|
|
|
|
|
|
- mailboxReceiveService.lambdaUpdate().eq(MailboxReceive::getMailboxId,"1").remove();
|
|
|
+ mailboxReceiveService.lambdaUpdate().eq(MailboxReceive::getMailboxId, "1").remove();
|
|
|
|
|
|
for (MailboxReceive mailboxReceive : mailbox.getMailboxReceives()) {
|
|
|
|
|
@@ -197,7 +196,7 @@ public class AgreementLogic {
|
|
|
//1.组装查询条件
|
|
|
zfireParam = FieldUtils.supplyParam(zfireParam, MailBoxSendRecordVo.class);
|
|
|
|
|
|
- IPage<MailBoxSendRecordVo> policyVoIPage = policyCMapper.listMailBoxRecord(page, zfireParam,adminCompanyIds);
|
|
|
+ IPage<MailBoxSendRecordVo> policyVoIPage = policyCMapper.listMailBoxRecord(page, zfireParam, adminCompanyIds);
|
|
|
return policyVoIPage;
|
|
|
}
|
|
|
|
|
@@ -214,7 +213,7 @@ public class AgreementLogic {
|
|
|
//1.组装查询条件
|
|
|
zfireParam = FieldUtils.supplyParam(zfireParam, MailboxSendRecordPolicyVo.class);
|
|
|
|
|
|
- IPage<MailboxSendRecordPolicyVo> policyVoIPage = policyCMapper.listPolicy(page, zfireParam,adminCompanyIds);
|
|
|
+ IPage<MailboxSendRecordPolicyVo> policyVoIPage = policyCMapper.listPolicy(page, zfireParam, adminCompanyIds);
|
|
|
return policyVoIPage;
|
|
|
}
|
|
|
|
|
@@ -228,7 +227,6 @@ public class AgreementLogic {
|
|
|
List<MailboxReceive> mailboxReceives = mailboxReceiveService.lambdaQuery().eq(MailboxReceive::getMailboxId, "1").list();
|
|
|
|
|
|
|
|
|
-
|
|
|
if (mailboxSendRecord.getPolicyType().equals("AC")) {
|
|
|
|
|
|
//发邮件
|
|
@@ -270,14 +268,13 @@ public class AgreementLogic {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
private void sendEmailFileIn(List<MailboxSendRecordPolicy> mailboxSendRecordPolicies, MailboxSendRecord mailboxSendRecord, Mailbox mailbox) throws IOException {
|
|
|
- String[] titles = new String[]{"序号","网点编号","网点名称","服务人员编号","服务人员名称","联系电话","身份证号码","保单名称","缴费金额",
|
|
|
- "生效日期","截止日期","所属一级网点编号","所属一级网点编号","代买单位"};
|
|
|
+ String[] titles = new String[]{"序号", "网点编号", "网点名称", "服务人员编号", "服务人员名称", "联系电话", "身份证号码", "保单名称", "缴费金额",
|
|
|
+ "生效日期", "截止日期", "所属一级网点编号", "所属一级网点编号", "代买单位"};
|
|
|
List<List<Object>> rows = new ArrayList<>();
|
|
|
- for(int i = 0;i < mailboxSendRecordPolicies.size();i++) {
|
|
|
+ for (int i = 0; i < mailboxSendRecordPolicies.size(); i++) {
|
|
|
MailboxSendRecordPolicy record = mailboxSendRecordPolicies.get(i);
|
|
|
List<Object> row = new ArrayList<>();
|
|
|
row.add(i + 1);
|
|
@@ -292,14 +289,14 @@ public class AgreementLogic {
|
|
|
}
|
|
|
// 获取资源文件存放路径,用于临时存放生成的excel文件
|
|
|
String path = "/tmp";
|
|
|
- if(active.equals("dev")) {
|
|
|
+ if (active.equals("dev")) {
|
|
|
path = Objects.requireNonNull(this.getClass().getClassLoader().getResource("")).getPath();
|
|
|
}
|
|
|
// 文件名:采用UUID,防止多线程同时生成导致的文件重名
|
|
|
- String filePath = String.format("%s-%s.xlsx",path,mailboxSendRecord.getSendBatch()+"-工伤险");
|
|
|
+ String filePath = String.format("%s-%s.xlsx", path, mailboxSendRecord.getSendBatch() + "-工伤险");
|
|
|
ExcelData excelData = new ExcelData();
|
|
|
excelData.setTitles(Arrays.asList(titles));
|
|
|
- ExcelUtils.createExcel(filePath,excelData);
|
|
|
+ ExcelUtils.createExcel(filePath, excelData);
|
|
|
File excel = new File(filePath);
|
|
|
|
|
|
//发送邮箱
|
|
@@ -308,8 +305,8 @@ public class AgreementLogic {
|
|
|
//分发邮件
|
|
|
|
|
|
for (String s : mailboxSendRecord.getReceiveMailbox().split(",|,")) {
|
|
|
- emailUtilsNew.send(s,mailbox.getSendMailbox(),"工伤险-"+mailboxSendRecord.getSendBatch()+"-"+mailbox.getSendName(),"你好,以下是"+ DateUtil.format(new Date(),"yyyy-MM-dd")
|
|
|
- +mailbox.getSendName()+"保险人员名单详情见附件",filePath);
|
|
|
+ emailUtilsNew.send(s, mailbox.getSendMailbox(), "工伤险-" + mailboxSendRecord.getSendBatch() + "-" + mailbox.getSendName(), "你好,以下是" + DateUtil.format(new Date(), "yyyy-MM-dd")
|
|
|
+ + mailbox.getSendName() + "保险人员名单详情见附件", filePath);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -319,10 +316,10 @@ public class AgreementLogic {
|
|
|
|
|
|
private void sendEmailFileEm(List<MailboxSendRecordPolicy> mailboxSendRecordPolicies, MailboxSendRecord mailboxSendRecord, Mailbox mailbox) throws IOException {
|
|
|
|
|
|
- String[] titles = new String[]{"序号","网点编号","网点名称","保险类型","被保险人姓名","被保险人证件类型","被保险人证件号码",
|
|
|
- "被替换人姓名","被替换人证件类型","被替换人证件号码"};
|
|
|
+ String[] titles = new String[]{"序号", "网点编号", "网点名称", "保险类型", "被保险人姓名", "被保险人证件类型", "被保险人证件号码",
|
|
|
+ "被替换人姓名", "被替换人证件类型", "被替换人证件号码"};
|
|
|
List<List<Object>> rows = new ArrayList<>();
|
|
|
- for(int i = 0;i < mailboxSendRecordPolicies.size();i++) {
|
|
|
+ for (int i = 0; i < mailboxSendRecordPolicies.size(); i++) {
|
|
|
MailboxSendRecordPolicy record = mailboxSendRecordPolicies.get(i);
|
|
|
List<Object> row = new ArrayList<>();
|
|
|
row.add(i + 1);
|
|
@@ -335,7 +332,7 @@ public class AgreementLogic {
|
|
|
row.add(record.getPolicyName());
|
|
|
row.add("居民身份证");
|
|
|
row.add(record.getPolicyIdcard());
|
|
|
- if (!StringUtil.isEmpty(record.getReplaceName())){
|
|
|
+ if (!StringUtil.isEmpty(record.getReplaceName())) {
|
|
|
row.add(record.getReplaceName());
|
|
|
row.add("居民身份证");
|
|
|
row.add(record.getReplaceIdcard());
|
|
@@ -344,14 +341,14 @@ public class AgreementLogic {
|
|
|
}
|
|
|
// 获取资源文件存放路径,用于临时存放生成的excel文件
|
|
|
String path = "/tmp";
|
|
|
- if(active.equals("dev")) {
|
|
|
+ if (active.equals("dev")) {
|
|
|
path = Objects.requireNonNull(this.getClass().getClassLoader().getResource("")).getPath();
|
|
|
}
|
|
|
// 文件名:采用UUID,防止多线程同时生成导致的文件重名
|
|
|
- String filePath = String.format("%s-%s.xlsx",path,mailboxSendRecord.getSendBatch()+"-雇主险");
|
|
|
+ String filePath = String.format("%s-%s.xlsx", path, mailboxSendRecord.getSendBatch() + "-雇主险");
|
|
|
ExcelData excelData = new ExcelData();
|
|
|
excelData.setTitles(Arrays.asList(titles));
|
|
|
- ExcelUtils.createExcel(filePath,excelData);
|
|
|
+ ExcelUtils.createExcel(filePath, excelData);
|
|
|
File excel = new File(filePath);
|
|
|
|
|
|
//发送邮箱
|
|
@@ -360,8 +357,8 @@ public class AgreementLogic {
|
|
|
//分发邮件
|
|
|
|
|
|
for (String s : mailboxSendRecord.getReceiveMailbox().split(",|,")) {
|
|
|
- emailUtilsNew.send(s,mailbox.getSendMailbox(),"雇主险-"+mailboxSendRecord.getSendBatch()+"-"+mailbox.getSendName(),"你好,以下是"+ DateUtil.format(new Date(),"yyyy-MM-dd")
|
|
|
- +mailbox.getSendName()+"保险人员名单详情见附件",filePath);
|
|
|
+ emailUtilsNew.send(s, mailbox.getSendMailbox(), "雇主险-" + mailboxSendRecord.getSendBatch() + "-" + mailbox.getSendName(), "你好,以下是" + DateUtil.format(new Date(), "yyyy-MM-dd")
|
|
|
+ + mailbox.getSendName() + "保险人员名单详情见附件", filePath);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -372,19 +369,19 @@ public class AgreementLogic {
|
|
|
|
|
|
/**
|
|
|
* 发送买保险名单的邮件
|
|
|
+ *
|
|
|
* @param mailboxSendRecordPolicies
|
|
|
* @param mailboxSendRecord
|
|
|
* @param mailbox
|
|
|
- *
|
|
|
*/
|
|
|
- private void sendEmailFile(List<MailboxSendRecordPolicy> mailboxSendRecordPolicies,MailboxSendRecord mailboxSendRecord,Mailbox mailbox) throws IOException {
|
|
|
+ private void sendEmailFile(List<MailboxSendRecordPolicy> mailboxSendRecordPolicies, MailboxSendRecord mailboxSendRecord, Mailbox mailbox) throws IOException {
|
|
|
|
|
|
- String[] titles = new String[]{"序号","投保人","保单号","网点编号","网点名称","保险类型","被保险人姓名","被保险人证件类型","被保险人证件号码"};
|
|
|
+ String[] titles = new String[]{"序号", "投保人", "保单号", "网点编号", "网点名称", "保险类型", "被保险人姓名", "被保险人证件类型", "被保险人证件号码"};
|
|
|
List<List<Object>> rows = new ArrayList<>();
|
|
|
- for(int i = 0;i < mailboxSendRecordPolicies.size();i++){
|
|
|
+ for (int i = 0; i < mailboxSendRecordPolicies.size(); i++) {
|
|
|
MailboxSendRecordPolicy record = mailboxSendRecordPolicies.get(i);
|
|
|
List<Object> row = new ArrayList<>();
|
|
|
- row.add(i+1);
|
|
|
+ row.add(i + 1);
|
|
|
row.add(mailbox.getSendName());
|
|
|
row.add(record.getPolicyNumber());
|
|
|
row.add(record.getWebsitId());
|
|
@@ -397,15 +394,15 @@ public class AgreementLogic {
|
|
|
}
|
|
|
// 获取资源文件存放路径,用于临时存放生成的excel文件
|
|
|
String path = "/tmp";
|
|
|
- if(active.equals("dev")) {
|
|
|
+ if (active.equals("dev")) {
|
|
|
path = Objects.requireNonNull(this.getClass().getClassLoader().getResource("")).getPath();
|
|
|
}
|
|
|
// 文件名:采用UUID,防止多线程同时生成导致的文件重名
|
|
|
- String filePath = String.format("%s-%s.xlsx",path,mailboxSendRecord.getSendBatch()+"-意外险");
|
|
|
+ String filePath = String.format("%s-%s.xlsx", path, mailboxSendRecord.getSendBatch() + "-意外险");
|
|
|
ExcelData excelData = new ExcelData();
|
|
|
excelData.setTitles(Arrays.asList(titles));
|
|
|
excelData.setRows(rows);
|
|
|
- ExcelUtils.createExcel(filePath,excelData);
|
|
|
+ ExcelUtils.createExcel(filePath, excelData);
|
|
|
File excel = new File(filePath);
|
|
|
|
|
|
//发送邮箱
|
|
@@ -414,8 +411,8 @@ public class AgreementLogic {
|
|
|
//分发邮件
|
|
|
|
|
|
for (String s : mailboxSendRecord.getReceiveMailbox().split(",|,")) {
|
|
|
- emailUtilsNew.send(s,mailbox.getSendMailbox(),"意外险-"+mailboxSendRecord.getSendBatch()+"-"+mailbox.getSendName(),"你好,以下是"+ DateUtil.format(new Date(),"yyyy-MM-dd")
|
|
|
- +mailbox.getSendName()+"保险人员名单详情见附件",filePath);
|
|
|
+ emailUtilsNew.send(s, mailbox.getSendMailbox(), "意外险-" + mailboxSendRecord.getSendBatch() + "-" + mailbox.getSendName(), "你好,以下是" + DateUtil.format(new Date(), "yyyy-MM-dd")
|
|
|
+ + mailbox.getSendName() + "保险人员名单详情见附件", filePath);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -449,15 +446,13 @@ public class AgreementLogic {
|
|
|
List<MailboxReceive> mailboxReceives = mailboxReceiveService.lambdaQuery().eq(MailboxReceive::getMailboxId, mailbox.getId()).list();
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//意外保险发送邮件
|
|
|
List<PolicyOrder> policyOrders = policyOrderService.lambdaQuery().eq(PolicyOrder::getType, PolicyTypeEnum.AC.getKey())
|
|
|
.eq(PolicyOrder::getIsPay, IsYesNoEnum.YES.getKey())
|
|
|
.eq(PolicyOrder::getIsSend, IsYesNoEnum.NO.getKey()).list();
|
|
|
|
|
|
|
|
|
- if (!CollectionUtils.isEmpty(policyOrders)){
|
|
|
+ if (!CollectionUtils.isEmpty(policyOrders)) {
|
|
|
MailboxSendRecord mailboxSendRecord = new MailboxSendRecord();
|
|
|
mailboxSendRecord.setId(IdWorker.getIdStr());
|
|
|
mailboxSendRecord.setPolicyType(PolicyTypeEnum.AC.getKey());
|
|
@@ -476,6 +471,7 @@ public class AgreementLogic {
|
|
|
mailboxSendRecordPolicy.setCompanyWechatId(mailboxSendRecord.getCompanyWechatId());
|
|
|
mailboxSendRecordPolicy.setCompanyWechatId(mailboxSendRecord.getCompanyWechatName());
|
|
|
mailboxSendRecordPolicy.setPolicyNumber(policyOrder.getPolicyId());
|
|
|
+ mailboxSendRecordPolicy.setPolicyName(policyOrder.getWorkerName());
|
|
|
mailboxSendRecordPolicy.setWebsitName(policyOrder.getWebsitName());
|
|
|
mailboxSendRecordPolicy.setWebsitId(policyOrder.getWebsitId());
|
|
|
mailboxSendRecordPolicy.setPolicyMobile(policyOrder.getWorkerMobile());
|
|
@@ -514,7 +510,7 @@ public class AgreementLogic {
|
|
|
.eq(PolicyOrder::getType, PolicyTypeEnum.EM.getKey())
|
|
|
.eq(PolicyOrder::getIsSend, IsYesNoEnum.NO.getKey()).list();
|
|
|
|
|
|
- if (!CollectionUtils.isEmpty(policyOrders)){
|
|
|
+ if (!CollectionUtils.isEmpty(policyOrders)) {
|
|
|
MailboxSendRecord mailboxSendRecord = new MailboxSendRecord();
|
|
|
mailboxSendRecord.setId(IdWorker.getIdStr());
|
|
|
mailboxSendRecord.setPolicyType(PolicyTypeEnum.EM.getKey());
|
|
@@ -533,6 +529,7 @@ public class AgreementLogic {
|
|
|
mailboxSendRecordPolicy.setCompanyWechatId(mailboxSendRecord.getCompanyWechatId());
|
|
|
mailboxSendRecordPolicy.setCompanyWechatId(mailboxSendRecord.getCompanyWechatName());
|
|
|
mailboxSendRecordPolicy.setPolicyNumber(policyOrder.getPolicyId());
|
|
|
+ mailboxSendRecordPolicy.setPolicyName(policyOrder.getWorkerName());
|
|
|
mailboxSendRecordPolicy.setPolicyOrderId(policyOrder.getId());
|
|
|
mailboxSendRecordPolicy.setWebsitName(policyOrder.getWebsitName());
|
|
|
mailboxSendRecordPolicy.setWebsitId(policyOrder.getWebsitId());
|
|
@@ -578,7 +575,7 @@ public class AgreementLogic {
|
|
|
.eq(PolicyOrder::getBuyUnitId, mailboxReceive.getDictId())
|
|
|
.eq(PolicyOrder::getIsSend, IsYesNoEnum.NO.getKey()).list();
|
|
|
|
|
|
- if (!CollectionUtils.isEmpty(policyOrdersIn)){
|
|
|
+ if (!CollectionUtils.isEmpty(policyOrdersIn)) {
|
|
|
|
|
|
|
|
|
MailboxSendRecord mailboxSendRecord = new MailboxSendRecord();
|
|
@@ -600,6 +597,7 @@ public class AgreementLogic {
|
|
|
mailboxSendRecordPolicy.setCompanyWechatId(mailboxSendRecord.getCompanyWechatName());
|
|
|
mailboxSendRecordPolicy.setPolicyNumber(policyOrder.getPolicyId());
|
|
|
mailboxSendRecordPolicy.setPolicyOrderId(policyOrder.getId());
|
|
|
+ mailboxSendRecordPolicy.setPolicyName(policyOrder.getWorkerName());
|
|
|
mailboxSendRecordPolicy.setWebsitName(policyOrder.getWebsitName());
|
|
|
mailboxSendRecordPolicy.setWebsitId(policyOrder.getWebsitId());
|
|
|
mailboxSendRecordPolicy.setPolicyMobile(policyOrder.getWorkerMobile());
|
|
@@ -642,110 +640,88 @@ public class AgreementLogic {
|
|
|
|
|
|
List<MailboxReceive> mailboxReceives = mailboxReceiveService.lambdaQuery().eq(MailboxReceive::getMailboxId, mailbox.getId()).list();
|
|
|
|
|
|
- Boolean rece = new EmailUtilsNew(mailbox.getSendMailbox(), mailbox.getSendPassword()).receEmail(mailbox.getAccidentMailbox());
|
|
|
- if(rece){
|
|
|
- //将今天的意外险都收到回执
|
|
|
- mailboxSendRecordService.lambdaUpdate()
|
|
|
- .between(MailboxSendRecord::getSendTime,DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()))
|
|
|
- .eq(MailboxSendRecord::getPolicyType,PolicyTypeEnum.AC.getKey())
|
|
|
- .set(MailboxSendRecord::getReceiptStatus,IsYesNoEnum.YES.getKey())
|
|
|
- .set(MailboxSendRecord::getReceiptTime,new Date()).update();
|
|
|
+ List<MailboxSendRecord> mailboxSendRecordList = mailboxSendRecordService.lambdaQuery()
|
|
|
+ .between(MailboxSendRecord::getSendTime, DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()))
|
|
|
+ .eq(MailboxSendRecord::getReceiptStatus, IsYesNoEnum.NO.getKey()).list();
|
|
|
|
|
|
- //将保险都生效或待生效
|
|
|
- List<MailboxSendRecord> mailboxSendRecords = mailboxSendRecordService.lambdaQuery()
|
|
|
- .between(MailboxSendRecord::getSendTime, DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()))
|
|
|
- .eq(MailboxSendRecord::getPolicyType, PolicyTypeEnum.AC.getKey()).list();
|
|
|
+ for (MailboxSendRecord mailboxSendRecord : mailboxSendRecordList) {
|
|
|
+ Boolean rece = new EmailUtilsNew(mailbox.getSendMailbox(), mailbox.getSendPassword())
|
|
|
+ .receEmail(mailbox.getAccidentMailbox(), mailboxSendRecord.getSendBatch());
|
|
|
|
|
|
- if (!CollectionUtils.isEmpty(mailboxSendRecords)) {
|
|
|
+ List<MailboxSendRecordPolicy> mailboxSendRecordPolicies = mailboxSendRecordPolicyService.lambdaQuery().in(MailboxSendRecordPolicy::getSendBatch, mailboxSendRecord.getSendBatch()).list();
|
|
|
|
|
|
- List<String> sendBatch = mailboxSendRecords.stream().map(MailboxSendRecord::getSendBatch).collect(Collectors.toList());
|
|
|
+ List<String> policyOrderId = mailboxSendRecordPolicies.stream().map(MailboxSendRecordPolicy::getPolicyOrderId).collect(Collectors.toList());
|
|
|
|
|
|
- List<MailboxSendRecordPolicy> mailboxSendRecordPolicies = mailboxSendRecordPolicyService.lambdaQuery().in(MailboxSendRecordPolicy::getSendBatch, sendBatch).list();
|
|
|
|
|
|
- List<String> policyOrderId = mailboxSendRecordPolicies.stream().map(MailboxSendRecordPolicy::getPolicyOrderId).collect(Collectors.toList());
|
|
|
|
|
|
- policyOrderService.lambdaUpdate()
|
|
|
- .in(PolicyOrder::getId,policyOrderId)
|
|
|
- .le(PolicyOrder::getStartTime,new Date())
|
|
|
- .ge(PolicyOrder::getEndTime,new Date())
|
|
|
- .set(PolicyOrder::getPolicyOrderStatus, PolicyOrderEmStutasEnum.BZZ.getKey()).update();
|
|
|
- workerPolicyService.lambdaUpdate()
|
|
|
- .in(WorkerPolicy::getOrderId,policyOrderId)
|
|
|
- .le(WorkerPolicy::getStartTime,new Date())
|
|
|
- .ge(WorkerPolicy::getEndTime,new Date())
|
|
|
- .set(WorkerPolicy::getStatus, "BZZ").update();
|
|
|
+ if (rece) {
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
- Boolean receEm = new EmailUtilsNew(mailbox.getSendMailbox(), mailbox.getSendPassword()).receEmail(mailbox.getEmployerMailbox());
|
|
|
-
|
|
|
- if(receEm){
|
|
|
- //将今天的雇主险都收到回执
|
|
|
- mailboxSendRecordService.lambdaUpdate()
|
|
|
- .between(MailboxSendRecord::getSendTime,DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()))
|
|
|
- .eq(MailboxSendRecord::getPolicyType,PolicyTypeEnum.EM.getKey())
|
|
|
- .set(MailboxSendRecord::getReceiptStatus,IsYesNoEnum.YES.getKey())
|
|
|
- .set(MailboxSendRecord::getReceiptTime,new Date()).update();
|
|
|
-
|
|
|
- //将保险都生效或待生效
|
|
|
- List<MailboxSendRecord> mailboxSendRecords = mailboxSendRecordService.lambdaQuery()
|
|
|
- .between(MailboxSendRecord::getSendTime, DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()))
|
|
|
- .eq(MailboxSendRecord::getPolicyType, PolicyTypeEnum.EM.getKey()).list();
|
|
|
-
|
|
|
- if (!CollectionUtils.isEmpty(mailboxSendRecords)) {
|
|
|
-
|
|
|
- List<String> sendBatch = mailboxSendRecords.stream().map(MailboxSendRecord::getSendBatch).collect(Collectors.toList());
|
|
|
-
|
|
|
- List<MailboxSendRecordPolicy> mailboxSendRecordPolicies = mailboxSendRecordPolicyService.lambdaQuery().in(MailboxSendRecordPolicy::getSendBatch, sendBatch).list();
|
|
|
-
|
|
|
- List<String> policyOrderId = mailboxSendRecordPolicies.stream().map(MailboxSendRecordPolicy::getPolicyOrderId).collect(Collectors.toList());
|
|
|
-
|
|
|
- policyOrderService.lambdaUpdate()
|
|
|
- .in(PolicyOrder::getId,policyOrderId)
|
|
|
- .set(PolicyOrder::getStartTime,DateUtil.beginOfDay(DateUtil.offsetDay(new Date(),1)))
|
|
|
- .set(PolicyOrder::getEndTime,DateUtil.endOfDay(DateUtil.offsetMonth(new Date(),12)))
|
|
|
- .set(PolicyOrder::getPolicyOrderStatus, PolicyOrderEmStutasEnum.DSX.getKey()).update();
|
|
|
-
|
|
|
-
|
|
|
- List<PolicyOrder> policyOrders = policyOrderService.lambdaQuery().in(PolicyOrder::getId, policyOrderId).list();
|
|
|
-
|
|
|
- List<WorkerPolicy> workerPolicies = new ArrayList<>();
|
|
|
-
|
|
|
- for (PolicyOrder policyOrder : policyOrders) {
|
|
|
- WorkerPolicy workerPolicy = new WorkerPolicy();
|
|
|
- workerPolicy.setWorkerId(policyOrder.getWorkerNumber());
|
|
|
- workerPolicy.setType("IN");
|
|
|
- workerPolicy.setPolicyName(policyOrder.getPolicyName());
|
|
|
- workerPolicy.setOrderId(policyOrder.getId());
|
|
|
- workerPolicy.setPolicyOrder(policyOrder.getPolicyId());
|
|
|
- workerPolicy.setPolicyType(policyOrder.getType());
|
|
|
- workerPolicy.setStatus(PolicyOrderEmStutasEnum.DSX.getKey());
|
|
|
- workerPolicy.setStartTime(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(),1)));
|
|
|
- workerPolicy.setEndTime(DateUtil.endOfDay(DateUtil.offsetMonth(new Date(),12)));
|
|
|
- workerPolicy.setWebsitUserId(policyOrder.getWebsitUserId());
|
|
|
- workerPolicy.setWebsitId(policyOrder.getWebsitId());
|
|
|
- workerPolicy.setWebsitName(policyOrder.getWebsitName());
|
|
|
- workerPolicy.setWorkerName(policyOrder.getWorkerName());
|
|
|
- workerPolicies.add(workerPolicy);
|
|
|
+
|
|
|
+ mailboxSendRecord.setReceiptStatus(IsYesNoEnum.YES.getKey());
|
|
|
+ mailboxSendRecord.setReceiptTime(new Date());
|
|
|
+ mailboxSendRecord.updateById();
|
|
|
+
|
|
|
+
|
|
|
+ if (mailboxSendRecord.getPolicyType().equals(PolicyTypeEnum.AC.getKey())) {
|
|
|
+ policyOrderService.lambdaUpdate()
|
|
|
+ .in(PolicyOrder::getId, policyOrderId)
|
|
|
+ .le(PolicyOrder::getStartTime, new Date())
|
|
|
+ .ge(PolicyOrder::getEndTime, new Date())
|
|
|
+ .set(PolicyOrder::getPolicyOrderStatus, PolicyOrderEmStutasEnum.BZZ.getKey()).update();
|
|
|
+ workerPolicyService.lambdaUpdate()
|
|
|
+ .in(WorkerPolicy::getOrderId, policyOrderId)
|
|
|
+ .le(WorkerPolicy::getStartTime, new Date())
|
|
|
+ .ge(WorkerPolicy::getEndTime, new Date())
|
|
|
+ .set(WorkerPolicy::getStatus, "BZZ").update();
|
|
|
}
|
|
|
- workerPolicyService.saveBatch(workerPolicies);
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
+
|
|
|
+ if (mailboxSendRecord.getPolicyType().equals(PolicyTypeEnum.EM.getKey())) {
|
|
|
+
|
|
|
+
|
|
|
+ policyOrderService.lambdaUpdate()
|
|
|
+ .in(PolicyOrder::getId, policyOrderId)
|
|
|
+ .set(PolicyOrder::getStartTime, DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), 1)))
|
|
|
+ .set(PolicyOrder::getEndTime, DateUtil.endOfDay(DateUtil.offsetMonth(new Date(), 12)))
|
|
|
+ .set(PolicyOrder::getPolicyOrderStatus, PolicyOrderEmStutasEnum.DSX.getKey()).update();
|
|
|
+
|
|
|
+
|
|
|
+ List<PolicyOrder> policyOrders = policyOrderService.lambdaQuery().in(PolicyOrder::getId, policyOrderId).list();
|
|
|
+
|
|
|
+ List<WorkerPolicy> workerPolicies = new ArrayList<>();
|
|
|
+
|
|
|
+ for (PolicyOrder policyOrder : policyOrders) {
|
|
|
+ WorkerPolicy workerPolicy = new WorkerPolicy();
|
|
|
+ workerPolicy.setWorkerId(policyOrder.getWorkerNumber());
|
|
|
+ workerPolicy.setType("IN");
|
|
|
+ workerPolicy.setPolicyName(policyOrder.getPolicyName());
|
|
|
+ workerPolicy.setOrderId(policyOrder.getId());
|
|
|
+ workerPolicy.setPolicyOrder(policyOrder.getPolicyId());
|
|
|
+ workerPolicy.setPolicyType(policyOrder.getType());
|
|
|
+ workerPolicy.setStatus(PolicyOrderEmStutasEnum.DSX.getKey());
|
|
|
+ workerPolicy.setStartTime(DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), 1)));
|
|
|
+ workerPolicy.setEndTime(DateUtil.endOfDay(DateUtil.offsetMonth(new Date(), 12)));
|
|
|
+ workerPolicy.setWebsitUserId(policyOrder.getWebsitUserId());
|
|
|
+ workerPolicy.setWebsitId(policyOrder.getWebsitId());
|
|
|
+ workerPolicy.setWebsitName(policyOrder.getWebsitName());
|
|
|
+ workerPolicy.setWorkerName(policyOrder.getWorkerName());
|
|
|
+ workerPolicies.add(workerPolicy);
|
|
|
+ }
|
|
|
+ workerPolicyService.saveBatch(workerPolicies);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (mailboxSendRecord.getPolicyType().equals(PolicyTypeEnum.IN.getKey())) {
|
|
|
+ //将今天的工伤险都收到回执
|
|
|
+ policyOrderService.lambdaUpdate()
|
|
|
+ .in(PolicyOrder::getId, policyOrderId)
|
|
|
+ .set(PolicyOrder::getPolicyOrderStatus, PolicyOrderEmStutasEnum.DSX.getKey()).update();
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- for (MailboxReceive mailboxReceive : mailboxReceives) {
|
|
|
- Boolean receIn = new EmailUtilsNew(mailbox.getSendMailbox(), mailbox.getSendPassword()).receEmail(mailboxReceive.getReceiveMailbox());
|
|
|
-
|
|
|
- if(receIn){
|
|
|
- //将今天的工伤险都收到回执
|
|
|
- mailboxSendRecordService.lambdaUpdate()
|
|
|
- .between(MailboxSendRecord::getSendTime,DateUtil.beginOfDay(new Date()), DateUtil.endOfDay(new Date()))
|
|
|
- .eq(MailboxSendRecord::getPolicyType,PolicyTypeEnum.IN.getKey())
|
|
|
- .eq(MailboxSendRecord::getReceiveMailbox,mailboxReceive.getReceiveMailbox())
|
|
|
- .set(MailboxSendRecord::getReceiptStatus,IsYesNoEnum.YES.getKey())
|
|
|
- .set(MailboxSendRecord::getReceiptTime,new Date()).update();
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -753,12 +729,12 @@ public class AgreementLogic {
|
|
|
public void offInsure() {
|
|
|
|
|
|
workerPolicyService.lambdaUpdate()
|
|
|
- .le(WorkerPolicy::getEndTime,new Date())
|
|
|
- .set(WorkerPolicy::getStatus,PolicyOrderStatusEnum.YSX.getKey()).update();
|
|
|
+ .le(WorkerPolicy::getEndTime, new Date())
|
|
|
+ .set(WorkerPolicy::getStatus, PolicyOrderStatusEnum.YSX.getKey()).update();
|
|
|
|
|
|
policyOrderService.lambdaUpdate()
|
|
|
- .le(PolicyOrder::getEndTime,new Date())
|
|
|
- .set(PolicyOrder::getPolicyOrderStatus,PolicyOrderStatusEnum.YSX.getKey()).update();
|
|
|
+ .le(PolicyOrder::getEndTime, new Date())
|
|
|
+ .set(PolicyOrder::getPolicyOrderStatus, PolicyOrderStatusEnum.YSX.getKey()).update();
|
|
|
|
|
|
|
|
|
List<PolicyOrder> list = policyOrderService.lambdaQuery()
|
|
@@ -769,27 +745,26 @@ public class AgreementLogic {
|
|
|
.select(PolicyOrder::getId)
|
|
|
.list();
|
|
|
|
|
|
- if (!CollectionUtils.isEmpty(list)){
|
|
|
+ if (!CollectionUtils.isEmpty(list)) {
|
|
|
workerPolicyService.lambdaUpdate()
|
|
|
- .ge(WorkerPolicy::getEndTime,new Date())
|
|
|
- .le(WorkerPolicy::getStartTime,new Date())
|
|
|
- .in(WorkerPolicy::getOrderId,list.stream().map(PolicyOrder::getId).collect(Collectors.toList()))
|
|
|
- .ne(WorkerPolicy::getStatus,PolicyOrderStatusEnum.BZZ.getKey())
|
|
|
- .set(WorkerPolicy::getStatus,PolicyOrderStatusEnum.BZZ.getKey())
|
|
|
+ .ge(WorkerPolicy::getEndTime, new Date())
|
|
|
+ .le(WorkerPolicy::getStartTime, new Date())
|
|
|
+ .in(WorkerPolicy::getOrderId, list.stream().map(PolicyOrder::getId).collect(Collectors.toList()))
|
|
|
+ .ne(WorkerPolicy::getStatus, PolicyOrderStatusEnum.BZZ.getKey())
|
|
|
+ .set(WorkerPolicy::getStatus, PolicyOrderStatusEnum.BZZ.getKey())
|
|
|
.update();
|
|
|
}
|
|
|
|
|
|
|
|
|
policyOrderService.lambdaUpdate()
|
|
|
- .ge(PolicyOrder::getEndTime,new Date())
|
|
|
- .le(PolicyOrder::getStartTime,new Date())
|
|
|
- .eq(PolicyOrder::getIsReceipt,IsYesNoEnum.YES.getKey())
|
|
|
- .ne(PolicyOrder::getPolicyOrderStatus,PolicyOrderStatusEnum.BZZ.getKey())
|
|
|
- .set(PolicyOrder::getPolicyOrderStatus,PolicyOrderStatusEnum.BZZ.getKey())
|
|
|
+ .ge(PolicyOrder::getEndTime, new Date())
|
|
|
+ .le(PolicyOrder::getStartTime, new Date())
|
|
|
+ .eq(PolicyOrder::getIsReceipt, IsYesNoEnum.YES.getKey())
|
|
|
+ .ne(PolicyOrder::getPolicyOrderStatus, PolicyOrderStatusEnum.BZZ.getKey())
|
|
|
+ .set(PolicyOrder::getPolicyOrderStatus, PolicyOrderStatusEnum.BZZ.getKey())
|
|
|
.update();
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|
|
@@ -797,8 +772,8 @@ public class AgreementLogic {
|
|
|
List<WebsitUser> websitUsers = websitUserService.lambdaQuery().eq(WebsitUser::getExamineStatus, "WAIT_WORKER").list();
|
|
|
|
|
|
for (WebsitUser websitUser : websitUsers) {
|
|
|
- if (workerPolicyService.lambdaQuery().in(WorkerPolicy::getStatus,"BZZ","DSX")
|
|
|
- .eq(WorkerPolicy::getWebsitUserId,websitUser.getId()).count() > 1) {
|
|
|
+ if (workerPolicyService.lambdaQuery().in(WorkerPolicy::getStatus, "BZZ", "DSX")
|
|
|
+ .eq(WorkerPolicy::getWebsitUserId, websitUser.getId()).count() > 1) {
|
|
|
websitUser.setExamineStatus("POLICY_WAIT");
|
|
|
websitUser.updateById();
|
|
|
}
|