| @@ -51,6 +51,9 @@ public class WxMerchant implements Serializable { | |||||
| @Transient | @Transient | ||||
| private List<WxMerchantBUser> bUsers; | private List<WxMerchantBUser> bUsers; | ||||
| @Transient | |||||
| private Long rentContractId; | |||||
| /*租期开始时间**/ | /*租期开始时间**/ | ||||
| @Transient | @Transient | ||||
| private Date rentalStartDate; | private Date rentalStartDate; | ||||
| @@ -276,6 +279,14 @@ public class WxMerchant implements Serializable { | |||||
| this.accountTypeValue = accountTypeValue; | this.accountTypeValue = accountTypeValue; | ||||
| } | } | ||||
| public Long getRentContractId() { | |||||
| return rentContractId; | |||||
| } | |||||
| public void setRentContractId(Long rentContractId) { | |||||
| this.rentContractId = rentContractId; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| @@ -38,7 +38,15 @@ public class WxShop implements Serializable { | |||||
| public void setIds(List<String> ids) { | public void setIds(List<String> ids) { | ||||
| this.ids = ids; | this.ids = ids; | ||||
| } | } | ||||
| @Transient | |||||
| private Long rentContractId; | |||||
| @Transient | |||||
| private String linkPerson; | |||||
| @Transient | |||||
| private String linkPhone; | |||||
| /*租户ID**/ | /*租户ID**/ | ||||
| @@ -189,6 +197,30 @@ public class WxShop implements Serializable { | |||||
| this.imgUrl = imgUrl; | this.imgUrl = imgUrl; | ||||
| } | } | ||||
| public Long getRentContractId() { | |||||
| return rentContractId; | |||||
| } | |||||
| public void setRentContractId(Long rentContractId) { | |||||
| this.rentContractId = rentContractId; | |||||
| } | |||||
| public String getLinkPerson() { | |||||
| return linkPerson; | |||||
| } | |||||
| public void setLinkPerson(String linkPerson) { | |||||
| this.linkPerson = linkPerson; | |||||
| } | |||||
| public String getLinkPhone() { | |||||
| return linkPhone; | |||||
| } | |||||
| public void setLinkPhone(String linkPhone) { | |||||
| this.linkPhone = linkPhone; | |||||
| } | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| @@ -199,8 +199,6 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxMerchant.setCreateDate(date); | wxMerchant.setCreateDate(date); | ||||
| wxMerchantMapper.insertSelective(wxMerchant); | wxMerchantMapper.insertSelective(wxMerchant); | ||||
| buildRent(wxMerchant); | |||||
| //保存商户商铺的关联 | //保存商户商铺的关联 | ||||
| List<Long> shopidlist = wxMerchant.getShopids(); | List<Long> shopidlist = wxMerchant.getShopids(); | ||||
| for (Long shopid : shopidlist) { | for (Long shopid : shopidlist) { | ||||
| @@ -251,6 +249,16 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||||
| wxProfitSharingReceiverService.addReceiver(wxMerchant, receiver); | wxProfitSharingReceiverService.addReceiver(wxMerchant, receiver); | ||||
| } | } | ||||
| //关联合同 | |||||
| if(wxMerchant.getRentContractId()!=null){ | |||||
| WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(wxMerchant.getRentContractId()); | |||||
| wxRentContract.setMerchantId(merchantid); | |||||
| wxRentContract.setUpdatetime(new Date()); | |||||
| wxRentContractMapper.updateByPrimaryKeySelective(wxRentContract); | |||||
| //创建账单 | |||||
| buildRent(wxMerchant); | |||||
| } | |||||
| } else { | } else { | ||||
| //更新商户 | //更新商户 | ||||
| @@ -127,12 +127,14 @@ | |||||
| select s.id,s.shop_number shopNumber,s.build_area buildArea, | select s.id,s.shop_number shopNumber,s.build_area buildArea, | ||||
| s.img_url imgUrl,s.operation_area operationArea, | s.img_url imgUrl,s.operation_area operationArea, | ||||
| s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId | |||||
| s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId, | |||||
| rc.id rentContractId,rc.link_person linkPerson,rc.link_phone linkPhone | |||||
| from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0 | from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id and ms.is_del=0 | ||||
| left join wx_merchant m on ms.merchant_id=m.id | left join wx_merchant m on ms.merchant_id=m.id | ||||
| left join wx_mall_building b | left join wx_mall_building b | ||||
| on s.building=b.id | on s.building=b.id | ||||
| left join wx_mall_floor f on s.floor=f.id | left join wx_mall_floor f on s.floor=f.id | ||||
| left join wx_rent_contract rc on s.id=rc.shop_id | |||||
| where 1 = 1 | where 1 = 1 | ||||
| <if test=" null != id "> | <if test=" null != id "> | ||||