| @@ -73,6 +73,6 @@ public interface WxRentContractService { | |||||
| List<WxBillRent> buildRent(WxMerchant wxMerchant, Long userId,WxRentContract rentContract,Integer isPreview); | List<WxBillRent> buildRent(WxMerchant wxMerchant, Long userId,WxRentContract rentContract,Integer isPreview); | ||||
| void buildDeposit(WxMerchant wxMerchant, Long userId); | |||||
| void buildDeposit(WxMerchant wxMerchant, Long userId,Long rentContractId); | |||||
| } | } | ||||
| @@ -326,7 +326,7 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| //创建账单 | //创建账单 | ||||
| //wxRentContractService.buildRent(wxMerchant, userId,null,EnumIsPreview.NO.getCode()); | //wxRentContractService.buildRent(wxMerchant, userId,null,EnumIsPreview.NO.getCode()); | ||||
| //创建押金 | //创建押金 | ||||
| wxRentContractService.buildDeposit(wxMerchant, userId); | |||||
| wxRentContractService.buildDeposit(wxMerchant, userId,wxMerchant.getRentContractId()); | |||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "商户创建成功", merchantId); | return new ResultData(Result.SUCCESS, "商户创建成功", merchantId); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| @@ -340,19 +340,16 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| //物业账单 | //物业账单 | ||||
| //buildProperty(wxMerchant,null); | //buildProperty(wxMerchant,null); | ||||
| //物业押金账单 | //物业押金账单 | ||||
| buildDeposit(wxMerchant); | |||||
| buildDeposit(wxMerchant,id); | |||||
| //} | //} | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "操作成功"); | return new ResultData(Result.SUCCESS, "操作成功"); | ||||
| } | } | ||||
| @Transactional(rollbackFor = {Exception.class}) | @Transactional(rollbackFor = {Exception.class}) | ||||
| public void buildDeposit(WxMerchant wxMerchant) { | |||||
| WxPropertyContract wxPropertyContract = new WxPropertyContract(); | |||||
| wxPropertyContract.setMerchantId(wxMerchant.getId()); | |||||
| List<WxPropertyContract> list = wxPropertyContractMapper.findList(wxPropertyContract); | |||||
| if (list.size() > 0) { | |||||
| wxPropertyContract = list.get(0); | |||||
| public void buildDeposit(WxMerchant wxMerchant,Long propertyContractId) { | |||||
| WxPropertyContract wxPropertyContract = wxPropertyContractMapper.selectByPrimaryKey(propertyContractId); | |||||
| if (wxPropertyContract != null) { | |||||
| //找到计租方式 | //找到计租方式 | ||||
| int dayType = wxPropertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; | int dayType = wxPropertyContract.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| @@ -379,12 +379,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| @Transactional(rollbackFor = {Exception.class}) | @Transactional(rollbackFor = {Exception.class}) | ||||
| @Override | @Override | ||||
| public void buildDeposit(WxMerchant wxMerchant, Long userId) { | |||||
| WxRentContract wxRentContract = new WxRentContract(); | |||||
| wxRentContract.setMerchantId(wxMerchant.getId()); | |||||
| List<WxRentContract> list = wxRentContractMapper.findList(wxRentContract); | |||||
| if (list.size() > 0) { | |||||
| wxRentContract = list.get(0); | |||||
| public void buildDeposit(WxMerchant wxMerchant, Long userId,Long rentContractId) { | |||||
| WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(rentContractId); | |||||
| if (wxRentContract != null) { | |||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| WxBillDeposit wxBillDeposit = new WxBillDeposit(); | WxBillDeposit wxBillDeposit = new WxBillDeposit(); | ||||
| wxBillDeposit.setId(idWorker.nextId()); | wxBillDeposit.setId(idWorker.nextId()); | ||||
| @@ -986,7 +983,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| //租金 | //租金 | ||||
| // buildRent(wxMerchant, null,null); | // buildRent(wxMerchant, null,null); | ||||
| //押金 | //押金 | ||||
| buildDeposit(wxMerchant, null); | |||||
| buildDeposit(wxMerchant, null,id); | |||||
| // } | // } | ||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "操作成功"); | return new ResultData(Result.SUCCESS, "操作成功"); | ||||