|
|
@@ -1625,7 +1625,73 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
|
|
|
@Override
|
|
|
public CommonResult queryStudentInfo(String admissNum) {
|
|
|
- return null;
|
|
|
+ WelcomeStudent ws = welcomeStudentService.getDataByNum(admissNum);
|
|
|
+ if(ws == null){
|
|
|
+ return CommonResult.fail("当前学生信息已失效,查询失败");
|
|
|
+ }
|
|
|
+ List<PayDetailVO> pdvs = new ArrayList<>();
|
|
|
+ System.out.println("进支付比较");
|
|
|
+ List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(ws.getAdmissNum(), TimeExchange.getYear());
|
|
|
+ BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
|
|
|
+ BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
|
|
|
+ for (JsonPayVo pi : payInfos) {
|
|
|
+ payAmount = payAmount.add(pi.getSJJE());
|
|
|
+ yjPayAmount = yjPayAmount.add(pi.getYJJE());
|
|
|
+ PayDetailVO pdv = new PayDetailVO();
|
|
|
+ pdv.setPayName(pi.getSFXMMC());
|
|
|
+ pdv.setYJJE(pi.getYJJE());
|
|
|
+ pdv.setSJJE(pi.getSJJE());
|
|
|
+ pdvs.add(pdv);
|
|
|
+ }
|
|
|
+ ws.setPayAmount(payAmount);
|
|
|
+ ws.setAmountPayable(yjPayAmount);
|
|
|
+ System.out.println("进支付比较1" + JSON.toJSON(payInfos));
|
|
|
+ if (payInfos != null && payInfos.size() > 0) {
|
|
|
+ System.out.println("进支付比较2");
|
|
|
+ List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(ws.getSchool());
|
|
|
+ System.out.println("进支付比较3" + JSON.toJSON(paySettings));
|
|
|
+ if (paySettings != null && paySettings.size() > 0) {
|
|
|
+ System.out.println("进支付比较4");
|
|
|
+ for (WelcomePaySetting pay : paySettings) {
|
|
|
+ System.out.println("进支付比较5");
|
|
|
+ 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) {
|
|
|
+ ws.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) {
|
|
|
+ ws.setIsPay(1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ws.setIsPay(0);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ws.setIsPay(0);
|
|
|
+ }
|
|
|
+ if(!(ws.getIsPay() != null && ws.getIsPay().intValue() == 1)){
|
|
|
+ int updateResult = welcomeStudentService.updateWelcomeStudent(ws);
|
|
|
+ if(updateResult < 0){
|
|
|
+ return CommonResult.fail("查询支付信息失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ PayInfoVO result = new PayInfoVO();
|
|
|
+ result.setId(ws.getId());
|
|
|
+ result.setName(ws.getName());
|
|
|
+ result.setAdmissNum(ws.getAdmissNum());
|
|
|
+ result.setIsPay(ws.getIsPay());
|
|
|
+ result.setPays(pdvs);
|
|
|
+ return CommonResult.ok(result);
|
|
|
}
|
|
|
}
|
|
|
|