|
|
@@ -5,7 +5,7 @@ import com.chuanghai.smartschool.tuitionpayment.anno.AdminLoginCheck;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.common.exception.BizCodeEnume;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.common.exception.RRException;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.common.utils.CommonResult;
|
|
|
-import com.chuanghai.smartschool.tuitionpayment.entity.PayableInfoWaterDeleteEntity;
|
|
|
+import com.chuanghai.smartschool.tuitionpayment.entity.PayOrderEntity;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.entity.PayableInfoWaterEntity;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.service.PayOrderService;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.service.PayableInfoWaterDeleteService;
|
|
|
@@ -15,7 +15,6 @@ import com.chuanghai.smartschool.tuitionpayment.utils.RSAUtils;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.vo.DormVO;
|
|
|
import com.chuanghai.smartschool.tuitionpayment.vo.YearVo;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -107,16 +106,25 @@ public class PayableInfoWaterController {
|
|
|
e.printStackTrace();
|
|
|
throw new RRException(BizCodeEnume.PARAMETER_ERROR, "密码解密失败");
|
|
|
}
|
|
|
-
|
|
|
- if (dorm.contains("层")) {
|
|
|
- int indexD = dorm.indexOf("栋");
|
|
|
- dorm = dorm.substring(0, indexD + 1) + dorm.split("层")[1];
|
|
|
+ //判断如果出现 22栋副2层2号 这个样式的寝室,直接不做宿舍号截取
|
|
|
+ if (!(dorm.contains("副"))) {
|
|
|
+ if ((dorm.contains("单元"))) {
|
|
|
+ int indexD = dorm.indexOf("元");
|
|
|
+ dorm = dorm.substring(0, indexD + 1) + dorm.split("层")[1];
|
|
|
+ } else {
|
|
|
+ if (dorm.contains("层")) {
|
|
|
+ int indexD = dorm.indexOf("栋");
|
|
|
+ dorm = dorm.substring(0, indexD + 1) + dorm.split("层")[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
List<PayableInfoWaterEntity> payableInfoWaterList = payableInfoWaterService.queryWaterInfo(dorm, dormVO.getYear(), dormVO.getPayStatu());
|
|
|
payableInfoWaterList.forEach(payableInfoWaterEntity -> {
|
|
|
if (payableInfoWaterEntity.getPayItemType().equals("2")) {
|
|
|
- String payerName = payOrderService.queryPayerName(payableInfoWaterEntity.getId());
|
|
|
- payableInfoWaterEntity.setPayerName(payerName);
|
|
|
+ PayOrderEntity payOrderEntity = payOrderService.queryOrder(payableInfoWaterEntity.getId());
|
|
|
+ payableInfoWaterEntity.setPayerName(payOrderEntity.getPayerName());
|
|
|
+ payableInfoWaterEntity.setOrderNo(payOrderEntity.getOrderNo());
|
|
|
+ payableInfoWaterEntity.setPayerCardNumber(payOrderEntity.getPayerCardNumber());
|
|
|
}
|
|
|
payableInfoWaterService.updateById(payableInfoWaterEntity);
|
|
|
});
|
|
|
@@ -145,10 +153,18 @@ public class PayableInfoWaterController {
|
|
|
@GetMapping("queryAllYear")
|
|
|
public CommonResult queryAllYear(String dorm, String payStatu) {
|
|
|
|
|
|
- if (dorm.contains("层")) {
|
|
|
- int indexD = dorm.indexOf("栋");
|
|
|
+ //判断如果出现 22栋副2层2号 这个样式的寝室,直接不做宿舍号截取
|
|
|
+ if (!(dorm.contains("副"))) {
|
|
|
+ if ((dorm.contains("单元"))) {
|
|
|
+ int indexD = dorm.indexOf("元");
|
|
|
dorm = dorm.substring(0, indexD + 1) + dorm.split("层")[1];
|
|
|
+ } else {
|
|
|
+ if (dorm.contains("层")) {
|
|
|
+ int indexD = dorm.indexOf("栋");
|
|
|
+ dorm = dorm.substring(0, indexD + 1) + dorm.split("层")[1];
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
List<YearVo> allYearlist = payableInfoWaterService.queryAllYear(dorm, payStatu);
|
|
|
return CommonResult.ok().setResult(allYearlist);
|
|
|
@@ -164,38 +180,38 @@ public class PayableInfoWaterController {
|
|
|
public CommonResult<T> updateDormById(@RequestParam("id") String id, @RequestParam("dorm") String dorm,
|
|
|
@RequestParam("payMonth") String payMonth) {
|
|
|
|
|
|
- PayableInfoWaterEntity waterEntity = new PayableInfoWaterEntity();
|
|
|
- Long ID = Long.parseLong(id);
|
|
|
- waterEntity.setId(ID);
|
|
|
- waterEntity.setDorm(dorm);
|
|
|
- if (!dorm.contains("栋")) {
|
|
|
- throw new RRException(BizCodeEnume.VAILD_EXCEPTION, "宿舍信息填写异常");
|
|
|
- }
|
|
|
-
|
|
|
- QueryWrapper<PayableInfoWaterEntity> wrapper = new QueryWrapper<>();
|
|
|
- wrapper.eq("dorm", dorm)
|
|
|
- .eq("pay_month", payMonth)
|
|
|
- .orderByDesc("pay_item_type");
|
|
|
- List<PayableInfoWaterEntity> listWater = payableInfoWaterService.list(wrapper);
|
|
|
- if (listWater.size() > 0) {
|
|
|
- if (listWater.get(0).getPayItemType().equals("2")) {
|
|
|
-
|
|
|
- PayableInfoWaterDeleteEntity payableInfoWaterDeleteEntity = new PayableInfoWaterDeleteEntity();
|
|
|
- BeanUtils.copyProperties(listWater.get(0), payableInfoWaterDeleteEntity);
|
|
|
- payableInfoWaterDeleteService.save(payableInfoWaterDeleteEntity);
|
|
|
- payableInfoWaterService.removeById(waterEntity.getId());
|
|
|
- return CommonResult.ok().setResult("该宿舍已经缴费,请与寝室长核对缴费信息");
|
|
|
- } else {
|
|
|
- waterEntity.setPayAmountDetail(listWater.get(0).getPayAmountDetail());
|
|
|
- waterEntity.setOrderNotice(listWater.get(0).getOrderNotice());
|
|
|
- waterEntity.setRealPayAmount(listWater.get(0).getRealPayAmount());
|
|
|
- waterEntity.setPayMonth(listWater.get(0).getPayMonth());
|
|
|
- payableInfoWaterService.updateById(waterEntity);
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- throw new RRException(BizCodeEnume.PARAMETER_ERROR, "该宿舍不存在" + payMonth + "缴费信息");
|
|
|
- }
|
|
|
+// PayableInfoWaterEntity waterEntity = new PayableInfoWaterEntity();
|
|
|
+// Long ID = Long.parseLong(id);
|
|
|
+// waterEntity.setId(ID);
|
|
|
+// waterEntity.setDorm(dorm);
|
|
|
+// if (!dorm.contains("栋")) {
|
|
|
+// throw new RRException(BizCodeEnume.VAILD_EXCEPTION, "宿舍信息填写异常");
|
|
|
+// }
|
|
|
+//
|
|
|
+// QueryWrapper<PayableInfoWaterEntity> wrapper = new QueryWrapper<>();
|
|
|
+// wrapper.eq("dorm", dorm)
|
|
|
+// .eq("pay_month", payMonth)
|
|
|
+// .orderByDesc("pay_item_type");
|
|
|
+// List<PayableInfoWaterEntity> listWater = payableInfoWaterService.list(wrapper);
|
|
|
+// if (listWater.size() > 0) {
|
|
|
+// if (listWater.get(0).getPayItemType().equals("2")) {
|
|
|
+//
|
|
|
+// PayableInfoWaterDeleteEntity payableInfoWaterDeleteEntity = new PayableInfoWaterDeleteEntity();
|
|
|
+// BeanUtils.copyProperties(listWater.get(0), payableInfoWaterDeleteEntity);
|
|
|
+// payableInfoWaterDeleteService.save(payableInfoWaterDeleteEntity);
|
|
|
+// payableInfoWaterService.removeById(waterEntity.getId());
|
|
|
+// return CommonResult.ok().setResult("该宿舍已经缴费,请与寝室长核对缴费信息");
|
|
|
+// } else {
|
|
|
+// waterEntity.setPayAmountDetail(listWater.get(0).getPayAmountDetail());
|
|
|
+// waterEntity.setOrderNotice(listWater.get(0).getOrderNotice());
|
|
|
+// waterEntity.setRealPayAmount(listWater.get(0).getRealPayAmount());
|
|
|
+// waterEntity.setPayMonth(listWater.get(0).getPayMonth());
|
|
|
+// payableInfoWaterService.updateById(waterEntity);
|
|
|
+// }
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// throw new RRException(BizCodeEnume.PARAMETER_ERROR, "该宿舍不存在" + payMonth + "缴费信息");
|
|
|
+// }
|
|
|
return CommonResult.ok().setResult(Boolean.TRUE);
|
|
|
}
|
|
|
|
|
|
@@ -211,12 +227,12 @@ public class PayableInfoWaterController {
|
|
|
/**
|
|
|
* 更新缴费名单状态 正在支付时无法重复提交
|
|
|
*
|
|
|
- * @param payInfoId 缴费名单的id
|
|
|
- * @param payStatu 0 代表正在支付的状态
|
|
|
+ * @param payInfoId 缴费名单的id
|
|
|
+ * @param payStatu 0 代表正在支付的状态
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("updateWaterStatu")
|
|
|
- public CommonResult updateWaterStatu(Long payInfoId, String payStatu, String cardNumber,String orderNo) {
|
|
|
+ public CommonResult updateWaterStatu(Long payInfoId, String payStatu, String cardNumber, String orderNo) {
|
|
|
PayableInfoWaterEntity waterInfo = new PayableInfoWaterEntity();
|
|
|
waterInfo.setId(payInfoId);
|
|
|
waterInfo.setPayItemType(payStatu);
|
|
|
@@ -240,11 +256,12 @@ public class PayableInfoWaterController {
|
|
|
|
|
|
/**
|
|
|
* 取消订单正在支付的锁定状态
|
|
|
+ *
|
|
|
* @param payInfoId
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("unlock")
|
|
|
- public CommonResult unlock(Long payInfoId){
|
|
|
+ public CommonResult unlock(Long payInfoId) {
|
|
|
payableInfoWaterService.unlock(payInfoId);
|
|
|
return CommonResult.ok();
|
|
|
}
|