|
|
@@ -11,6 +11,7 @@ import com.template.annotation.PassToken;
|
|
|
import com.template.api.WelcomeStudentControllerAPI;
|
|
|
import com.template.common.utils.ExcelUtils;
|
|
|
import com.template.common.utils.JWTUtil;
|
|
|
+import com.template.common.utils.TimeExchange;
|
|
|
import com.template.common.utils.paramUtils;
|
|
|
import com.template.model.enumModel.eFileType;
|
|
|
import com.template.model.enumModel.eProjectType;
|
|
|
@@ -44,6 +45,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.math.BigInteger;
|
|
|
import java.text.ParseException;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
@@ -86,17 +89,19 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
private WelcomeCityService welcomeCityService;
|
|
|
|
|
|
@Autowired
|
|
|
- WelcomeSchoolService welcomeSchoolService;
|
|
|
+ private WelcomeSchoolService welcomeSchoolService;
|
|
|
|
|
|
@Autowired
|
|
|
- WelcomeBuildService welcomeBuildService;
|
|
|
+ private WelcomeBuildService welcomeBuildService;
|
|
|
|
|
|
@Autowired
|
|
|
- WelcomeDormitoryService welcomeDormitoryService;
|
|
|
+ private WelcomeDormitoryService welcomeDormitoryService;
|
|
|
|
|
|
@Autowired
|
|
|
- WelcomeVisitorService welcomeVisitorService;
|
|
|
+ private WelcomeVisitorService welcomeVisitorService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private WelcomePaySettingService welcomePaySettingService;
|
|
|
|
|
|
private static Logger logger = LoggerFactory.getLogger(WelcomeStudentController.class);
|
|
|
|
|
|
@@ -1509,6 +1514,44 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
@Override
|
|
|
public CommonResult queryStudentByToken(String userId) {
|
|
|
WelcomeStudent student = welcomeStudentService.getManageById(Integer.valueOf(userId));
|
|
|
+ if(!(student.getIsPay() != null && student.getIsPay().intValue() == 1)){
|
|
|
+ List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(student.getAdmissNum(), TimeExchange.getYear());
|
|
|
+ if(payInfos != null && payInfos.size() > 0){
|
|
|
+ List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(student.getSchool());
|
|
|
+ if(paySettings != null && paySettings.size() > 0){
|
|
|
+ for (WelcomePaySetting pay:paySettings) {
|
|
|
+ BigDecimal money = pay.getPayAmount();
|
|
|
+ if(pay.getMethod().equals("全部")){
|
|
|
+ BigDecimal totalSj = new BigDecimal(BigInteger.ZERO);
|
|
|
+ for (JsonPayVo jpv:payInfos){
|
|
|
+ totalSj = totalSj.add(jpv.getSJJE());
|
|
|
+ }
|
|
|
+
|
|
|
+ if(totalSj.compareTo(money) >= 0){
|
|
|
+ student.setIsPay(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Optional<JsonPayVo> ojpv = payInfos.stream().filter(e -> e.getSFXMMC().equals(pay.getMethod())).findFirst();
|
|
|
+ if(ojpv != null && ojpv.isPresent()){
|
|
|
+ if(ojpv.get().getSJJE().compareTo(money) >= 0){
|
|
|
+ student.setIsPay(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ student.setIsPay(0);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ student.setIsPay(0);
|
|
|
+ }
|
|
|
+ if(student.getIsPay().intValue() == 1){
|
|
|
+ int update = welcomeStudentService.updateWelcomeStudent(student);
|
|
|
+ if(update < 0){
|
|
|
+ logger.error("获取支付信息导致学校信息查询失败");
|
|
|
+ return CommonResult.fail("查询失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
return CommonResult.ok(student);
|
|
|
}
|
|
|
}
|