Browse Source

feature 缴费记录年份不对的问题

xiahan 4 months ago
parent
commit
b29c0d18ee

+ 4 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/system/wechat/impl/PaymentRecordServiceImpl.java

@@ -177,6 +177,8 @@ public class PaymentRecordServiceImpl implements PaymentRecordService {
     public SwBillingRecordDo generateRecord(SwUserManagementDo swUserManagementDo, List<SwBillManagementUnpaidDo> unpaidDoList,
                                             BigDecimal paymentAmount,String orderNo,String openId) {
         Date now = new Date();
+        Calendar instance = Calendar.getInstance();
+        instance.setTime(now);
         // 缴费记录
         SwBillingRecordDo swBillingRecordDo = new SwBillingRecordDo();
         swBillingRecordDo.setId(SecurityUtil.getUUID());
@@ -184,7 +186,7 @@ public class PaymentRecordServiceImpl implements PaymentRecordService {
         swBillingRecordService.generateBillingNumber(swBillingRecordDo);
         swBillingRecordDo.setChargedate(now);
         swBillingRecordDo.setPayfeesstatus(PAIDSTATUS);
-        swBillingRecordDo.setYear(Calendar.getInstance().get(Calendar.YEAR));
+        swBillingRecordDo.setYear(instance.get(Calendar.YEAR));
         swBillingRecordDo.setUsername(swUserManagementDo.getUsername());
         swBillingRecordDo.setUsernumber(swUserManagementDo.getUsernumber());
         swBillingRecordDo.setUsertype(swUserManagementDo.getUsertypeid());
@@ -205,7 +207,7 @@ public class PaymentRecordServiceImpl implements PaymentRecordService {
         swBillingRecordDo.setAmountpaid(paymentAmount);
         // swBillingRecordDo.setPaymentcompletiontime(now);
         swBillingRecordDo.setOrdercreationtime(now);
-        swBillingRecordDo.setYear(now.getYear());
+        swBillingRecordDo.setYear(instance.get(Calendar.YEAR));
         swBillingRecordDo.setCreateuserid(openId);
         swBillingRecordDo.setCreateusername(openId);
         swBillingRecordDo.setCreatedate(now);