| @@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.annotation.TableField; | |||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||
| import com.iformall.common.SortColumn; | import com.iformall.common.SortColumn; | ||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.enums.EnumBillAction; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | import lombok.EqualsAndHashCode; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| @@ -68,9 +70,11 @@ public class WxBillBaseEntity extends TenantEntity { | |||||
| return "0"; | return "0"; | ||||
| } | } | ||||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "坏账_7"}, width = 20, orderNum = "10") | |||||
| @Excel(name = "状态", replace = {"欠缴_1", "待缴_2", "已结清_3", "未到期_4", "已退还_5", "失效_6", "坏账_7", "退租待结算_8"}, width = 20, orderNum = "10") | |||||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") | @io.swagger.annotations.ApiModelProperty(value = "账单状态EnumBillStatus", name = "status") | ||||
| protected Integer status; | protected Integer status; | ||||
| @TableField(exist = false) | |||||
| protected List<Integer> statusList; | |||||
| //@Excel(name = "实际应收总金额(元)", width = 20, orderNum = "8") | //@Excel(name = "实际应收总金额(元)", width = 20, orderNum = "8") | ||||
| @io.swagger.annotations.ApiModelProperty(value="实际应收金额(加上了滞纳金服务费等费用)",name="realReceivePay") | @io.swagger.annotations.ApiModelProperty(value="实际应收金额(加上了滞纳金服务费等费用)",name="realReceivePay") | ||||
| @@ -150,6 +154,4 @@ public class WxBillBaseEntity extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private Integer notifyed; | private Integer notifyed; | ||||
| } | } | ||||
| @@ -9,12 +9,13 @@ public enum EnumBillAction { | |||||
| SELF_SERVICE_PAY(1, "自助缴费"), | SELF_SERVICE_PAY(1, "自助缴费"), | ||||
| UPDATE_BILL(2, "账单金额变更"), | UPDATE_BILL(2, "账单金额变更"), | ||||
| OFFLINE_PAY(3, "线下缴费"), | OFFLINE_PAY(3, "线下缴费"), | ||||
| DEPOSIT_RETURN(5, "押金退还"), | |||||
| RETURN(5, "账单退还"), | |||||
| //IMPORT_PAY(10, "导入缴费"), | //IMPORT_PAY(10, "导入缴费"), | ||||
| UPDATE_LATE_PAY_MONEY(7, "滞纳金变更"), | UPDATE_LATE_PAY_MONEY(7, "滞纳金变更"), | ||||
| UPDATE_SERVICE_MONEY(9, "手续费变更"), | UPDATE_SERVICE_MONEY(9, "手续费变更"), | ||||
| NOTIFY(10,"催缴"), | NOTIFY(10,"催缴"), | ||||
| BAD(11,"坏账"); | |||||
| BAD(11,"坏账"), | |||||
| STATUS_CHANGE(12,"状态变更"); | |||||
| public static EnumBillAction getEnum(Integer code) { | public static EnumBillAction getEnum(Integer code) { | ||||
| for (EnumBillAction value : values()) { | for (EnumBillAction value : values()) { | ||||
| @@ -59,7 +60,7 @@ public enum EnumBillAction { | |||||
| sb.append(pw.getMessage()).append("支付"); | sb.append(pw.getMessage()).append("支付"); | ||||
| } | } | ||||
| sb.append(newMoney).append("元"); | sb.append(newMoney).append("元"); | ||||
| }else if (code.intValue() == DEPOSIT_RETURN.code.intValue()) { | |||||
| }else if (code.intValue() == RETURN.code.intValue()) { | |||||
| sb.append(newMoney).append("元"); | sb.append(newMoney).append("元"); | ||||
| }else if (code.intValue() == UPDATE_LATE_PAY_MONEY.code.intValue()) { | }else if (code.intValue() == UPDATE_LATE_PAY_MONEY.code.intValue()) { | ||||
| sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | ||||
| @@ -69,6 +70,8 @@ public enum EnumBillAction { | |||||
| sb.append("在线催缴通知"); | sb.append("在线催缴通知"); | ||||
| }else if (code.intValue() == BAD.code.intValue()){ | }else if (code.intValue() == BAD.code.intValue()){ | ||||
| sb.append("欠缴金额").append(oldMoney).append("元"); | sb.append("欠缴金额").append(oldMoney).append("元"); | ||||
| }else if (code.intValue() == STATUS_CHANGE.code.intValue()){ | |||||
| sb.append(""); | |||||
| }else { | }else { | ||||
| sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | sb.append("应付金额").append(oldMoney).append("元变更成").append(newMoney).append("元"); | ||||
| } | } | ||||
| @@ -13,6 +13,7 @@ public enum EnumBillStatus { | |||||
| //RETURN(5, "已退还"), | //RETURN(5, "已退还"), | ||||
| INVALID(6, "失效"), | INVALID(6, "失效"), | ||||
| BAD(7, "坏账"), | BAD(7, "坏账"), | ||||
| STOP_TO_SETTLE(8,"商户停用待结算") | |||||
| ; | ; | ||||
| public static EnumBillStatus getEnum(Integer code) { | public static EnumBillStatus getEnum(Integer code) { | ||||
| @@ -6,7 +6,9 @@ import com.iformall.domain.dto.WxBillPayDTO; | |||||
| import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | import com.iformall.domain.dto.WxBillReceiveUpdateDTO; | ||||
| import com.iformall.domain.po.MallUserInfo; | import com.iformall.domain.po.MallUserInfo; | ||||
| import com.iformall.domain.po.WxBillRent; | import com.iformall.domain.po.WxBillRent; | ||||
| import com.iformall.domain.po.WxMerchant; | |||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | import com.iformall.domain.vo.WxBillHotNotify; | ||||
| import com.iformall.domain.vo.WxBillNotify; | import com.iformall.domain.vo.WxBillNotify; | ||||
| @@ -93,4 +95,6 @@ public interface WxBillRentService { | |||||
| void updatePayByMerchant(WxBillPayDTO dto,WxMerchantBUser user,boolean isOnline); | void updatePayByMerchant(WxBillPayDTO dto,WxMerchantBUser user,boolean isOnline); | ||||
| void bad(WxBillPayDTO dto,MallUserInfo user); | void bad(WxBillPayDTO dto,MallUserInfo user); | ||||
| void rentContractBillStop(WxRentContract rentContract); | |||||
| } | } | ||||
| @@ -33,6 +33,8 @@ import com.iformall.domain.po.WxBillRent; | |||||
| import com.iformall.domain.po.WxBillRentManage; | import com.iformall.domain.po.WxBillRentManage; | ||||
| import com.iformall.domain.po.WxMerchant; | import com.iformall.domain.po.WxMerchant; | ||||
| import com.iformall.domain.po.WxMerchantBUser; | import com.iformall.domain.po.WxMerchantBUser; | ||||
| import com.iformall.domain.po.WxPropertyContract; | |||||
| import com.iformall.domain.po.WxRentContract; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.domain.po.base.WxBillBaseEntity; | import com.iformall.domain.po.base.WxBillBaseEntity; | ||||
| import com.iformall.domain.vo.WxBillHotNotify; | import com.iformall.domain.vo.WxBillHotNotify; | ||||
| @@ -42,6 +44,7 @@ import com.iformall.domain.vo.WxShopVo; | |||||
| import com.iformall.enums.EnumBillAction; | import com.iformall.enums.EnumBillAction; | ||||
| import com.iformall.enums.EnumBillAllType; | import com.iformall.enums.EnumBillAllType; | ||||
| import com.iformall.enums.EnumBillDailyType; | import com.iformall.enums.EnumBillDailyType; | ||||
| import com.iformall.enums.EnumBillStatus; | |||||
| import com.iformall.enums.EnumBillType; | import com.iformall.enums.EnumBillType; | ||||
| import com.iformall.enums.EnumRentContractManageFeeType; | import com.iformall.enums.EnumRentContractManageFeeType; | ||||
| import com.iformall.enums.EnumYesOrNo; | import com.iformall.enums.EnumYesOrNo; | ||||
| @@ -949,4 +952,98 @@ public class WxBillAllHelper { | |||||
| wxBillOtherDepositService.bad(dto, user); | wxBillOtherDepositService.bad(dto, user); | ||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * 退租: | |||||
| * 账单开始时间>= 今天,并且账单是 WAIT_PAY,NOT_PAID,NOT_EXPIRED,BAD 变为INVALID | |||||
| * 账单开始时间<今天 & 账单结束时间 > 今天: | |||||
| * 账单 WAIT_PAY,NOT_PAID,NOT_EXPIRED,BAD 的,需要计算截止到今天账单总金额是多少钱,更新实际应收金额,并记录日志 | |||||
| * 账单 PAID, 需要计算截止到今天账单总金额是多少钱,更新实际应收金额,并记录日志 | |||||
| * 账单开始时间<今天 & 账单结束时间 <= 今天: | |||||
| * 那是之前的账单,不处理。 | |||||
| * @param merchant | |||||
| */ | |||||
| public boolean billEndCalcute(Date endTime,WxBillBaseEntity bill,WxBillAction action) { | |||||
| String endTimeStr = DateUtils.date2String(endTime,DateUtils.DATE_TIME_PATTERN); | |||||
| boolean isPaid = false; | |||||
| if (StringUtils.isNotBlank(bill.getPay()) && new BigDecimal(bill.getPay()).compareTo(new BigDecimal(0)) > 0 ) { | |||||
| isPaid = true; | |||||
| } | |||||
| boolean isUpdate = false; | |||||
| if (!bill.getStarttime().before(endTime)) { | |||||
| if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.NOT_PAID.getCode().intValue() || | |||||
| bill.getStatus().intValue() == EnumBillStatus.NOT_EXPIRED.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.BAD.getCode().intValue()) { | |||||
| EnumBillStatus realBillStatus = EnumBillStatus.INVALID; | |||||
| if (isPaid) { | |||||
| realBillStatus = EnumBillStatus.STOP_TO_SETTLE; | |||||
| } | |||||
| bill.setStatus(realBillStatus.getCode()); | |||||
| action.setAction(EnumBillAction.STATUS_CHANGE.getCode()); | |||||
| action.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null, null)+"商户停用,停用日期["+endTimeStr+"]"); | |||||
| action.setRemark("系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+realBillStatus.getMessage()+"]"); | |||||
| isUpdate = true; | |||||
| //如果是已支付,则需退回全部费用 | |||||
| }else if (bill.getStatus().intValue() == EnumBillStatus.PAID.getCode().intValue()) { | |||||
| bill.setReceivePay("0"); | |||||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(bill.getReceivePay(), "0", null)); | |||||
| action.setRemark("商户停用,停用日期["+endTimeStr+"],原账单已结清,系统自动更新应收金额为0,待退回费用"); | |||||
| isUpdate = true; | |||||
| }else { | |||||
| //do nothing | |||||
| } | |||||
| }else if (bill.getStarttime().before(endTime) && bill.getEndtime().after(endTime)){ | |||||
| int realDays = DateUtils.daysBetween(bill.getStarttime(),endTime); | |||||
| int billDays = DateUtils.daysBetween(bill.getStarttime(),bill.getEndtime()); | |||||
| String newReceivePay = new BigDecimal(bill.getReceivePay()).multiply(new BigDecimal(realDays)).divide(new BigDecimal(billDays)).setScale(2,RoundingMode.HALF_UP).toPlainString(); | |||||
| String oldReceivePay = bill.getReceivePay(); | |||||
| if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.NOT_PAID.getCode().intValue() || | |||||
| bill.getStatus().intValue() == EnumBillStatus.NOT_EXPIRED.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.BAD.getCode().intValue()) { | |||||
| bill.setReceivePay(newReceivePay); | |||||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, newReceivePay, null)); | |||||
| action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动更新"); | |||||
| isUpdate = true; | |||||
| }else if (bill.getStatus().intValue() == EnumBillStatus.PAID.getCode().intValue()) { | |||||
| bill.setReceivePay(newReceivePay); | |||||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||||
| action.setAction(EnumBillAction.UPDATE_BILL.getCode()); | |||||
| action.setDetails(EnumBillAction.UPDATE_BILL.getDescription(oldReceivePay, newReceivePay, null)); | |||||
| action.setRemark("商户停用,停用日期["+endTimeStr+"],系统自动更新"); | |||||
| isUpdate = true; | |||||
| }else { | |||||
| //do nothing | |||||
| } | |||||
| }else { | |||||
| if (bill.getStatus().intValue() == EnumBillStatus.WAIT_PAY.getCode().intValue() || bill.getStatus().intValue() == EnumBillStatus.NOT_PAID.getCode().intValue() || | |||||
| bill.getStatus().intValue() == EnumBillStatus.NOT_EXPIRED.getCode().intValue()) { | |||||
| bill.setStatus(EnumBillStatus.STOP_TO_SETTLE.getCode()); | |||||
| action.setAction(EnumBillAction.STATUS_CHANGE.getCode()); | |||||
| action.setDetails(EnumBillAction.STATUS_CHANGE.getDescription(null, null, null)+"商户停用,停用日期["+endTimeStr+"]"); | |||||
| action.setRemark("系统自动由["+EnumBillStatus.getEnum(bill.getStatus()).getMessage()+"]变更为["+EnumBillStatus.STOP_TO_SETTLE.getMessage()+"]"); | |||||
| isUpdate = true; | |||||
| }else { | |||||
| //do nothing | |||||
| } | |||||
| } | |||||
| return isUpdate; | |||||
| } | |||||
| //租赁合同终止, 租赁押金需全部退回,租金账单,营业管理费,商业管理费账单需重新计算。 | |||||
| public void rentContractStop(WxRentContract rentContract) { | |||||
| } | |||||
| //物业合同终止,物业押金需全额退回,物业账单需重新计算 | |||||
| public void propertyContractStop(WxPropertyContract propertyContract) { | |||||
| } | |||||
| //终止商户除了租赁账单以外的 | |||||
| public void stopMerchantOtherBills(WxMerchant wxMerchant) { | |||||
| } | |||||
| } | } | ||||
| @@ -550,7 +550,7 @@ public class WxBillDepositServiceImpl extends WxBillBaseService implements WxBil | |||||
| wxBillRent.setUpdatetime(new Date()); | wxBillRent.setUpdatetime(new Date()); | ||||
| wxBillRent.setReturnPrice(oldpay.add(new BigDecimal(dto.getAddpay())).toPlainString()); | wxBillRent.setReturnPrice(oldpay.add(new BigDecimal(dto.getAddpay())).toPlainString()); | ||||
| wxBillDepositMapper.updateById(wxBillRent); | wxBillDepositMapper.updateById(wxBillRent); | ||||
| this.addBillAction(EnumBillAction.DEPOSIT_RETURN, dto.getBillTypeValue(),dto.getId(), | |||||
| this.addBillAction(EnumBillAction.RETURN, dto.getBillTypeValue(),dto.getId(), | |||||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getPayWay(),dto.getRemark(), user); | dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getPayWay(),dto.getRemark(), user); | ||||
| } | } | ||||
| @@ -553,7 +553,7 @@ public class WxBillOtherDepositServiceImpl extends WxBillBaseService implements | |||||
| wxBillRent.setUpdatetime(new Date()); | wxBillRent.setUpdatetime(new Date()); | ||||
| wxBillRent.setReturnPrice(oldpay.add(new BigDecimal(dto.getAddpay())).toPlainString()); | wxBillRent.setReturnPrice(oldpay.add(new BigDecimal(dto.getAddpay())).toPlainString()); | ||||
| wxBillOtherDepositMapper.updateById(wxBillRent); | wxBillOtherDepositMapper.updateById(wxBillRent); | ||||
| this.addBillAction(EnumBillAction.DEPOSIT_RETURN, dto.getBillTypeValue(),dto.getId(), | |||||
| this.addBillAction(EnumBillAction.RETURN, dto.getBillTypeValue(),dto.getId(), | |||||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getPayWay(),dto.getRemark(), user); | dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getPayWay(),dto.getRemark(), user); | ||||
| } | } | ||||
| @@ -529,7 +529,7 @@ public class WxBillPropertyDepositServiceImpl extends WxBillBaseService implemen | |||||
| wxBillRent.setUpdatetime(new Date()); | wxBillRent.setUpdatetime(new Date()); | ||||
| wxBillRent.setReturnPrice(oldpay.add(new BigDecimal(dto.getAddpay())).toPlainString()); | wxBillRent.setReturnPrice(oldpay.add(new BigDecimal(dto.getAddpay())).toPlainString()); | ||||
| wxBillPropertyDepositMapper.updateById(wxBillRent); | wxBillPropertyDepositMapper.updateById(wxBillRent); | ||||
| this.addBillAction(EnumBillAction.DEPOSIT_RETURN, dto.getBillTypeValue(),dto.getId(), | |||||
| this.addBillAction(EnumBillAction.RETURN, dto.getBillTypeValue(),dto.getId(), | |||||
| dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getPayWay(),dto.getRemark(), user); | dto.getAddpay(), dto.getAddpay(),wxBillRent.getPayDate(),dto.getPayWay(),dto.getRemark(), user); | ||||
| } | } | ||||
| @@ -731,4 +731,19 @@ public class WxBillRentServiceImpl extends WxBillBaseService implements WxBillRe | |||||
| this.addBillAction(EnumBillAction.BAD, dto.getBillTypeValue(),dto.getId(), | this.addBillAction(EnumBillAction.BAD, dto.getBillTypeValue(),dto.getId(), | ||||
| badMoney, badMoney,null,null,dto.getRemark(), user); | badMoney, badMoney,null,null,dto.getRemark(), user); | ||||
| } | } | ||||
| @Override | |||||
| public void rentContractBillStop(WxRentContract rentContract) { | |||||
| WxBillRent rq = new WxBillRent(); | |||||
| rq.updateTenantInfo(rentContract); | |||||
| rq.setRentContractId(rentContract.getId()); | |||||
| List<WxBillRent> rentList = wxBillRentMapper.findList(rq); | |||||
| if (null != rentList) { | |||||
| for (int i = 0 ; i < rentList.size() ; i ++) { | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -17,6 +17,7 @@ import com.iformall.enums.*; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.helper.WxBillAllHelper; | |||||
| import com.iformall.service.helper.WxRentContractHelper; | import com.iformall.service.helper.WxRentContractHelper; | ||||
| import com.iformall.utils.DateUtils; | import com.iformall.utils.DateUtils; | ||||
| import org.apache.commons.collections.map.HashedMap; | import org.apache.commons.collections.map.HashedMap; | ||||
| @@ -90,6 +91,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| @Lazy | @Lazy | ||||
| @Autowired | @Autowired | ||||
| WxMerchantService wxMerchantService; | WxMerchantService wxMerchantService; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxBillAllHelper wxBillAllHelper; | |||||
| @Override | @Override | ||||
| public PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | ||||
| @@ -1112,9 +1117,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode()); | wxPropertyContract.setStatus(EnumRentContractStatus.TERMINATE.getCode()); | ||||
| wxPropertyContractMapper.updateStatus(wxPropertyContract); | wxPropertyContractMapper.updateStatus(wxPropertyContract); | ||||
| WxBillProperty wxBillProperty = new WxBillProperty(); | |||||
| wxBillProperty.setPropertyContractId(wxPropertyContract.getId()); | |||||
| wxBillPropertyMapper.updateInvalidStatus(wxBillProperty); | |||||
| // WxBillProperty wxBillProperty = new WxBillProperty(); | |||||
| // wxBillProperty.setPropertyContractId(wxPropertyContract.getId()); | |||||
| // wxBillPropertyMapper.updateInvalidStatus(wxBillProperty); | |||||
| wxBillAllHelper.propertyContractStop(wxPropertyContract); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -19,6 +19,7 @@ import com.iformall.enums.*; | |||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.*; | import com.iformall.service.*; | ||||
| import com.iformall.service.helper.WxBillAllHelper; | |||||
| import com.iformall.service.helper.WxRentContractHelper; | import com.iformall.service.helper.WxRentContractHelper; | ||||
| import com.iformall.utils.*; | import com.iformall.utils.*; | ||||
| import org.apache.commons.collections.map.HashedMap; | import org.apache.commons.collections.map.HashedMap; | ||||
| @@ -129,6 +130,10 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| @Autowired | @Autowired | ||||
| WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper; | WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper; | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxBillAllHelper wxBillAllHelper; | |||||
| // @Override | // @Override | ||||
| // public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { | // public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { | ||||
| // //Object rentContractStatusInfo = getRentContractStatusInfo(record); | // //Object rentContractStatusInfo = getRentContractStatusInfo(record); | ||||
| @@ -1816,10 +1821,11 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| wxBillPropertyMapper.updateInvalidStatusByRent(wxRentContract); | wxBillPropertyMapper.updateInvalidStatusByRent(wxRentContract); | ||||
| } | } | ||||
| //租赁账单失效 | //租赁账单失效 | ||||
| WxBillRent wxBillRent = new WxBillRent(); | |||||
| wxBillRent.setRentContractId(wxRentContract.getId()); | |||||
| wxBillRent.updateTenantInfo(wxRentContract); | |||||
| wxBillRentMapper.updateInvalidStatus(wxBillRent); | |||||
| wxBillAllHelper.rentContractStop(wxRentContract); | |||||
| // WxBillRent wxBillRent = new WxBillRent(); | |||||
| // wxBillRent.setRentContractId(wxRentContract.getId()); | |||||
| // wxBillRent.updateTenantInfo(wxRentContract); | |||||
| // wxBillRentMapper.updateInvalidStatus(wxBillRent); | |||||
| return new ResultData(Result.SUCCESS,"终止成功"); | return new ResultData(Result.SUCCESS,"终止成功"); | ||||
| //解绑商户和商铺关系 | //解绑商户和商铺关系 | ||||
| // WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | // WxRentContract rentContract = wxRentContractMapper.selectById(wxRentContract.getId()); | ||||
| @@ -68,6 +68,14 @@ | |||||
| <if test=" null != payWay ">and `pay_way` = #{payWay}</if> | <if test=" null != payWay ">and `pay_way` = #{payWay}</if> | ||||
| <if test=" null != buildWay ">and `build_way` = #{buildWay}</if> | <if test=" null != buildWay ">and `build_way` = #{buildWay}</if> | ||||
| <if test=" 1 == notifyed ">and (`last_owe_call_time` is not null and `receive_pay` - `pay` > 0 and status not in (3,6,7) )</if> | <if test=" 1 == notifyed ">and (`last_owe_call_time` is not null and `receive_pay` - `pay` > 0 and status not in (3,6,7) )</if> | ||||
| <if test=" null != statusList "> | |||||
| and status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -135,7 +143,12 @@ | |||||
| #{nidItem} | #{nidItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and br.status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| </sql> | </sql> | ||||
| @@ -95,6 +95,12 @@ | |||||
| #{rdItem} | #{rdItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -166,6 +172,12 @@ | |||||
| #{midItem} | #{midItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and br.status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| </sql> | </sql> | ||||
| @@ -83,6 +83,13 @@ | |||||
| #{nidItem} | #{nidItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| </sql> | </sql> | ||||
| @@ -138,7 +145,14 @@ | |||||
| <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | ||||
| #{nidItem} | #{nidItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != statusList "> | |||||
| and br.status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </if> | </if> | ||||
| </where> | </where> | ||||
| @@ -81,6 +81,13 @@ | |||||
| #{nidItem} | #{nidItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | <if test=" null != sortColumns"> order by ${sortColumns} </if> | ||||
| </sql> | </sql> | ||||
| @@ -132,8 +139,14 @@ | |||||
| <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | <foreach collection="notInIds" index="index" item="nidItem" open="(" separator="," close=")"> | ||||
| #{nidItem} | #{nidItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != statusList "> | |||||
| and br.status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| </sql> | </sql> | ||||
| @@ -75,6 +75,12 @@ | |||||
| #{pidItem} | #{pidItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -133,6 +139,12 @@ | |||||
| #{midItem} | #{midItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and br.status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| </sql> | </sql> | ||||
| @@ -99,6 +99,13 @@ | |||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -164,6 +171,13 @@ | |||||
| #{midItem} | #{midItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and br.status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| </sql> | </sql> | ||||
| @@ -82,6 +82,12 @@ | |||||
| #{midItem} | #{midItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -142,6 +148,12 @@ | |||||
| #{midItem} | #{midItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and br.status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| </sql> | </sql> | ||||
| @@ -103,6 +103,12 @@ | |||||
| and endtime < #{endtimeEnd} | and endtime < #{endtimeEnd} | ||||
| </if> | </if> | ||||
| <if test=" 1 == notifyed ">and (`last_owe_call_time` is not null and `receive_pay` - `pay` > 0 and status not in (3,6,7) )</if> | <if test=" 1 == notifyed ">and (`last_owe_call_time` is not null and `receive_pay` - `pay` > 0 and status not in (3,6,7) )</if> | ||||
| <if test=" null != statusList "> | |||||
| and status in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != ids "> | <if test=" null != ids "> | ||||
| and id in | and id in | ||||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | ||||
| @@ -165,6 +171,12 @@ | |||||
| #{midItem} | #{midItem} | ||||
| </foreach> | </foreach> | ||||
| </if> | </if> | ||||
| <if test=" null != statusList "> | |||||
| and br.`status` in | |||||
| <foreach collection="statusList" index="index" item="stItem" open="(" separator="," close=")"> | |||||
| #{stItem} | |||||
| </foreach> | |||||
| </if> | |||||
| </where> | </where> | ||||
| </sql> | </sql> | ||||