|
|
@@ -1122,9 +1122,9 @@ public class WxBillAllHelper { |
|
|
action.setBillId(bill.getId()); |
|
|
action.setBillId(bill.getId()); |
|
|
action.setBillType(bill.getBillType()); |
|
|
action.setBillType(bill.getBillType()); |
|
|
String oldReceivePay = bill.getReceivePay(); |
|
|
String oldReceivePay = bill.getReceivePay(); |
|
|
|
|
|
//如果账单的开始时间在结束时间之后,已经支付了的要退回。 |
|
|
if (!bill.getStarttime().before(endTime)) { |
|
|
if (!bill.getStarttime().before(endTime)) { |
|
|
if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() || |
|
|
|
|
|
bill.getStatus().intValue() == EnumBillStatus.BAD.getCode().intValue()) { |
|
|
|
|
|
|
|
|
if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue()) { |
|
|
EnumBillStatus realBillStatus = EnumBillStatus.INVALID; |
|
|
EnumBillStatus realBillStatus = EnumBillStatus.INVALID; |
|
|
String newReceivePay = bill.getReceivePay(); |
|
|
String newReceivePay = bill.getReceivePay(); |
|
|
if (isPaid) { |
|
|
if (isPaid) { |
|
|
@@ -1139,7 +1139,7 @@ public class WxBillAllHelper { |
|
|
action.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null, null,null,EnumBillStatus.getEnum(bill.getStatus()),realBillStatus)); |
|
|
action.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null, null,null,EnumBillStatus.getEnum(bill.getStatus()),realBillStatus)); |
|
|
action.setRemark("商户停用,停用日期["+endTimeStr+"]"+"系统自动变更状态,应收金额变为0"); |
|
|
action.setRemark("商户停用,停用日期["+endTimeStr+"]"+"系统自动变更状态,应收金额变为0"); |
|
|
isUpdate = true; |
|
|
isUpdate = true; |
|
|
//如果是已支付,则需退回全部费用 |
|
|
|
|
|
|
|
|
//如果是已结清,则需退回全部费用 |
|
|
}else if (bill.getStatus().intValue() == EnumBillStatus.PAID.getCode().intValue()) { |
|
|
}else if (bill.getStatus().intValue() == EnumBillStatus.PAID.getCode().intValue()) { |
|
|
bill.setReceivePay("0"); |
|
|
bill.setReceivePay("0"); |
|
|
bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); |
|
|
bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); |
|
|
@@ -1150,8 +1150,10 @@ public class WxBillAllHelper { |
|
|
action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); |
|
|
action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); |
|
|
isUpdate = true; |
|
|
isUpdate = true; |
|
|
}else { |
|
|
}else { |
|
|
//do nothing |
|
|
|
|
|
|
|
|
//其他状态的账单无需处理 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//如果结束时间在中间,则按天计算差额退回 |
|
|
}else if (bill.getStarttime().before(endTime) && bill.getEndtime().after(endTime)){ |
|
|
}else if (bill.getStarttime().before(endTime) && bill.getEndtime().after(endTime)){ |
|
|
int realDays = DateUtils.daysBetween(bill.getStarttime(),endTime); |
|
|
int realDays = DateUtils.daysBetween(bill.getStarttime(),endTime); |
|
|
int billDays = DateUtils.daysBetween(bill.getStarttime(),bill.getEndtime()); |
|
|
int billDays = DateUtils.daysBetween(bill.getStarttime(),bill.getEndtime()); |
|
|
@@ -1161,8 +1163,8 @@ public class WxBillAllHelper { |
|
|
} |
|
|
} |
|
|
action.setOldMoney(oldReceivePay); |
|
|
action.setOldMoney(oldReceivePay); |
|
|
action.setNewMoney(newReceivePay); |
|
|
action.setNewMoney(newReceivePay); |
|
|
if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() |
|
|
|
|
|
|| bill.getStatus().intValue() == EnumBillStatus.BAD.getCode().intValue()) { |
|
|
|
|
|
|
|
|
//账单有欠费 |
|
|
|
|
|
if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue()) { |
|
|
bill.setReceivePay(newReceivePay); |
|
|
bill.setReceivePay(newReceivePay); |
|
|
bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); |
|
|
bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); |
|
|
action.setAction(EnumBillAction.UPDATE_BILL.getCode()); |
|
|
action.setAction(EnumBillAction.UPDATE_BILL.getCode()); |
|
|
@@ -1180,25 +1182,16 @@ public class WxBillAllHelper { |
|
|
//do nothing |
|
|
//do nothing |
|
|
} |
|
|
} |
|
|
}else { |
|
|
}else { |
|
|
|
|
|
//如果账单属于结束时间之前的,欠缴费的也需要结算 |
|
|
if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue()) { |
|
|
if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue()) { |
|
|
if (isAllReturn) { |
|
|
if (isAllReturn) { |
|
|
if (isPaid) { |
|
|
|
|
|
bill.setReceivePay("0"); |
|
|
|
|
|
bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); |
|
|
|
|
|
action.setOldMoney(oldReceivePay); |
|
|
|
|
|
action.setNewMoney("0"); |
|
|
|
|
|
action.setAction(EnumBillAction.UPDATE_BILL.getCode()); |
|
|
|
|
|
action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, "0", null,null,null,null)); |
|
|
|
|
|
action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); |
|
|
|
|
|
}else { |
|
|
|
|
|
bill.setReceivePay("0"); |
|
|
|
|
|
bill.setStatus(EnumBillStatus.INVALID.getCode()); |
|
|
|
|
|
action.setOldMoney(oldReceivePay); |
|
|
|
|
|
action.setNewMoney("0"); |
|
|
|
|
|
action.setAction(EnumBillAction.STATUS_CHANGE.getCode()); |
|
|
|
|
|
action.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null, null,null,EnumBillStatus.getEnum(bill.getStatus()),EnumBillStatus.INVALID)); |
|
|
|
|
|
action.setRemark("商户停用,停用日期["+endTimeStr+"]"+"系统自动变更状态,应收金额变为0"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
bill.setReceivePay("0"); |
|
|
|
|
|
bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); |
|
|
|
|
|
action.setOldMoney(oldReceivePay); |
|
|
|
|
|
action.setNewMoney("0"); |
|
|
|
|
|
action.setAction(EnumBillAction.UPDATE_BILL.getCode()); |
|
|
|
|
|
action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, "0", null,null,null,null)); |
|
|
|
|
|
action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); |
|
|
}else { |
|
|
}else { |
|
|
bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); |
|
|
bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); |
|
|
action.setOldMoney(oldReceivePay); |
|
|
action.setOldMoney(oldReceivePay); |
|
|
|