| @@ -91,6 +91,29 @@ public class WxBillDeposit implements Serializable { | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="starttime") | |||
| private Date starttime; | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| public void setStarttime(Date starttime) { | |||
| this.starttime = starttime; | |||
| } | |||
| public Date getEndtime() { | |||
| return endtime; | |||
| } | |||
| public void setEndtime(Date endtime) { | |||
| this.endtime = endtime; | |||
| } | |||
| public Long getRentContractId() { | |||
| return rentContractId; | |||
| } | |||
| @@ -8,6 +8,9 @@ import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Table(name = "wx_bill_rent") | |||
| public class WxBillRent implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @@ -90,6 +93,29 @@ public class WxBillRent implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="starttime") | |||
| private Date starttime; | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| public void setStarttime(Date starttime) { | |||
| this.starttime = starttime; | |||
| } | |||
| public Date getEndtime() { | |||
| return endtime; | |||
| } | |||
| public void setEndtime(Date endtime) { | |||
| this.endtime = endtime; | |||
| } | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| @@ -131,9 +131,9 @@ public class WxBillDailyServiceImpl implements WxBillDailyService { | |||
| return new ResultData(ErrorCode.BILL_ROUTINE_IS_NOT_FOUND); | |||
| } | |||
| wxBillDaily.setPayDate(record.getPayDate()); | |||
| wxBillDaily.setPay(record.getPay() * 100); | |||
| wxBillDaily.setReceivePay(record.getReceivePay() * 100); | |||
| wxBillDaily.setOwe(record.getOwe() * 100); | |||
| wxBillDaily.setPay(record.getPay()); | |||
| wxBillDaily.setReceivePay(record.getReceivePay()); | |||
| wxBillDaily.setOwe(record.getOwe()); | |||
| wxBillDaily.setStatus(record.getPay().equals(record.getReceivePay()) ? EnumBillDailyStatus.PAID.getCode() : wxBillDaily.getStatus()); | |||
| wxBillDaily.setUpdatetime(new Date()); | |||
| try { | |||
| @@ -114,9 +114,9 @@ public class WxBillDepositServiceImpl implements WxBillDepositService { | |||
| return new ResultData(ErrorCode.BILL_RENT_DEPOSIT_IS_NOT_FOUND); | |||
| } | |||
| wxBillDeposit.setPayDate(record.getPayDate()); | |||
| wxBillDeposit.setPay(record.getPay()*100); | |||
| wxBillDeposit.setReceivePay(record.getReceivePay()*100); | |||
| wxBillDeposit.setOwe(record.getOwe()*100); | |||
| wxBillDeposit.setPay(record.getPay()); | |||
| wxBillDeposit.setReceivePay(record.getReceivePay()); | |||
| wxBillDeposit.setOwe(record.getOwe()); | |||
| wxBillDeposit.setStatus(record.getPay().equals(record.getReceivePay())?EnumBillRentStatus.PAID.getCode():wxBillDeposit.getStatus()); | |||
| wxBillDeposit.setUpdatetime(new Date()); | |||
| try { | |||
| @@ -115,9 +115,9 @@ public class WxBillPropertyDepositServiceImpl implements WxBillPropertyDepositSe | |||
| return new ResultData(ErrorCode.BILL_PROPERTY_DEPOSIT_IS_NOT_FOUND); | |||
| } | |||
| wxBillDeposit.setPayDate(record.getPayDate()); | |||
| wxBillDeposit.setPay(record.getPay()*100); | |||
| wxBillDeposit.setReceivePay(record.getReceivePay()*100); | |||
| wxBillDeposit.setOwe(record.getOwe()*100); | |||
| wxBillDeposit.setPay(record.getPay()); | |||
| wxBillDeposit.setReceivePay(record.getReceivePay()); | |||
| wxBillDeposit.setOwe(record.getOwe()); | |||
| wxBillDeposit.setStatus(record.getPay().equals(record.getReceivePay())?EnumBillRentStatus.PAID.getCode():wxBillDeposit.getStatus()); | |||
| wxBillDeposit.setUpdatetime(new Date()); | |||
| try { | |||
| @@ -112,9 +112,9 @@ public class WxBillPropertyServiceImpl implements WxBillPropertyService { | |||
| return new ResultData(ErrorCode.BILL_PROPERTY_IS_NOT_FOUND); | |||
| } | |||
| property.setPayDate(record.getPayDate()); | |||
| property.setPay(record.getPay()*100); | |||
| property.setReceivePay(record.getReceivePay()*100); | |||
| property.setOwe(record.getOwe()*100); | |||
| property.setPay(record.getPay()); | |||
| property.setReceivePay(record.getReceivePay()); | |||
| property.setOwe(record.getOwe()); | |||
| property.setStatus(record.getPay().equals(record.getReceivePay())?EnumBillRentStatus.PAID.getCode():property.getStatus()); | |||
| property.setUpdatetime(new Date()); | |||
| try { | |||
| @@ -113,9 +113,9 @@ public class WxBillRentServiceImpl implements WxBillRentService { | |||
| return new ResultData(ErrorCode.BILL_RENT_IS_NOT_FOUND); | |||
| } | |||
| wxBillRent.setPayDate(record.getPayDate()); | |||
| wxBillRent.setPay(record.getPay()*100); | |||
| wxBillRent.setReceivePay(record.getReceivePay()*100); | |||
| wxBillRent.setOwe(record.getOwe()*100); | |||
| wxBillRent.setPay(record.getPay()); | |||
| wxBillRent.setReceivePay(record.getReceivePay()); | |||
| wxBillRent.setOwe(record.getOwe()); | |||
| wxBillRent.setStatus(record.getPay().equals(record.getReceivePay())?EnumBillRentStatus.PAID.getCode():wxBillRent.getStatus()); | |||
| wxBillRent.setUpdatetime(new Date()); | |||
| try { | |||
| @@ -312,13 +312,12 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| receiver.setReceiverType(wxMerchant.getAccountTypeValue()); | |||
| receiver.setTrueName(wxMerchant.getAccountName()); | |||
| return wxProfitSharingReceiverService.updateReceiver(wxMerchant, receiver); | |||
| } else { | |||
| return wxProfitSharingReceiverService.delReceiver(wxMerchant); | |||
| } | |||
| } catch (Exception e) { | |||
| logger.error("db failed: 账户操作失败, e:" + e.getMessage()); | |||
| throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); | |||
| } | |||
| return new ResultData(Result.SUCCESS,"操作成功"); | |||
| } | |||
| @@ -592,6 +591,18 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| wxBillDeposit.setReceiveDate(time); | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillDeposit.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillDeposit.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillDeposit.getReceiveDate()); | |||
| instance.add(Calendar.MONTH, wxRentContract.getLease()); | |||
| wxBillDeposit.setEndtime(instance.getTime()); | |||
| //截止收租日在当前时间之前 | |||
| if (wxBillDeposit.getReceiveDate().before(date)) { | |||
| long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000); | |||
| @@ -660,6 +671,31 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| wxBillRent.setReceiveDate(time); | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillRent.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.MONTH, receivePeriod); | |||
| wxBillRent.setEndtime(instance.getTime()); | |||
| if(extracount>0){ | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillRent.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.MONTH, extralease); | |||
| wxBillRent.setEndtime(instance.getTime()); | |||
| } | |||
| //截止收租日在当前时间之前 | |||
| if (wxBillRent.getReceiveDate().before(date)) { | |||
| long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000); | |||
| @@ -71,8 +71,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| if(wxPropertyContract==null){ | |||
| return new ResultData(ErrorCode.PROPERTY_CONTRACT_IS_NOT_FOUND); | |||
| } | |||
| wxPropertyContract.setPrice(wxPropertyContract.getPrice() != null ? wxPropertyContract.getPrice() / 100 : 0); | |||
| wxPropertyContract.setDeposit(wxPropertyContract.getDeposit() != null ? wxPropertyContract.getDeposit() / 100 : 0); | |||
| wxPropertyContract.setPrice(wxPropertyContract.getPrice() != null ? wxPropertyContract.getPrice(): 0); | |||
| wxPropertyContract.setDeposit(wxPropertyContract.getDeposit() != null ? wxPropertyContract.getDeposit() : 0); | |||
| result.put("wxPropertyContract", wxPropertyContract); | |||
| //关联的商户 | |||
| @@ -126,8 +126,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| instance.add(Calendar.MONTH, record.getLease()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setRentalEndDate(instance.getTime()); | |||
| record.setPrice(record.getPrice() != null ? record.getPrice() * 100 : 0); | |||
| record.setDeposit(record.getDeposit() != null ? record.getDeposit() * 100 : 0); | |||
| record.setPrice(record.getPrice() != null ? record.getPrice(): 0); | |||
| record.setDeposit(record.getDeposit() != null ? record.getDeposit(): 0); | |||
| record.setUpdatetime(new Date()); | |||
| if(record.getPrice()==0 || record.getDeposit()==0){ | |||
| record.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); | |||
| @@ -253,6 +253,8 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| wxBillRent.setReceiveDate(time); | |||
| //截止收租日在当前时间之前 | |||
| if (wxBillRent.getReceiveDate().before(date)) { | |||
| long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000); | |||
| @@ -74,8 +74,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| return new ResultData(ErrorCode.RENT_CONTRACT_IS_NOT_FOUND); | |||
| } | |||
| wxRentContract.setPrice(wxRentContract.getPrice() != null ? wxRentContract.getPrice() / 100 : 0); | |||
| wxRentContract.setDeposit(wxRentContract.getDeposit() != null ? wxRentContract.getDeposit() / 100 : 0); | |||
| wxRentContract.setPrice(wxRentContract.getPrice() != null ? wxRentContract.getPrice(): 0); | |||
| wxRentContract.setDeposit(wxRentContract.getDeposit() != null ? wxRentContract.getDeposit(): 0); | |||
| result.put("wxRentContract", wxRentContract); | |||
| //关联的商户 | |||
| @@ -129,8 +129,8 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| instance.add(Calendar.MONTH, record.getLease()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setRentalEndDate(instance.getTime()); | |||
| record.setPrice(record.getPrice() != null ? record.getPrice() * 100 : 0); | |||
| record.setDeposit(record.getDeposit() != null ? record.getDeposit() * 100 : 0); | |||
| record.setPrice(record.getPrice() != null ? record.getPrice(): 0); | |||
| record.setDeposit(record.getDeposit() != null ? record.getDeposit(): 0); | |||
| record.setUpdatetime(new Date()); | |||
| if(record.getPrice()==0 || record.getDeposit()==0){ | |||
| record.setStatus(EnumRentContractStatus.WAIT_SIGN.getCode()); | |||
| @@ -188,6 +188,18 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| wxBillDeposit.setReceiveDate(time); | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillDeposit.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillDeposit.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillDeposit.getReceiveDate()); | |||
| instance.add(Calendar.MONTH, wxRentContract.getLease()); | |||
| wxBillDeposit.setEndtime(instance.getTime()); | |||
| //截止收租日在当前时间之前 | |||
| if (wxBillDeposit.getReceiveDate().before(date)) { | |||
| long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000); | |||
| @@ -256,6 +268,33 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| Date time = instance.getTime(); | |||
| wxBillRent.setReceiveDate(time); | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillRent.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| instance.add(Calendar.MONTH, receivePeriod); | |||
| wxBillRent.setEndtime(instance.getTime()); | |||
| if(extracount>0){ | |||
| //账单开始时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| wxBillRent.setStarttime(instance.getTime()); | |||
| //账单结束时间 | |||
| instance.clear(); | |||
| instance.setTime(wxBillRent.getReceiveDate()); | |||
| instance.add(Calendar.DAY_OF_MONTH, 1); | |||
| instance.add(Calendar.MONTH, extralease); | |||
| wxBillRent.setEndtime(instance.getTime()); | |||
| } | |||
| //截止收租日在当前时间之前 | |||
| if (wxBillRent.getReceiveDate().before(date)) { | |||
| long day = (time.getTime() - date.getTime()) / (24 * 60 * 60 * 1000); | |||