|
@@ -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);
|
|
@@ -668,7 +668,7 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
@Override
|
|
|
public boolean transferGoodsContract(Integer userId, String musicGroupId, String goodsIds, KitGroupPurchaseTypeEnum kitGroupPurchaseTypeEnum) {
|
|
|
if(true){
|
|
|
- return transferProduceContract(userId, musicGroupId);
|
|
|
+ return transferProduceContract(userId, musicGroupId, null);
|
|
|
}
|
|
|
|
|
|
SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
|
|
@@ -890,7 +890,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);
|
|
@@ -968,7 +968,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) {
|
|
@@ -1031,6 +1031,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;
|
|
@@ -1084,7 +1088,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";
|
|
|
|
|
@@ -1131,6 +1135,9 @@ public class ContractServiceImpl implements ContractService, InitializingBean {
|
|
|
ownershipType = musicGroup.getCourseViewType();
|
|
|
}
|
|
|
|
|
|
+ if(Objects.nonNull(courseViewType)){
|
|
|
+ ownershipType = courseViewType;
|
|
|
+ }
|
|
|
|
|
|
templateEngine.render(params, "product"+ownershipType.getContractVersion()+".ftl", srcFile);
|
|
|
|