|
@@ -1,93 +1,53 @@
|
|
|
package com.ym.mec.biz.service.impl;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.io.IOException;
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.math.RoundingMode;
|
|
|
-import java.text.DateFormat;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
-import java.util.Optional;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
import com.microsvc.toolkit.middleware.oss.OssPluginContext;
|
|
|
import com.microsvc.toolkit.middleware.oss.impl.TencentOssPlugin;
|
|
|
-import org.apache.commons.io.FileUtils;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.slf4j.Logger;
|
|
|
-import org.slf4j.LoggerFactory;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.context.annotation.Lazy;
|
|
|
-import org.springframework.scheduling.annotation.Async;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Isolation;
|
|
|
-import org.springframework.transaction.annotation.Propagation;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.util.CollectionUtils;
|
|
|
-
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.auth.api.enums.CertificateTypeEnum;
|
|
|
-import com.ym.mec.biz.dal.dao.EmployeeDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
|
|
|
-import com.ym.mec.biz.dal.dao.MusicGroupStudentFeeDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentDao;
|
|
|
-import com.ym.mec.biz.dal.dao.StudentRegistrationDao;
|
|
|
-import com.ym.mec.biz.dal.dao.SysUserContractsDao;
|
|
|
+import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.CirculationUser;
|
|
|
import com.ym.mec.biz.dal.dto.OAFinancialDto;
|
|
|
import com.ym.mec.biz.dal.dto.StudentInfo;
|
|
|
import com.ym.mec.biz.dal.entity.CooperationOrgan.OwnershipType;
|
|
|
-import com.ym.mec.biz.dal.entity.Goods;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
|
|
|
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
|
|
|
-import com.ym.mec.biz.dal.entity.Organization;
|
|
|
-import com.ym.mec.biz.dal.entity.StudentRegistration;
|
|
|
-import com.ym.mec.biz.dal.entity.Subject;
|
|
|
-import com.ym.mec.biz.dal.entity.SysUserContracts;
|
|
|
+import com.ym.mec.biz.dal.entity.*;
|
|
|
import com.ym.mec.biz.dal.entity.SysUserContracts.ContractType;
|
|
|
-import com.ym.mec.biz.dal.entity.SysUserTsign;
|
|
|
-import com.ym.mec.biz.dal.entity.TenantConfig;
|
|
|
-import com.ym.mec.biz.dal.entity.TenantContractTemplate;
|
|
|
-import com.ym.mec.biz.dal.entity.TenantInfo;
|
|
|
-import com.ym.mec.biz.dal.entity.VipGroup;
|
|
|
import com.ym.mec.biz.dal.enums.CourseViewTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.KitGroupPurchaseTypeEnum;
|
|
|
import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
|
-import com.ym.mec.biz.service.ContractService;
|
|
|
-import com.ym.mec.biz.service.GoodsService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupSubjectGoodsGroupService;
|
|
|
-import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
|
|
|
-import com.ym.mec.biz.service.OrganizationService;
|
|
|
-import com.ym.mec.biz.service.StudentRegistrationService;
|
|
|
-import com.ym.mec.biz.service.SubjectService;
|
|
|
-import com.ym.mec.biz.service.SysUserContractsService;
|
|
|
-import com.ym.mec.biz.service.SysUserTsignService;
|
|
|
-import com.ym.mec.biz.service.TenantConfigService;
|
|
|
-import com.ym.mec.biz.service.TenantContractTemplateService;
|
|
|
-import com.ym.mec.biz.service.TenantInfoService;
|
|
|
-import com.ym.mec.biz.service.VipGroupService;
|
|
|
+import com.ym.mec.biz.service.*;
|
|
|
+import com.ym.mec.common.dto.RealnameAuthenticationDto;
|
|
|
import com.ym.mec.common.exception.BizException;
|
|
|
import com.ym.mec.thirdparty.eseal.ESealPlugin;
|
|
|
import com.ym.mec.thirdparty.user.realname.RealnameAuthenticationPluginContext;
|
|
|
-import com.ym.mec.thirdparty.user.realname.provider.LinkfaceRealnameAuthenticationPlugin;
|
|
|
import com.ym.mec.util.date.DateUtil;
|
|
|
import com.ym.mec.util.freemarker.FreemarkerTemplateEngine;
|
|
|
import com.ym.mec.util.money.MoneyUtil;
|
|
|
import com.ym.mec.util.pdf.PDFUtil;
|
|
|
+import org.apache.commons.io.FileUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Isolation;
|
|
|
+import org.springframework.transaction.annotation.Propagation;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.PostConstruct;
|
|
|
+import java.io.File;
|
|
|
+import java.io.IOException;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
+import java.text.DateFormat;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
public class ContractServiceImpl implements ContractService {
|
|
@@ -246,11 +206,13 @@ public class ContractServiceImpl implements ContractService {
|
|
|
}
|
|
|
|
|
|
if (CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType())) {
|
|
|
- if (!debugMode) {
|
|
|
+ // 取消第三方实名认证
|
|
|
+ RealnameAuthenticationDto.verify(realName, idCardNo);
|
|
|
+ /*if (!debugMode) {
|
|
|
realnameAuthenticationPluginContext.getRealnameAuthenticationPlugin(LinkfaceRealnameAuthenticationPlugin.getName()).verify(realName, idCardNo);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
- accountId = eSealPlugin.createUserAccount(realName, idCardNo, mobileNo);
|
|
|
+ /*accountId = eSealPlugin.createUserAccount(realName, idCardNo, mobileNo);
|
|
|
|
|
|
if (StringUtils.isBlank(accountId)) {
|
|
|
throw new BizException("创建电子存证账户失败");
|
|
@@ -260,7 +222,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
|
|
|
if (StringUtils.isBlank(sealData)) {
|
|
|
throw new BizException("创建电子存证印章失败");
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
|
|
|
sysUserTsign = new SysUserTsign(userId, accountId, sealData, realName, idCardNo, user.getTenantId());
|
|
@@ -310,9 +272,9 @@ public class ContractServiceImpl implements ContractService {
|
|
|
throw new BizException("生成pdf协议失败", e);
|
|
|
}
|
|
|
|
|
|
- if (sysUserTsign != null) {
|
|
|
+ /*if (sysUserTsign != null) {
|
|
|
eSealPlugin.userSign(sysUserTsign.getAccountId(), sysUserTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
Date date = new Date();
|
|
|
// 上传到oss
|
|
@@ -450,7 +412,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
} catch (IOException e) {
|
|
|
throw new BizException("生成pdf协议失败", e);
|
|
|
}
|
|
|
- String organCode = "";
|
|
|
+ /*String organCode = "";
|
|
|
if (musicGroup.getOwnershipType() == OwnershipType.OWN) {
|
|
|
organCode = "91440300326364429H";
|
|
|
} else {
|
|
@@ -464,7 +426,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
eSealPlugin.organSign(organTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
if (sysUserTsign != null) {
|
|
|
eSealPlugin.userSign(sysUserTsign.getAccountId(), sysUserTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 上传到oss
|
|
|
String dateStrOss = dateFormatOss.format(date);
|
|
@@ -631,7 +593,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
} catch (IOException e) {
|
|
|
throw new BizException("生成pdf协议失败", e);
|
|
|
}
|
|
|
- String organCode = "91440300326364429H";
|
|
|
+ /*String organCode = "91440300326364429H";
|
|
|
SysUserTsign organTsign = sysUserTsignService.queryByCardNo(organCode);
|
|
|
if (organTsign == null) {
|
|
|
throw new BizException("甲方未创建签章");
|
|
@@ -641,7 +603,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
|
|
|
if (sysUserTsign != null) {
|
|
|
eSealPlugin.userSign(sysUserTsign.getAccountId(), sysUserTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 上传到oss
|
|
|
String dateStrOss = dateFormatOss.format(date);
|
|
@@ -875,7 +837,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
} catch (IOException e) {
|
|
|
throw new BizException("生成pdf协议失败", e);
|
|
|
}
|
|
|
- String organCode = "91440300326364429H";
|
|
|
+ /*String organCode = "91440300326364429H";
|
|
|
SysUserTsign organTsign = sysUserTsignService.queryByCardNo(organCode);
|
|
|
if (organTsign == null) {
|
|
|
throw new BizException("甲方未创建签章");
|
|
@@ -885,7 +847,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
|
|
|
if (sysUserTsign != null) {
|
|
|
eSealPlugin.userSign(sysUserTsign.getAccountId(), sysUserTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 上传到oss
|
|
|
String dateStrOss = dateFormatOss.format(date);
|
|
@@ -929,12 +891,12 @@ public class ContractServiceImpl implements ContractService {
|
|
|
|
|
|
SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
|
|
|
if (sysUserTsign == null) {
|
|
|
- try {
|
|
|
- sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
|
|
|
+ sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
|
|
|
+ /*try {
|
|
|
} catch (Exception e) {
|
|
|
logger.error("用户电子签章注册失败", e);
|
|
|
return;
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
|
|
@@ -1026,7 +988,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- String organCode = StringUtils.equals(companyName, tenantInfo.getTsignName()) ? tenantInfo.getTsignCode() : organizationDto.getCorporateCode();
|
|
|
+ /*String organCode = StringUtils.equals(companyName, tenantInfo.getTsignName()) ? tenantInfo.getTsignCode() : organizationDto.getCorporateCode();
|
|
|
|
|
|
if (user.getTenantId() == 1) {
|
|
|
if (!OwnershipType.OWN.name().equals(params.get("ownershipType"))) {
|
|
@@ -1042,7 +1004,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
eSealPlugin.organSign(organTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
if (sysUserTsign != null && CertificateTypeEnum.IDENTITY.getCode().equals(user.getCertificateType())) {
|
|
|
eSealPlugin.userSign(sysUserTsign.getAccountId(), sysUserTsign.getSealData(), srcPdfPath, srcPdfPath);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 上传到oss
|
|
|
String dateStrOss = dateFormatOss.format(date);
|
|
@@ -1181,7 +1143,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
List<SysUser> users = employeeDao.getUsers(circulationUserIds);
|
|
|
|
|
|
Integer workOrderId = null;
|
|
|
- List<SysUserTsign> sysUserTsigns = new ArrayList<>();
|
|
|
+// List<SysUserTsign> sysUserTsigns = new ArrayList<>();
|
|
|
for (SysUser user : users) {
|
|
|
for (CirculationUser circulationUser : financialDto.getCirculationUsers()) {
|
|
|
if (workOrderId == null) {
|
|
@@ -1196,14 +1158,14 @@ public class ContractServiceImpl implements ContractService {
|
|
|
}
|
|
|
SysUserTsign sysUserTsign = sysUserTsignService.get(user.getId());
|
|
|
if (sysUserTsign == null) {
|
|
|
- try {
|
|
|
- sysUserTsign = register(user.getId(), user.getRealName(), user.getIdCardNo(), user.getPhone());
|
|
|
+ sysUserTsign = register(user.getId(), user.getRealName(), user.getIdCardNo(), user.getPhone());
|
|
|
+ /*try {
|
|
|
} catch (Exception e) {
|
|
|
logger.error("用户电子签章注册失败", e);
|
|
|
continue;
|
|
|
- }
|
|
|
+ }*/
|
|
|
}
|
|
|
- sysUserTsigns.add(sysUserTsign);
|
|
|
+// sysUserTsigns.add(sysUserTsign);
|
|
|
}
|
|
|
|
|
|
Date date = new Date();
|
|
@@ -1242,9 +1204,9 @@ public class ContractServiceImpl implements ContractService {
|
|
|
logger.error("生成签章协议失败", e);
|
|
|
}
|
|
|
|
|
|
- for (SysUserTsign sysUserTsign : sysUserTsigns) {
|
|
|
+ /*for (SysUserTsign sysUserTsign : sysUserTsigns) {
|
|
|
eSealPlugin.userSign(sysUserTsign.getAccountId(), sysUserTsign.getSealData(), sysUserTsign.getUserId().toString(), srcPdfPath, srcPdfPath);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
//上传到oss
|
|
|
String dateStrOss = dateFormatOss.format(date);
|