|
@@ -1,13 +1,10 @@
|
|
package com.rf.psychological.wxpay.controller;
|
|
package com.rf.psychological.wxpay.controller;
|
|
|
|
|
|
-import cn.hutool.core.date.DatePattern;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import com.rf.psychological.base.rest.BaseController;
|
|
import com.rf.psychological.base.rest.BaseController;
|
|
import com.rf.psychological.dao.model.CognitiveTaskEntity;
|
|
import com.rf.psychological.dao.model.CognitiveTaskEntity;
|
|
-import com.rf.psychological.scale.dao.model.ScaleDetailsEntity;
|
|
|
|
import com.rf.psychological.scale.dao.model.SubjectEntity;
|
|
import com.rf.psychological.scale.dao.model.SubjectEntity;
|
|
import com.rf.psychological.scale.dao.repository.CognitiveTaskRepository;
|
|
import com.rf.psychological.scale.dao.repository.CognitiveTaskRepository;
|
|
-import com.rf.psychological.scale.service.ScaleDetailsService;
|
|
|
|
import com.rf.psychological.scale.service.SubjectService;
|
|
import com.rf.psychological.scale.service.SubjectService;
|
|
import com.rf.psychological.security.SafetyProcess;
|
|
import com.rf.psychological.security.SafetyProcess;
|
|
import com.rf.psychological.utils.Result;
|
|
import com.rf.psychological.utils.Result;
|
|
@@ -39,17 +36,11 @@ import java.util.List;
|
|
public class PromotionInfoController extends BaseController {
|
|
public class PromotionInfoController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private PromotionInfoService infoService;
|
|
private PromotionInfoService infoService;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private CognitiveTaskRepository repository;
|
|
private CognitiveTaskRepository repository;
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private SubjectService subjectService;
|
|
private SubjectService subjectService;
|
|
|
|
|
|
-
|
|
|
|
- @Autowired
|
|
|
|
- private ScaleDetailsService scaleDetailsService;
|
|
|
|
-
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private OrderInfoService orderInfoService;
|
|
private OrderInfoService orderInfoService;
|
|
|
|
|
|
@@ -61,7 +52,6 @@ public class PromotionInfoController extends BaseController {
|
|
try {
|
|
try {
|
|
PromotionInfo info = infoService.findInfoByFlag(subjectId);
|
|
PromotionInfo info = infoService.findInfoByFlag(subjectId);
|
|
SubjectEntity entity = subjectService.getSubjectEntityByFlag(info.getFlag());
|
|
SubjectEntity entity = subjectService.getSubjectEntityByFlag(info.getFlag());
|
|
- //ScaleDetailsEntity entity = scaleDetailsService.getSubjectDetailsByFlag(info.getFlag());
|
|
|
|
if (entity != null){
|
|
if (entity != null){
|
|
info.setName(entity.getName());
|
|
info.setName(entity.getName());
|
|
}
|
|
}
|
|
@@ -81,8 +71,8 @@ public class PromotionInfoController extends BaseController {
|
|
if (info == null){
|
|
if (info == null){
|
|
return success(null,"免费");
|
|
return success(null,"免费");
|
|
}
|
|
}
|
|
- int count = orderInfoService.countNum(info.getFlag(),DateUtil.format(info.getPromotionStartTime(), DatePattern.NORM_DATETIME_PATTERN));
|
|
|
|
- info.setResidueNum(info.getPromotionNum()-count);
|
|
|
|
|
|
+ //int count = orderInfoService.countNum(info.getFlag(),DateUtil.format(info.getPromotionStartTime(), DatePattern.NORM_DATETIME_PATTERN));
|
|
|
|
+ //info.setResidueNum(info.getPromotionNum()-count);
|
|
return success(info);
|
|
return success(info);
|
|
}catch (Exception e ){
|
|
}catch (Exception e ){
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|