|
|
|
@@ -1013,25 +1013,29 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
|
|
|
|
List<WxMerchant> list = wxMerchantMapper.findList(wxMerchant); |
|
|
|
|
|
|
|
WxBusiness bq = new WxBusiness(); |
|
|
|
bq.setFinalTenantId(wxMerchant.getFinalTenantId()); |
|
|
|
List<WxBusiness> bussinessList = wxBusinessMapper.findListAll(bq); |
|
|
|
Map<Integer,String> bussinessMap = new HashMap<Integer,String>(); |
|
|
|
if (null != bussinessList) { |
|
|
|
for (int i = 0 ; i < bussinessList.size() ; i ++) { |
|
|
|
WxBusiness bu = bussinessList.get(i); |
|
|
|
bussinessMap.put(bu.getId() ,bu.getTitle()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
list.stream().forEach(m->{ |
|
|
|
|
|
|
|
List<WxProfitSharingReceiver> receivers = wxProfitSharingReceiverService.findReceivers(m, m.getId()); |
|
|
|
m.setWxProfitSharingReceiver(receivers); |
|
|
|
|
|
|
|
//分账信息 可能有多个, 先干掉 |
|
|
|
// WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(m,EnumProfitSharingType.PROFIT_SHARING_TYPE_WECHAT); |
|
|
|
// if (receiver != null) { |
|
|
|
// m.setAccountId(receiver.getReceiverAccount()); |
|
|
|
// m.setAccountName(receiver.getTrueName()); |
|
|
|
// m.setAccountTypeValue(receiver.getReceiverType()); |
|
|
|
// WxRentContract wxRentContract = new WxRentContract(); |
|
|
|
// wxRentContract.setMerchantId(m.getId()); |
|
|
|
// List<WxRentContract> lrc = wxRentContractMapper.selectRentContractByMerchantId(wxRentContract); |
|
|
|
// if (!lrc.isEmpty()) { |
|
|
|
// m.setRentalStartDate(lrc.get(0).getRentalStartDate()); |
|
|
|
// m.setRentalEndDate(lrc.get(0).getRentalEndDate()); |
|
|
|
// } |
|
|
|
WxRentContract wxRentContract = new WxRentContract(); |
|
|
|
wxRentContract.setMerchantId(m.getId()); |
|
|
|
List<WxRentContract> lrc = wxRentContractMapper.selectRentContractByMerchantId(wxRentContract); |
|
|
|
if (!lrc.isEmpty()) { |
|
|
|
m.setRentalStartDate(lrc.get(0).getRentalStartDate()); |
|
|
|
m.setRentalEndDate(lrc.get(0).getRentalEndDate()); |
|
|
|
} |
|
|
|
|
|
|
|
//商铺信息 |
|
|
|
m.setShopVos(wxShopService.findMerchantShopVoList(m,m.getId())); |
|
|
|
@@ -1041,6 +1045,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
wxMerchantBUser.setMerchantId(m.getId()); |
|
|
|
wxMerchantBUser.setStatus(EnumMerchantBUserStatus.VALID.getCode()); |
|
|
|
m.setUsers(wxMerchantBUserMapper.findList(wxMerchantBUser)); |
|
|
|
|
|
|
|
//业态 |
|
|
|
m.setBusinessName(bussinessMap.get(m.getBusinessId())); |
|
|
|
}); |
|
|
|
excelService.exportExcel(list, null, "商户信息", WxMerchant.class, "商户信息数据.xlsx", response, false); |
|
|
|
} |
|
|
|
@@ -1204,18 +1211,18 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
record.setIds(merchantIds); |
|
|
|
} |
|
|
|
|
|
|
|
List<Long> noMerchantIds = new ArrayList<Long>(); |
|
|
|
Integer rentShopType = record.getRentShopType(); |
|
|
|
if (null != rentShopType) { |
|
|
|
WxRentContract rentContractQ = new WxRentContract(); |
|
|
|
rentContractQ.updateTenantInfo(record); |
|
|
|
rentContractQ.setStatuss(EnumRentContractStatus.getValidStatus()); |
|
|
|
List<Long> usedMerchantIds = wxRentContractMapper.getMerchantIdsByStatuss(rentContractQ); |
|
|
|
if (null != usedMerchantIds && usedMerchantIds.size() >0 ) { |
|
|
|
noMerchantIds.addAll(usedMerchantIds); |
|
|
|
// record.setNotInids(usedMerchantIds); |
|
|
|
} |
|
|
|
} |
|
|
|
// List<Long> noMerchantIds = new ArrayList<Long>(); |
|
|
|
// Integer rentShopType = record.getRentShopType(); |
|
|
|
// if (null != rentShopType) { |
|
|
|
// WxRentContract rentContractQ = new WxRentContract(); |
|
|
|
// rentContractQ.updateTenantInfo(record); |
|
|
|
// rentContractQ.setStatuss(EnumRentContractStatus.getValidStatus()); |
|
|
|
// List<Long> usedMerchantIds = wxRentContractMapper.getMerchantIdsByStatuss(rentContractQ); |
|
|
|
// if (null != usedMerchantIds && usedMerchantIds.size() >0 ) { |
|
|
|
// noMerchantIds.addAll(usedMerchantIds); |
|
|
|
//// record.setNotInids(usedMerchantIds); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// if(EnumProfitSharingUse.NO.getCode().equals(record.getIsUse())){ |
|
|
|
// if(noMerchantIds.size() > 0){ |
|
|
|
// noMerchantIds.retainAll(isUseMerchantIds); |
|
|
|
@@ -1224,9 +1231,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
if(noMerchantIds.size() > 0){ |
|
|
|
record.setNotInids(noMerchantIds); |
|
|
|
} |
|
|
|
// if(noMerchantIds.size() > 0){ |
|
|
|
// record.setNotInids(noMerchantIds); |
|
|
|
// } |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@@ -1284,34 +1291,34 @@ public class WxMerchantServiceImpl implements WxMerchantService { |
|
|
|
merchant.setRentalEndDate(contract.getRentalEndDate()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (record.getRentShopType() != null) { |
|
|
|
List<Map<String, Object>> shops = new ArrayList<>(); |
|
|
|
WxMerchantShop wxMerchantShop = new WxMerchantShop(); |
|
|
|
wxMerchantShop.setMerchantId(merchant.getId()); |
|
|
|
wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); |
|
|
|
List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); |
|
|
|
for (WxMerchantShop merchantShop : wxMerchantShopList) { |
|
|
|
WxShop shop = new WxShop(); |
|
|
|
shop.setId(merchantShop.getShopId()); |
|
|
|
shop.updateTenantInfo(merchant); |
|
|
|
PageInfo<Map<String, Object>> shopPageInfo = wxShopService.findListMap(shop,1,10000); |
|
|
|
List<Map<String, Object>> shoplist = shopPageInfo.getList(); |
|
|
|
if (shoplist.size() > 0) { |
|
|
|
shops.add(shoplist.get(0)); |
|
|
|
} |
|
|
|
} |
|
|
|
merchant.setShoplist(shops); |
|
|
|
} |
|
|
|
|
|
|
|
WxRentContract rc = new WxRentContract(); |
|
|
|
rc.setMerchantId(merchant.getId()); |
|
|
|
rc.setTenantId(merchant.getTenantId()); |
|
|
|
List<WxRentContract> rentContractList = wxRentContractMapper.findList(rc); |
|
|
|
if(CollectionUtils.isEmpty(rentContractList)){ |
|
|
|
merchant.setHasContract(EnumHasContract.NO.getCode()); |
|
|
|
}else{ |
|
|
|
merchant.setHasContract(EnumHasContract.HAS.getCode()); |
|
|
|
} |
|
|
|
// if (record.getRentShopType() != null) { |
|
|
|
// List<Map<String, Object>> shops = new ArrayList<>(); |
|
|
|
// WxMerchantShop wxMerchantShop = new WxMerchantShop(); |
|
|
|
// wxMerchantShop.setMerchantId(merchant.getId()); |
|
|
|
// wxMerchantShop.setIsDel(EnumDelStatus.NOT_DEL.getCode()); |
|
|
|
// List<WxMerchantShop> wxMerchantShopList = wxMerchantShopMapper.findList(wxMerchantShop); |
|
|
|
// for (WxMerchantShop merchantShop : wxMerchantShopList) { |
|
|
|
// WxShop shop = new WxShop(); |
|
|
|
// shop.setId(merchantShop.getShopId()); |
|
|
|
// shop.updateTenantInfo(merchant); |
|
|
|
// PageInfo<Map<String, Object>> shopPageInfo = wxShopService.findListMap(shop,1,10000); |
|
|
|
// List<Map<String, Object>> shoplist = shopPageInfo.getList(); |
|
|
|
// if (shoplist.size() > 0) { |
|
|
|
// shops.add(shoplist.get(0)); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// merchant.setShoplist(shops); |
|
|
|
// } |
|
|
|
// |
|
|
|
// WxRentContract rc = new WxRentContract(); |
|
|
|
// rc.setMerchantId(merchant.getId()); |
|
|
|
// rc.setTenantId(merchant.getTenantId()); |
|
|
|
// List<WxRentContract> rentContractList = wxRentContractMapper.findList(rc); |
|
|
|
// if(CollectionUtils.isEmpty(rentContractList)){ |
|
|
|
// merchant.setHasContract(EnumHasContract.NO.getCode()); |
|
|
|
// }else{ |
|
|
|
// merchant.setHasContract(EnumHasContract.HAS.getCode()); |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
return pageInfo; |
|
|
|
|