|
@@ -12,6 +12,7 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.io.FileUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.beans.factory.InitializingBean;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -51,7 +52,7 @@ import com.ym.mec.util.money.MoneyUtil;
|
|
import com.ym.mec.util.pdf.PDFUtil;
|
|
import com.ym.mec.util.pdf.PDFUtil;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
-public class ContractServiceImpl implements ContractService {
|
|
|
|
|
|
+public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private SysUserTsignService sysUserTsignService;
|
|
private SysUserTsignService sysUserTsignService;
|
|
@@ -73,7 +74,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
private MusicGroupStudentFeeDao musicGroupStudentFeeDao;
|
|
|
|
|
|
@@ -94,7 +95,7 @@ public class ContractServiceImpl implements ContractService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private GoodsService goodsService;
|
|
private GoodsService goodsService;
|
|
-
|
|
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private MusicGroupService musicGroupService;
|
|
private MusicGroupService musicGroupService;
|
|
|
|
|
|
@@ -104,6 +105,35 @@ public class ContractServiceImpl implements ContractService {
|
|
private DateFormat dateFormatOss = new SimpleDateFormat("yyyy/MM/dd");
|
|
private DateFormat dateFormatOss = new SimpleDateFormat("yyyy/MM/dd");
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
|
+ public void afterPropertiesSet() throws Exception {
|
|
|
|
+ // 注册企业账户
|
|
|
|
+ String orgName = "武汉长乐长风乐器销售有限公司";
|
|
|
|
+ String organCode = "91420106333619290A";
|
|
|
|
+
|
|
|
|
+ SysUserTsign sysUserTsign = sysUserTsignService.queryByCardNo(organCode);
|
|
|
|
+
|
|
|
|
+ if (sysUserTsign == null) {
|
|
|
|
+
|
|
|
|
+ String accountId = eSealPlugin.createOrganAccount(orgName, organCode);
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isBlank(accountId)) {
|
|
|
|
+ throw new BizException("创建企业电子存证账户失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String sealData = eSealPlugin.createSeal(accountId);
|
|
|
|
+
|
|
|
|
+ if (StringUtils.isBlank(sealData)) {
|
|
|
|
+ throw new BizException("创建电子存证印章失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ sysUserTsign = new SysUserTsign(null, accountId, sealData, orgName, organCode);
|
|
|
|
+
|
|
|
|
+ sysUserTsignService.insert(sysUserTsign);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
public SysUserTsign register(Integer userId, String realName, String idCardNo, String mobileNo) {
|
|
public SysUserTsign register(Integer userId, String realName, String idCardNo, String mobileNo) {
|
|
|
|
|
|
SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
|
|
SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
|
|
@@ -122,7 +152,7 @@ public class ContractServiceImpl implements ContractService {
|
|
throw new BizException("创建电子存证印章失败");
|
|
throw new BizException("创建电子存证印章失败");
|
|
}
|
|
}
|
|
|
|
|
|
- sysUserTsign = new SysUserTsign(userId, accountId, sealData);
|
|
|
|
|
|
+ sysUserTsign = new SysUserTsign(userId, accountId, sealData, realName, idCardNo);
|
|
|
|
|
|
sysUserTsignService.insert(sysUserTsign);
|
|
sysUserTsignService.insert(sysUserTsign);
|
|
|
|
|
|
@@ -281,14 +311,14 @@ public class ContractServiceImpl implements ContractService {
|
|
} else {
|
|
} else {
|
|
params.put("paymentcalender", calenders.stream().map(cal -> cal.getPaymentMonth().toString()).collect(Collectors.joining("月,")));
|
|
params.put("paymentcalender", calenders.stream().map(cal -> cal.getPaymentMonth().toString()).collect(Collectors.joining("月,")));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
params.put("isShowVisualSeal", false);
|
|
params.put("isShowVisualSeal", false);
|
|
-
|
|
|
|
|
|
+
|
|
MusicGroup musicGroup = musicGroupService.get(musicGroupId);
|
|
MusicGroup musicGroup = musicGroupService.get(musicGroupId);
|
|
- if(musicGroup == null){
|
|
|
|
|
|
+ if (musicGroup == null) {
|
|
throw new BizException("乐团信息没找到");
|
|
throw new BizException("乐团信息没找到");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
params.put("ownershipType", musicGroup.getOwnershipType().name());
|
|
params.put("ownershipType", musicGroup.getOwnershipType().name());
|
|
|
|
|
|
templateEngine.render(params, "courses.ftl", srcFile);
|
|
templateEngine.render(params, "courses.ftl", srcFile);
|
|
@@ -371,14 +401,14 @@ public class ContractServiceImpl implements ContractService {
|
|
} else {
|
|
} else {
|
|
params.put("paymentcalender", calenders.stream().map(cal -> cal.getPaymentMonth().toString()).collect(Collectors.joining("月,")));
|
|
params.put("paymentcalender", calenders.stream().map(cal -> cal.getPaymentMonth().toString()).collect(Collectors.joining("月,")));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
params.put("isShowVisualSeal", true);
|
|
params.put("isShowVisualSeal", true);
|
|
-
|
|
|
|
|
|
+
|
|
MusicGroup musicGroup = musicGroupService.get(musicGroupId);
|
|
MusicGroup musicGroup = musicGroupService.get(musicGroupId);
|
|
- if(musicGroup == null){
|
|
|
|
|
|
+ if (musicGroup == null) {
|
|
throw new BizException("乐团信息没找到");
|
|
throw new BizException("乐团信息没找到");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
params.put("ownershipType", musicGroup.getOwnershipType().name());
|
|
params.put("ownershipType", musicGroup.getOwnershipType().name());
|
|
|
|
|
|
templateEngine.render(params, "courses.ftl", srcFile);
|
|
templateEngine.render(params, "courses.ftl", srcFile);
|
|
@@ -437,9 +467,9 @@ public class ContractServiceImpl implements ContractService {
|
|
|
|
|
|
// 收费形式
|
|
// 收费形式
|
|
params.put("paymentcalender", "一次性");
|
|
params.put("paymentcalender", "一次性");
|
|
-
|
|
|
|
|
|
+
|
|
params.put("isShowVisualSeal", false);
|
|
params.put("isShowVisualSeal", false);
|
|
-
|
|
|
|
|
|
+
|
|
params.put("ownershipType", "OWN");
|
|
params.put("ownershipType", "OWN");
|
|
|
|
|
|
templateEngine.render(params, "courses.ftl", srcFile);
|
|
templateEngine.render(params, "courses.ftl", srcFile);
|
|
@@ -505,9 +535,9 @@ public class ContractServiceImpl implements ContractService {
|
|
|
|
|
|
// 收费形式
|
|
// 收费形式
|
|
params.put("paymentcalender", "一次性");
|
|
params.put("paymentcalender", "一次性");
|
|
-
|
|
|
|
|
|
+
|
|
params.put("isShowVisualSeal", true);
|
|
params.put("isShowVisualSeal", true);
|
|
-
|
|
|
|
|
|
+
|
|
params.put("ownershipType", "OWN");
|
|
params.put("ownershipType", "OWN");
|
|
|
|
|
|
templateEngine.render(params, "courses.ftl", srcFile);
|
|
templateEngine.render(params, "courses.ftl", srcFile);
|
|
@@ -569,14 +599,14 @@ public class ContractServiceImpl implements ContractService {
|
|
}
|
|
}
|
|
params.put("depositFee", musicGroupSubjectPlan.getDepositFee().doubleValue());
|
|
params.put("depositFee", musicGroupSubjectPlan.getDepositFee().doubleValue());
|
|
params.put("depositFeeFmt", MoneyUtil.toChinese(musicGroupSubjectPlan.getDepositFee().toString()));
|
|
params.put("depositFeeFmt", MoneyUtil.toChinese(musicGroupSubjectPlan.getDepositFee().toString()));
|
|
-
|
|
|
|
|
|
+
|
|
params.put("isShowVisualSeal", false);
|
|
params.put("isShowVisualSeal", false);
|
|
-
|
|
|
|
|
|
+
|
|
MusicGroup musicGroup = musicGroupService.get(musicGroupId);
|
|
MusicGroup musicGroup = musicGroupService.get(musicGroupId);
|
|
- if(musicGroup == null){
|
|
|
|
|
|
+ if (musicGroup == null) {
|
|
throw new BizException("乐团信息没找到");
|
|
throw new BizException("乐团信息没找到");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
params.put("ownershipType", musicGroup.getOwnershipType().name());
|
|
params.put("ownershipType", musicGroup.getOwnershipType().name());
|
|
|
|
|
|
templateEngine.render(params, "goods.ftl", srcFile);
|
|
templateEngine.render(params, "goods.ftl", srcFile);
|
|
@@ -646,14 +676,14 @@ public class ContractServiceImpl implements ContractService {
|
|
}
|
|
}
|
|
params.put("depositFee", musicGroupSubjectPlan.getDepositFee().doubleValue());
|
|
params.put("depositFee", musicGroupSubjectPlan.getDepositFee().doubleValue());
|
|
params.put("depositFeeFmt", MoneyUtil.toChinese(musicGroupSubjectPlan.getDepositFee().toString()));
|
|
params.put("depositFeeFmt", MoneyUtil.toChinese(musicGroupSubjectPlan.getDepositFee().toString()));
|
|
-
|
|
|
|
|
|
+
|
|
params.put("isShowVisualSeal", true);
|
|
params.put("isShowVisualSeal", true);
|
|
-
|
|
|
|
|
|
+
|
|
MusicGroup musicGroup = musicGroupService.get(musicGroupId);
|
|
MusicGroup musicGroup = musicGroupService.get(musicGroupId);
|
|
- if(musicGroup == null){
|
|
|
|
|
|
+ if (musicGroup == null) {
|
|
throw new BizException("乐团信息没找到");
|
|
throw new BizException("乐团信息没找到");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
params.put("ownershipType", musicGroup.getOwnershipType().name());
|
|
params.put("ownershipType", musicGroup.getOwnershipType().name());
|
|
|
|
|
|
templateEngine.render(params, "goods.ftl", srcFile);
|
|
templateEngine.render(params, "goods.ftl", srcFile);
|