|
|
@@ -663,48 +663,48 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(!(ws.getIsPay() != null && ws.getIsPay().intValue() == 1)){
|
|
|
+ if (!(ws.getIsPay() != null && ws.getIsPay().intValue() == 1)) {
|
|
|
System.out.println("进支付比较");
|
|
|
- List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(ws.getAdmissNum(),TimeExchange.getYear());
|
|
|
+ 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) {
|
|
|
+ for (JsonPayVo pi : payInfos) {
|
|
|
payAmount = payAmount.add(pi.getSJJE());
|
|
|
yjPayAmount = yjPayAmount.add(pi.getYJJE());
|
|
|
}
|
|
|
ws.setPayAmount(payAmount);
|
|
|
ws.setAmountPayable(yjPayAmount);
|
|
|
- System.out.println("进支付比较1"+JSON.toJSON(payInfos));
|
|
|
- if(payInfos != null && payInfos.size() > 0){
|
|
|
+ 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("进支付比较3" + JSON.toJSON(paySettings));
|
|
|
+ if (paySettings != null && paySettings.size() > 0) {
|
|
|
System.out.println("进支付比较4");
|
|
|
- for (WelcomePaySetting pay:paySettings) {
|
|
|
+ for (WelcomePaySetting pay : paySettings) {
|
|
|
System.out.println("进支付比较5");
|
|
|
BigDecimal money = pay.getPayAmount();
|
|
|
- if(pay.getMethod().equals("全部")){
|
|
|
+ if (pay.getMethod().equals("全部")) {
|
|
|
BigDecimal totalSj = new BigDecimal(BigInteger.ZERO);
|
|
|
- for (JsonPayVo jpv:payInfos){
|
|
|
+ for (JsonPayVo jpv : payInfos) {
|
|
|
totalSj = totalSj.add(jpv.getSJJE());
|
|
|
}
|
|
|
|
|
|
- if(totalSj.compareTo(money) >= 0){
|
|
|
+ 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){
|
|
|
+ if (ojpv != null && ojpv.isPresent()) {
|
|
|
+ if (ojpv.get().getSJJE().compareTo(money) >= 0) {
|
|
|
ws.setIsPay(1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
ws.setIsPay(0);
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
ws.setIsPay(0);
|
|
|
}
|
|
|
}
|
|
|
@@ -720,7 +720,7 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
throw new Exception("采集学生信息失败!");
|
|
|
//return CommonResult.fail("采集学生信息失败1");
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
int insert = welcomeStudentService.insertWelcomeStudent(ws);
|
|
|
if (insert < 0) {
|
|
|
System.out.println("信息采集1.2");
|
|
|
@@ -1470,32 +1470,32 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
@Override
|
|
|
public CommonResult studentOverview() {
|
|
|
|
|
|
-// 录取总数
|
|
|
- LambdaQueryWrapper<WelcomeStudent> queryWrapper=new LambdaQueryWrapper<>();
|
|
|
- queryWrapper.eq(WelcomeStudent::getIdenType,1);
|
|
|
- int enrollmentTotal = welcomeStudentService.count(queryWrapper);
|
|
|
+ // 录取总数
|
|
|
+ // LambdaQueryWrapper<WelcomeStudent> queryWrapper=new LambdaQueryWrapper<>();
|
|
|
+ // queryWrapper.eq(WelcomeStudent::getIdenType,1);
|
|
|
+ int enrollmentTotal = 6352;//welcomeStudentService.count(queryWrapper);
|
|
|
|
|
|
-// 缴费人数
|
|
|
+ // 缴费人数
|
|
|
int payCount = welcomeStudentService.payCount();
|
|
|
|
|
|
|
|
|
-// 已入住寝室数
|
|
|
+ // 已入住寝室数
|
|
|
LambdaQueryWrapper<WelcomeBed> wrapper = new LambdaQueryWrapper<>();
|
|
|
wrapper.eq(WelcomeBed::getIsCheck, 1)
|
|
|
- .eq(WelcomeBed::getRetentionState,1);
|
|
|
+ .eq(WelcomeBed::getRetentionState, 1);
|
|
|
int checkInBedTotal = welcomeBedService.count(wrapper);
|
|
|
|
|
|
-// 报到率
|
|
|
+ // 报到率
|
|
|
BigDecimal total = new BigDecimal(enrollmentTotal);
|
|
|
BigDecimal bedTotal = new BigDecimal(checkInBedTotal);
|
|
|
- BigDecimal bigDecimal= bedTotal.divide(total).setScale(4,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
- double registrationRate = bigDecimal.doubleValue();
|
|
|
+ BigDecimal bigDecimal = bedTotal.divide(total).setScale(4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100));
|
|
|
+ String registrationRate = String.format("%.2f",(enrollmentTotal / checkInBedTotal) * 100);
|
|
|
|
|
|
|
|
|
LocalDateTime start = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0);
|
|
|
LocalDateTime end = start.plusDays(1);
|
|
|
- Integer mVisitorTotal = welcomeVisitorService.countTotal(start, end,1);
|
|
|
- Integer hVisitorTotal = welcomeVisitorService.countTotal(start, end,2);
|
|
|
+ Integer mVisitorTotal = welcomeVisitorService.countTotal(start, end, 1);
|
|
|
+ Integer hVisitorTotal = welcomeVisitorService.countTotal(start, end, 2);
|
|
|
|
|
|
|
|
|
List<WelcomeSetting> wss = welcomeSettingService.list(null);
|
|
|
@@ -1509,9 +1509,9 @@ public class WelcomeStudentController implements WelcomeStudentControllerAPI {
|
|
|
vo.setPayCount(payCount);
|
|
|
vo.setCheckInBedTotal(checkInBedTotal);
|
|
|
vo.setRegistrationRate(registrationRate);
|
|
|
- vo.setHCarTotal(hCarTotal-hVisitorTotal);
|
|
|
+ vo.setHCarTotal(hCarTotal - hVisitorTotal);
|
|
|
vo.setHVisitorTotal(hVisitorTotal);
|
|
|
- vo.setMCarTotal(mCarTotal-mVisitorTotal);
|
|
|
+ vo.setMCarTotal(mCarTotal - mVisitorTotal);
|
|
|
vo.setMVisitorTotal(mVisitorTotal);
|
|
|
return CommonResult.ok(vo);
|
|
|
}
|
|
|
@@ -1574,47 +1574,47 @@ 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)){
|
|
|
+ if (!(student.getIsPay() != null && student.getIsPay().intValue() == 1)) {
|
|
|
List<JsonPayVo> payInfos = WelcomePayController.queryStudentPayInfo(student.getAdmissNum(), TimeExchange.getYear());
|
|
|
BigDecimal payAmount = new BigDecimal(BigInteger.ZERO);//实缴金额
|
|
|
BigDecimal yjPayAmount = new BigDecimal(BigInteger.ZERO);//应缴金额
|
|
|
- for (JsonPayVo pi:payInfos) {
|
|
|
+ for (JsonPayVo pi : payInfos) {
|
|
|
payAmount = payAmount.add(pi.getSJJE());
|
|
|
yjPayAmount = yjPayAmount.add(pi.getYJJE());
|
|
|
}
|
|
|
student.setPayAmount(payAmount);
|
|
|
student.setAmountPayable(yjPayAmount);
|
|
|
- if(payInfos != null && payInfos.size() > 0){
|
|
|
+ if (payInfos != null && payInfos.size() > 0) {
|
|
|
List<WelcomePaySetting> paySettings = welcomePaySettingService.queryPaySettings(student.getSchool());
|
|
|
- if(paySettings != null && paySettings.size() > 0){
|
|
|
- for (WelcomePaySetting pay:paySettings) {
|
|
|
+ if (paySettings != null && paySettings.size() > 0) {
|
|
|
+ for (WelcomePaySetting pay : paySettings) {
|
|
|
BigDecimal money = pay.getPayAmount();
|
|
|
- if(pay.getMethod().equals("全部")){
|
|
|
+ if (pay.getMethod().equals("全部")) {
|
|
|
BigDecimal totalSj = new BigDecimal(BigInteger.ZERO);
|
|
|
- for (JsonPayVo jpv:payInfos){
|
|
|
+ for (JsonPayVo jpv : payInfos) {
|
|
|
totalSj = totalSj.add(jpv.getSJJE());
|
|
|
}
|
|
|
|
|
|
- if(totalSj.compareTo(money) >= 0){
|
|
|
+ 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){
|
|
|
+ if (ojpv != null && ojpv.isPresent()) {
|
|
|
+ if (ojpv.get().getSJJE().compareTo(money) >= 0) {
|
|
|
student.setIsPay(1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
student.setIsPay(0);
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
student.setIsPay(0);
|
|
|
}
|
|
|
- if(payInfos != null && payInfos.size() > 0){
|
|
|
+ if (payInfos != null && payInfos.size() > 0) {
|
|
|
int update = welcomeStudentService.updateWelcomeStudent(student);
|
|
|
- if(update < 0){
|
|
|
+ if (update < 0) {
|
|
|
logger.error("获取支付信息导致学校信息查询失败");
|
|
|
return CommonResult.fail("查询失败");
|
|
|
}
|