|
|
@@ -330,7 +330,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
@Override
|
|
|
public boolean transferMusicGroupCoursesContract(Integer userId, String musicGroupId) {
|
|
|
if(true){
|
|
|
- return transferProduceContract(userId, musicGroupId);
|
|
|
+ return transferProduceContract(userId, musicGroupId, null);
|
|
|
}
|
|
|
SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
|
|
|
|
|
|
@@ -525,7 +525,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
@Override
|
|
|
public boolean transferVipGroupCoursesContract(Integer userId, Long vipGroupId) {
|
|
|
if(true){
|
|
|
- return transferProduceContract(userId, null);
|
|
|
+ return transferProduceContract(userId, null, null);
|
|
|
}
|
|
|
|
|
|
SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
|
|
|
@@ -667,8 +667,8 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
|
|
|
@Override
|
|
|
public boolean transferGoodsContract(Integer userId, String musicGroupId, String goodsIds, KitGroupPurchaseTypeEnum kitGroupPurchaseTypeEnum) {
|
|
|
-
|
|
|
- return transferProduceContract(userId, musicGroupId);
|
|
|
+
|
|
|
+ return transferProduceContract(userId, musicGroupId, null);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -778,7 +778,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
@Override
|
|
|
public boolean transferPracticeCoursesContract(Integer userId, int courseSectionNum, Date startDate, Date endDate, BigDecimal fee) {
|
|
|
if(true){
|
|
|
- return transferProduceContract(userId, null);
|
|
|
+ return transferProduceContract(userId, null, null);
|
|
|
}
|
|
|
|
|
|
SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
|
|
|
@@ -856,7 +856,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRES_NEW)
|
|
|
- public boolean transferProduceContract(Integer userId,String musicGroupId) {
|
|
|
+ public boolean transferProduceContract(Integer userId,String musicGroupId, CourseViewTypeEnum courseViewType) {
|
|
|
SysUser user = studentDao.lockUserReturnInfo(userId);
|
|
|
|
|
|
if (user == null) {
|
|
|
@@ -919,6 +919,10 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
ownershipType = musicGroup.getCourseViewType();
|
|
|
}
|
|
|
|
|
|
+ if(Objects.nonNull(courseViewType)){
|
|
|
+ ownershipType = courseViewType;
|
|
|
+ }
|
|
|
+
|
|
|
List<SysUserContracts> userContracts = sysUserContractsService.getUserContractWithType(userId, ContractType.PRODUCT, ownershipType.getContractVersion());
|
|
|
if(!CollectionUtils.isEmpty(userContracts)){
|
|
|
return true;
|
|
|
@@ -972,7 +976,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
|
|
|
@Override
|
|
|
@Transactional(isolation = Isolation.READ_COMMITTED)
|
|
|
- public Map<String, Object> queryProductContract(Integer userId,String musicGroupId) {
|
|
|
+ public Map<String, Object> queryProductContract(Integer userId,String musicGroupId, CourseViewTypeEnum courseViewType) {
|
|
|
// 合成freemarker
|
|
|
String srcPdfPath = contractBaseDir + "/product/" + userId + ".pdf";
|
|
|
|
|
|
@@ -1019,6 +1023,9 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
ownershipType = musicGroup.getCourseViewType();
|
|
|
}
|
|
|
|
|
|
+ if(Objects.nonNull(courseViewType)){
|
|
|
+ ownershipType = courseViewType;
|
|
|
+ }
|
|
|
|
|
|
templateEngine.render(params, "product"+ownershipType.getContractVersion()+".ftl", srcFile);
|
|
|
|