| @@ -137,7 +137,7 @@ public class WxMapController extends BaseController { | |||
| @SystemControllerLog(description = "店铺管理-id查询") | |||
| public ResultData findShopById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxMapController::findShopById"); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxShopService.detailById(id)); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxShopService.detailById(this.getTenantInfo(),id)); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @@ -386,10 +386,10 @@ public class WxRentContractController extends WxContractBaseController { | |||
| //去重 | |||
| shopList.removeAll(currentContractShopIds); | |||
| } | |||
| List<WxShop> shops = wxShopService.getByIds(shopList); | |||
| List<WxShop> shops = wxShopService.getByIds(rentq,shopList); | |||
| //再加上合同里面店铺 | |||
| if(null != currentContractShopIds && currentContractShopIds.size() > 0 ) { | |||
| List<WxShop> contractShops = wxShopService.getByIds(currentContractShopIds); | |||
| List<WxShop> contractShops = wxShopService.getByIds(rentq,currentContractShopIds); | |||
| contractShops.stream().filter( cs -> !shopList.contains(cs.getId())); | |||
| shops.addAll(contractShops); | |||
| } | |||
| @@ -892,7 +892,7 @@ public class WxRentContractController extends WxContractBaseController { | |||
| for (WxRentContract wrc: clist) { | |||
| List<Long> shopIds = wrc.shopIdsByRentInfo(); | |||
| if (null != shopIds) { | |||
| List<WxShop> shops = wxShopService.getByIds(shopIds); | |||
| List<WxShop> shops = wxShopService.getByIds(this.getFinalTenantInfo(),shopIds); | |||
| String shopName = ""; | |||
| for (WxShop shop : shops) { | |||
| shopName = shopName +","+shop.getShopNumber(); | |||
| @@ -46,7 +46,7 @@ public class InvestCustomerController extends InvestBaseController{ | |||
| @SystemControllerLog(description = "客户信息列表") | |||
| @GetMapping("/list/simple") | |||
| public InvestResultData<List<InvestDemandVo>> listSimple() { | |||
| return execute(null, p -> investBizService.queryCustomer()); | |||
| return execute(null, p -> investBizService.queryCustomer(this.getTenantInfo())); | |||
| } | |||
| /** | |||
| @@ -56,7 +56,7 @@ public class InvestCustomerController extends InvestBaseController{ | |||
| @ApiOperation(value = "分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestDemandVo>> list(InvestDemandQuery params) { | |||
| return execute(params, p -> investBizService.queryPageDemand(p)); | |||
| return execute(params, p -> investBizService.queryPageDemand(this.getTenantInfo(),p)); | |||
| } | |||
| /** | |||
| @@ -41,7 +41,7 @@ public class InvestTaskController extends InvestBaseController { | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("/list") | |||
| public InvestResultData<InvestPageResult<InvestTaskVo>> list(InvestTaskQuery params) { | |||
| return execute(params, p -> bizService.queryPageTask(p)); | |||
| return execute(params, p -> bizService.queryPageTask(this.getTenantInfo(),p)); | |||
| } | |||
| /** | |||
| @@ -12,6 +12,7 @@ import lombok.ToString; | |||
| import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @TableName(value = "wx_shop") | |||
| @Data | |||
| @@ -20,7 +21,9 @@ import java.util.Date; | |||
| public class WxShop extends TenantEntity { | |||
| protected Long id; | |||
| @TableField(exist = false) | |||
| private List<Long> notInIdList; | |||
| @TableField(exist = false) | |||
| private Long rentContractId; | |||
| @@ -19,5 +19,5 @@ public interface WxMerchantShopMapper extends CommonMapper<WxMerchantShop, Strin | |||
| void realDelByMerchantId(@Param("merchantId") Long merchantId,@Param("shopList") List<Long> shopIds); | |||
| List<Map<String,Object>> rentRateHistory(Map<String, Object> params); | |||
| } | |||
| @@ -59,4 +59,6 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long> | |||
| List<Map<String, Object>> currentValidByMerchantId(WxRentContract rentContract); | |||
| List<Long> getUsedRentShopIds(WxRentContract wxRentContract); | |||
| } | |||
| @@ -33,12 +33,10 @@ public interface WxShopMapper extends CommonMapper<WxShop, String> { | |||
| int hasShopNumber(WxShop wxShop); | |||
| int hasShopSid(WxShop wxShop); | |||
| List<WxShopVo> findListWithMerchantMap(WxShop record); | |||
| List<WxShop> findListWithMerchantMap(WxShop record); | |||
| Long getCountByWxShop(WxShop wxShop); | |||
| List<Map<String,Object>> rentRateHistory(Map<String, Object> params); | |||
| void updateUnRentByIds(@Param("ids")List<Long> shopIds); | |||
| Map<String,Object> detailById(@Param("id") Long id); | |||
| @@ -42,7 +42,6 @@ public interface WxBrandService { | |||
| */ | |||
| void deleteById(Long id); | |||
| ResultData save(WxBrand wxBrand); | |||
| ResultData update(WxBrand wxBrand); | |||
| @@ -55,5 +54,7 @@ public interface WxBrandService { | |||
| * @return | |||
| */ | |||
| ResultData hasBrand(WxBrand wxBrand); | |||
| Map<Long,WxBrand> getAllMap(TenantEntity tenantEntity); | |||
| } | |||
| @@ -21,6 +21,8 @@ public interface WxBusinessService { | |||
| * @return | |||
| */ | |||
| PageInfo<WxBusiness> listAsPage(WxBusiness record, Integer pageIndex, Integer pageSize); | |||
| Map<Integer,WxBusiness> findAllMap(); | |||
| /** | |||
| * 根据实体查询列表 | |||
| @@ -30,7 +30,9 @@ public interface WxShopService { | |||
| PageInfo<Map<String,Object>> listMapAsPage(WxShop record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<Map<String,Object>> notRentListMapAsPage(WxShop record, Integer pageIndex, Integer pageSize); | |||
| PageInfo<Map<String,Object>> notRentListMapAsPage(WxShop record,Integer pageIndex,Integer pageSize); | |||
| List<WxShopVo> findListWithMerchantMap(WxShop record); | |||
| /** | |||
| * 根据Id获得实体 | |||
| @@ -40,7 +42,11 @@ public interface WxShopService { | |||
| */ | |||
| WxShop getById(Long id); | |||
| List<WxShop> getByIds(Collection<? extends Serializable> ids); | |||
| List<WxShop> getByIds(TenantEntity tenantEntity,Collection<? extends Serializable> ids); | |||
| PageInfo<Map<String,Object>> findListMap(WxShop record,Integer pageIndex,Integer pageSize); | |||
| List<Map<String,Object>> rentRateHistory(TenantEntity tenantEntity,Map<String, Object> params); | |||
| /** | |||
| * 保存或更新实体 | |||
| @@ -83,7 +89,7 @@ public interface WxShopService { | |||
| void exportNotRentShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response); | |||
| @Deprecated | |||
| Map<String,Object> detailById(Long id); | |||
| Map<String,Object> detailById(TenantEntity tenantEntity,Long id); | |||
| Map<String,Object> detailBySid(TenantEntity tenantInfo, String sid); | |||
| @@ -8,6 +8,7 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.WxBrand; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.enums.EnumDelFlag; | |||
| import com.iformall.exception.MallinkException; | |||
| @@ -111,5 +112,22 @@ public class WxBrandServiceImpl implements WxBrandService { | |||
| return new ResultData(ResultData.SUCCESS, "查询成功", count > 0 ? true : false); | |||
| } | |||
| @Override | |||
| public Map<Long, WxBrand> getAllMap(TenantEntity tenantEntity) { | |||
| WxBrand brandQ = new WxBrand(); | |||
| brandQ.updateTenantInfo(tenantEntity); | |||
| List<WxBrand> brandList = wxBrandMapper.findList(brandQ); | |||
| Map<Long,WxBrand> map = new HashMap<Long,WxBrand>(); | |||
| if (null != brandList) { | |||
| for (int i = 0 ; i < brandList.size() ; i++) { | |||
| WxBrand b = brandList.get(i); | |||
| if (null != b) { | |||
| map.put(b.getId(), b); | |||
| } | |||
| } | |||
| } | |||
| return map; | |||
| } | |||
| } | |||
| @@ -25,6 +25,7 @@ import java.math.BigDecimal; | |||
| import java.math.RoundingMode; | |||
| import java.util.ArrayList; | |||
| import java.util.Collection; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @@ -206,4 +207,19 @@ public class WxBusinessServiceImpl implements WxBusinessService { | |||
| return new ResultData(pageInfo); | |||
| } | |||
| @Override | |||
| public Map<Integer, WxBusiness> findAllMap() { | |||
| List<WxBusiness> list = wxBusinessMapper.findListAll(); | |||
| Map<Integer,WxBusiness> map = new HashMap<Integer,WxBusiness>(); | |||
| if (null != list) { | |||
| for (int i = 0 ; i < list.size() ; i++) { | |||
| WxBusiness b = list.get(i); | |||
| if (null != b) { | |||
| map.put(b.getId(), b); | |||
| } | |||
| } | |||
| } | |||
| return map; | |||
| } | |||
| } | |||
| @@ -128,6 +128,10 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| @Lazy | |||
| @Autowired | |||
| private WxCUserCarService wxCUserCarService; | |||
| @Lazy | |||
| @Autowired | |||
| private WxShopService wxShopService; | |||
| @@ -719,7 +723,7 @@ public class WxChartServiceImpl implements WxChartDataService { | |||
| Long total = wxShopMapper.getCountByWxShop(query); | |||
| // List<WxShop> allList = wxShopMapper.findList(query); | |||
| List<Map<String,Object>> mapList = wxShopMapper.rentRateHistory(queryMap); | |||
| List<Map<String,Object>> mapList = wxShopService.rentRateHistory(tenantEntity,queryMap); | |||
| if(CollectionUtils.isNotEmpty(mapList)){ | |||
| String startTime = (String)mapList.get(0).get("xTime"); | |||
| String endTime = (String)mapList.get(mapList.size()-1).get("xTime"); | |||
| @@ -297,7 +297,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| for (WxMerchantShop merchantShop : wxMerchantShopList) { | |||
| WxShop record = new WxShop(); | |||
| record.setId(merchantShop.getShopId()); | |||
| List<Map<String, Object>> shoplist = wxShopMapper.findListMap(record); | |||
| record.updateTenantInfo(wxMerchant); | |||
| PageInfo<Map<String, Object>> pageInfo = wxShopService.findListMap(record,1,10000); | |||
| List<Map<String, Object>> shoplist = pageInfo.getList(); | |||
| if (shoplist.size() > 0) { | |||
| shops.add(shoplist.get(0)); | |||
| } | |||
| @@ -1082,7 +1084,9 @@ public class WxMerchantServiceImpl implements WxMerchantService { | |||
| for (WxMerchantShop merchantShop : wxMerchantShopList) { | |||
| WxShop shop = new WxShop(); | |||
| shop.setId(merchantShop.getShopId()); | |||
| List<Map<String, Object>> shoplist = wxShopMapper.findListMap(shop); | |||
| 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)); | |||
| } | |||
| @@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import org.springframework.util.CollectionUtils; | |||
| @@ -64,17 +65,25 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| @Autowired | |||
| WxRentContractMapper wxRentContractMapper; | |||
| @Lazy | |||
| @Autowired | |||
| WxFlowService wxFlowService; | |||
| @Lazy | |||
| @Autowired | |||
| WxFlowRecordService wxFlowRecordService; | |||
| @Lazy | |||
| @Autowired | |||
| WxRentContractService wxRentContractService; | |||
| @Lazy | |||
| @Autowired | |||
| WxPayAccountBillService wxPayAccountBillService; | |||
| @Lazy | |||
| @Autowired | |||
| WxShopService wxShopService; | |||
| @Override | |||
| public PageInfo<WxPropertyContract> listAsPage(WxPropertyContract record, Integer pageIndex, Integer pageSize) { | |||
| @@ -189,7 +198,9 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| WxShop record = new WxShop(); | |||
| if (null != wrc.shopIdsByRentInfo() && wrc.shopIdsByRentInfo().size()>0) { | |||
| record.setIds(wrc.shopIdsByRentInfo()); | |||
| List<Map<String, Object>> list = wxShopMapper.findListMap(record); | |||
| record.updateTenantInfo(wxPropertyContract); | |||
| PageInfo<Map<String, Object>> shopPageInfo = wxShopService.findListMap(record,1,10000); | |||
| List<Map<String, Object>> list = shopPageInfo.getList(); | |||
| result.put("wxShops", list); | |||
| }else { | |||
| result.put("wxShops", Collections.EMPTY_LIST); | |||
| @@ -34,6 +34,7 @@ import org.joda.time.format.DateTimeFormatter; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import org.springframework.transaction.annotation.Transactional; | |||
| import org.springframework.util.CollectionUtils; | |||
| @@ -63,6 +64,7 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| @Autowired | |||
| WxShopMapper wxShopMapper; | |||
| @Lazy | |||
| @Autowired | |||
| WxMerchantService wxMerchantService; | |||
| @@ -87,15 +89,19 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| @Autowired | |||
| WxBrandMapper WxBrandMapper; | |||
| @Lazy | |||
| @Autowired | |||
| WxFlowRecordService wxFlowRecordService; | |||
| @Lazy | |||
| @Autowired | |||
| RuntimeService runtimeService; | |||
| @Lazy | |||
| @Autowired | |||
| private TaskService taskService; | |||
| @Lazy | |||
| @Autowired | |||
| private WxFlowService wxFlowService; | |||
| @@ -108,12 +114,18 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| @Autowired | |||
| WxBillPropertyMapper wxBillPropertyMapper; | |||
| @Lazy | |||
| @Autowired | |||
| WxPropertyContractService wxPropertyContractService; | |||
| @Lazy | |||
| @Autowired | |||
| WxPayAccountBillService wxPayAccountBillService; | |||
| @Lazy | |||
| @Autowired | |||
| WxShopService wxShopService; | |||
| // @Override | |||
| // public Map<String, Object> listAsPage(WxRentContract record, Integer pageIndex, Integer pageSize) { | |||
| // //Object rentContractStatusInfo = getRentContractStatusInfo(record); | |||
| @@ -220,7 +232,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| WxShop record = new WxShop(); | |||
| //record.setId(wxRentContract.getShopId()); | |||
| record.setIds(wxRentContract.shopIdsByRentInfo()); | |||
| List<Map<String, Object>> list = wxShopMapper.findListMap(record); | |||
| record.updateTenantInfo(wxRentContract); | |||
| PageInfo<Map<String, Object>> shopPageInfo = wxShopService.findListMap(record,1,10000); | |||
| List<Map<String, Object>> list = shopPageInfo.getList(); | |||
| result.put("wxShops", list); | |||
| } else { | |||
| result.put("wxShops", Collections.EMPTY_LIST); | |||
| @@ -1927,7 +1941,9 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||
| }else { | |||
| WxShop record = new WxShop(); | |||
| record.setIds(wxRentContract.shopIdsByRentInfo()); | |||
| List<Map<String, Object>> wxShops = wxShopMapper.findListMap(record); | |||
| record.updateTenantInfo(wxRentContract); | |||
| PageInfo<Map<String, Object>> shopPageInfo = wxShopService.findListMap(record,1,10000); | |||
| List<Map<String, Object>> wxShops = shopPageInfo.getList(); | |||
| if (!wxShops.isEmpty()) { | |||
| //店铺信息 | |||
| Map<String, Object> wxShop = wxShops.get(0); | |||
| @@ -1,5 +1,26 @@ | |||
| package com.iformall.service.impl; | |||
| import java.io.Serializable; | |||
| import java.lang.reflect.InvocationTargetException; | |||
| import java.util.ArrayList; | |||
| import java.util.Collection; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import org.apache.commons.beanutils.BeanUtils; | |||
| import org.apache.commons.collections.CollectionUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| @@ -7,32 +28,30 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBrand; | |||
| import com.iformall.domain.po.WxBusiness; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxMerchantShop; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxNotRentShopVo; | |||
| import com.iformall.domain.vo.WxShopVo; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.enums.EnumDelStatus; | |||
| import com.iformall.enums.EnumRentContractStatus; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.enums.EnumShopStatus; | |||
| import com.iformall.enums.EnumUserAdmin; | |||
| import com.iformall.mapper.WxMerchantMapper; | |||
| import com.iformall.mapper.WxMerchantShopMapper; | |||
| import com.iformall.mapper.WxRentContractMapper; | |||
| import com.iformall.mapper.WxShopMapper; | |||
| import com.iformall.service.ExcelService; | |||
| import com.iformall.service.WxBrandService; | |||
| import com.iformall.service.WxBusinessService; | |||
| import com.iformall.service.WxMallBuildingService; | |||
| import com.iformall.service.WxMallFloorService; | |||
| import com.iformall.service.WxShopService; | |||
| import org.apache.commons.collections.CollectionUtils; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.context.annotation.Lazy; | |||
| import org.springframework.stereotype.Service; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.io.Serializable; | |||
| import java.util.*; | |||
| @Service | |||
| public class WxShopServiceImpl implements WxShopService { | |||
| @@ -57,6 +76,17 @@ public class WxShopServiceImpl implements WxShopService { | |||
| @Lazy | |||
| @Autowired | |||
| WxMallBuildingService wxMallBuildingService; | |||
| @Autowired | |||
| WxMerchantMapper wxMerchantMapper; | |||
| @Lazy | |||
| @Autowired | |||
| WxBusinessService wxBusinessService; | |||
| @Lazy | |||
| @Autowired | |||
| WxBrandService wxBrandService; | |||
| @Override | |||
| public List<WxShop> selectList(QueryWrapper<WxShop> queryWrapper) { | |||
| @@ -70,18 +100,7 @@ public class WxShopServiceImpl implements WxShopService { | |||
| @Override | |||
| public PageInfo<Map<String,Object>> listMapAsPage(WxShop record, Integer pageIndex, Integer pageSize) { | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<Map<String,Object>> shops = wxShopMapper.findListMap(record); | |||
| PageInfo<Map<String,Object>> pageInfo = new PageInfo<>(shops); | |||
| return pageInfo; | |||
| } | |||
| @Override | |||
| public PageInfo<Map<String, Object>> notRentListMapAsPage(WxShop record, Integer pageIndex, Integer pageSize) { | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| List<Map<String,Object>> shops = wxShopMapper.notRentListMapAsPage(record); | |||
| PageInfo<Map<String,Object>> pageInfo = new PageInfo<>(shops); | |||
| return pageInfo; | |||
| return findListMap(record, pageIndex, pageSize); | |||
| } | |||
| @Override | |||
| @@ -89,11 +108,216 @@ public class WxShopServiceImpl implements WxShopService { | |||
| return wxShopMapper.selectById(id); | |||
| } | |||
| public List<WxShop> getByIds(Collection<? extends Serializable> ids) { | |||
| private Map<Long, String> getFloorMap(TenantEntity tenantEntity) { | |||
| return wxMallFloorService.getFloorMap(tenantEntity); | |||
| } | |||
| private Map<Long, String> getBuildingMap(TenantEntity tenantEntity) { | |||
| return wxMallBuildingService.getBuildingMap(tenantEntity); | |||
| } | |||
| private Map<Integer, WxBusiness> getBussinessMap() { | |||
| return wxBusinessService.findAllMap(); | |||
| } | |||
| private Map<Long, WxBrand> getBrandMap(TenantEntity tenantEntity) { | |||
| return wxBrandService.getAllMap(tenantEntity); | |||
| } | |||
| @Override | |||
| public List<WxShop> getByIds(TenantEntity tenantEntity,Collection<? extends Serializable> ids) { | |||
| if(CollectionUtils.isEmpty(ids)) { | |||
| return new ArrayList<>() ; | |||
| } | |||
| return wxShopMapper.selectBatchByIds((List<Long>) ids) ; | |||
| Map<Long, String> floorMap = getFloorMap(tenantEntity); | |||
| Map<Long, String> buildingMap = getBuildingMap(tenantEntity); | |||
| List<WxShop> shopList = wxShopMapper.selectBatchByIds((List<Long>) ids) ; | |||
| if (null != shopList) { | |||
| for (int i = 0 ; i < shopList.size(); i ++) { | |||
| WxShop shop = shopList.get(i); | |||
| if (null != shop) { | |||
| if (null != shop.getBuilding()) { | |||
| shop.setBuildingName(buildingMap.get(shop.getBuilding())); | |||
| } | |||
| if (null != shop.getFloor()) { | |||
| shop.setFloorName(floorMap.get(shop.getFloor())); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| return shopList; | |||
| } | |||
| @Override | |||
| public PageInfo<Map<String,Object>> notRentListMapAsPage(WxShop record,Integer pageIndex,Integer pageSize) { | |||
| Map<Long, String> floorMap = getFloorMap(record); | |||
| Map<Long, String> buildingMap = getBuildingMap(record); | |||
| PageInfo<Map<String,Object>> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxShopMapper.notRentListMapAsPage(record)); | |||
| List<Map<String,Object>> shopList = pageInfo.getList(); | |||
| if (null != shopList) { | |||
| for (int i = 0 ; i < shopList.size(); i ++) { | |||
| Map<String,Object> shop = shopList.get(i); | |||
| if (null != shop) { | |||
| Long building = (Long)shop.get("buildingId"); | |||
| if (null != building) { | |||
| shop.put("building", buildingMap.get(building)); | |||
| } | |||
| Long floor = (Long)shop.get("floorId"); | |||
| if (null != floor) { | |||
| shop.put("floor", floorMap.get(floor)); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| return pageInfo; | |||
| } | |||
| private Map<Long,WxMerchant> getMerchantMap(TenantEntity tenantEntity,List<Long> merchantIds,Map<Long,WxMerchant> merchantMap) { | |||
| if (null == merchantMap) { | |||
| merchantMap = new HashMap<Long,WxMerchant>(); | |||
| } | |||
| if (null != merchantIds && merchantIds.size() > 0 ) { | |||
| WxMerchant merchantQ = new WxMerchant(); | |||
| merchantQ.updateTenantInfo(tenantEntity); | |||
| merchantQ.setIds(merchantIds); | |||
| List<WxMerchant> merchantList = wxMerchantMapper.findList(merchantQ); | |||
| if (null != merchantList && merchantList.size() > 0 ) { | |||
| for (int i = 0 ; i < merchantList.size() ; i ++) { | |||
| WxMerchant m = merchantList.get(i); | |||
| if (null != m) { | |||
| merchantMap.put(m.getId(), m); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| return merchantMap; | |||
| } | |||
| private void initShopMerchantMap(WxShop record,Map<Long,Long> shopMerchantIdMap,Map<Long,WxMerchant> merchantMap) { | |||
| WxMerchantShop merchantShopQ = new WxMerchantShop(); | |||
| merchantShopQ.updateTenantInfo(record); | |||
| merchantShopQ.setShopId(record.getId()); | |||
| merchantShopQ.setShopIdList(record.getIds()); | |||
| merchantShopQ.setIsDel(0); | |||
| List<WxMerchantShop> merchantShopList = wxMerchantShopMapper.findList(merchantShopQ); | |||
| if (null != merchantShopList && merchantShopList.size() > 0) { | |||
| List<Long> merchantIds = new ArrayList<Long>(); | |||
| for (int i = 0 ;i < merchantShopList.size() ; i ++) { | |||
| WxMerchantShop ms = merchantShopList.get(i); | |||
| if (null != ms ) { | |||
| if (!merchantIds.contains(ms.getId())) { | |||
| merchantIds.add(ms.getId()); | |||
| } | |||
| if (null != ms.getShopId() && null != ms.getMerchantId()) { | |||
| shopMerchantIdMap.put(ms.getShopId(), ms.getMerchantId()); | |||
| } | |||
| } | |||
| } | |||
| merchantMap = getMerchantMap(record,merchantIds,merchantMap); | |||
| } | |||
| } | |||
| @Override | |||
| public PageInfo<Map<String,Object>> findListMap(WxShop record,Integer pageIndex,Integer pageSize) { | |||
| Map<Long, String> floorMap = getFloorMap(record); | |||
| Map<Long, String> buildingMap = getBuildingMap(record); | |||
| Map<Long,Long> shopMerchantIdMap = new HashMap<Long,Long>(); | |||
| Map<Long,WxMerchant> merchantMap = new HashMap<Long,WxMerchant>(); | |||
| initShopMerchantMap(record, shopMerchantIdMap, merchantMap); | |||
| PageInfo<Map<String,Object>> pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxShopMapper.findListMap(record)); | |||
| List<Map<String,Object>> shopList = pageInfo.getList() ; | |||
| if (null != shopList) { | |||
| for (int i = 0 ; i < shopList.size(); i ++) { | |||
| Map<String,Object> shop = shopList.get(i); | |||
| if (null != shop) { | |||
| Long build = (Long)shop.get("buildingId"); | |||
| if (null != build) { | |||
| shop.put("building", buildingMap.get(build)); | |||
| } | |||
| Long floor = (Long)shop.get("floorId"); | |||
| if (null != floor) { | |||
| shop.put("floor", floorMap.get(floor)); | |||
| } | |||
| Long shopId = (Long)shop.get("id"); | |||
| if (null != shopId) { | |||
| Long merchantId = shopMerchantIdMap.get(shopId); | |||
| if (null != merchantId && null != merchantMap) { | |||
| WxMerchant m = merchantMap.get(merchantId); | |||
| if (null != m) { | |||
| shop.put("merchantName", m.getName()); | |||
| shop.put("merchantId", m.getId()); | |||
| shop.put("linkPerson", m.getLinkPerson()); | |||
| shop.put("linkPhone", m.getLinkPhone()); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| return pageInfo; | |||
| } | |||
| @Override | |||
| public List<WxShopVo> findListWithMerchantMap(WxShop record){ | |||
| List<WxShop> shopList = wxShopMapper.findListWithMerchantMap(record); | |||
| if (null == shopList) { | |||
| return null; | |||
| } | |||
| Map<Long, String> floorMap = this.getFloorMap(record); | |||
| Map<Long, String> buildingMap = this.getBuildingMap(record); | |||
| Map<Long, WxBrand> brandMap = this.getBrandMap(record); | |||
| Map<Integer, WxBusiness> businessMap = this.getBussinessMap(); | |||
| Map<Long,Long> shopMerchantIdMap = new HashMap<Long,Long>(); | |||
| Map<Long,WxMerchant> merchantMap = new HashMap<Long,WxMerchant>(); | |||
| initShopMerchantMap(record, shopMerchantIdMap, merchantMap); | |||
| List<WxShopVo> volist = new ArrayList<WxShopVo>(); | |||
| for (int i = 0 ; i < shopList.size() ; i ++) { | |||
| WxShop shop = shopList.get(i); | |||
| if (null != shop) { | |||
| WxShopVo vo = new WxShopVo(); | |||
| try { | |||
| BeanUtils.copyProperties(vo, shop); | |||
| vo.setBuildingName(buildingMap.get(vo.getBuilding())); | |||
| vo.setFloorName(floorMap.get(vo.getFloor())); | |||
| Long merchangId = shopMerchantIdMap.get(vo.getId()); | |||
| if (null != merchangId) { | |||
| WxMerchant merchant = merchantMap.get(merchangId); | |||
| if (null != merchant) { | |||
| vo.setMerchantId(merchant.getId()); | |||
| vo.setMerchantName(merchant.getName()); | |||
| vo.setLinkPhone(merchant.getLinkPhone()); | |||
| vo.setLinkPerson(merchant.getLinkPerson()); | |||
| if (null != merchant.getBrand()) { | |||
| WxBrand brand = brandMap.get(merchant.getBrand()); | |||
| if (null != brand) { | |||
| vo.setBrandName(brand.getName()); | |||
| } | |||
| } | |||
| if (null != merchant.getBusinessId()) { | |||
| WxBusiness business = businessMap.get(merchant.getBusinessId()); | |||
| if (null != business) { | |||
| vo.setBusiness(business.getTitle()); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| volist.add(vo); | |||
| } catch (IllegalAccessException e) { | |||
| logger.error("WxShopVo error",e); | |||
| } catch (InvocationTargetException e) { | |||
| logger.error("WxShopVo error",e); | |||
| } | |||
| } | |||
| } | |||
| if (volist.size() <= 0 ) { | |||
| return null; | |||
| } | |||
| return volist; | |||
| } | |||
| @Override | |||
| @@ -202,6 +426,37 @@ public class WxShopServiceImpl implements WxShopService { | |||
| } | |||
| params.put("shopId",shopId); | |||
| Map<String,Object> map=wxShopMapper.getMerchantShopByShopId(params); | |||
| Map<Long,Long> shopMerchantIdMap = new HashMap<Long,Long>(); | |||
| Map<Long,WxMerchant> merchantMap = new HashMap<Long,WxMerchant>(); | |||
| WxShop record = new WxShop(); | |||
| record.updateTenantInfo(tenantEntity); | |||
| Long sid = null; | |||
| if (!StringUtils.isBlank(shopId)) { | |||
| sid = Long.parseLong(shopId); | |||
| } | |||
| if (null != sid) { | |||
| record.setId(sid); | |||
| initShopMerchantMap(record, shopMerchantIdMap, merchantMap); | |||
| if (null != map) { | |||
| WxMerchant merchant = merchantMap.get(sid); | |||
| if (null != merchant) { | |||
| map.put("merchantName", merchant.getName()); | |||
| map.put("linkPerson", merchant.getLinkPerson()); | |||
| map.put("linkPhone", merchant.getLinkPhone()); | |||
| WxRentContract rentContractQ = new WxRentContract(); | |||
| rentContractQ.updateTenantInfo(tenantEntity); | |||
| rentContractQ.setMerchantId(merchant.getId()); | |||
| List<WxRentContract> rentList = wxRentContractMapper.findList(rentContractQ); | |||
| if (null != rentList && rentList.size() > 0 ) { | |||
| WxRentContract rc = rentList.get(0); | |||
| map.put("price", rc.getPrice()); | |||
| map.put("receivePeriod", rc.getReceivePeriod()); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| return new ResultData(ResultData.SUCCESS,"",map); | |||
| } | |||
| @@ -220,14 +475,85 @@ public class WxShopServiceImpl implements WxShopService { | |||
| @Override | |||
| public PageInfo<Map<String, Object>> listShopFromContract(WxShop wxShop, Integer pageIndex, Integer pageSize) { | |||
| PageHelper.startPage(pageIndex, pageSize); | |||
| WxRentContract wxRentContractQ = new WxRentContract(); | |||
| wxRentContractQ.updateTenantInfo(wxShop); | |||
| List<Long> usedShopIds = wxRentContractMapper.getUsedRentShopIds(wxRentContractQ); | |||
| if (null != usedShopIds && usedShopIds.size() > 0 ) { | |||
| wxShop.setNotInIdList(usedShopIds); | |||
| } | |||
| List<Map<String,Object>> shops = wxShopMapper.listShopFromContract(wxShop); | |||
| if (null != shops) { | |||
| Map<Long, String> floorMap = this.getFloorMap(wxShop); | |||
| Map<Long, String> buildingMap = this.getBuildingMap(wxShop); | |||
| Map<Long,Long> shopMerchantIdMap = new HashMap<Long,Long>(); | |||
| Map<Long,WxMerchant> merchantMap = new HashMap<Long,WxMerchant>(); | |||
| initShopMerchantMap(wxShop, shopMerchantIdMap, merchantMap); | |||
| for (int i = 0 ; i <shops.size() ; i ++) { | |||
| Map<String,Object> shop = shops.get(i); | |||
| if (null != shop) { | |||
| Long buildId = (Long)shop.get("buildingId"); | |||
| if (null != buildId) { | |||
| shop.put("building", buildingMap.get(buildId)); | |||
| } | |||
| Long floorId = (Long)shop.get("floorId"); | |||
| if (null != floorId) { | |||
| shop.put("floor", floorMap.get(floorId)); | |||
| } | |||
| Long id = (Long)shop.get("id"); | |||
| Long merchantId = shopMerchantIdMap.get(id); | |||
| if (null != merchantId) { | |||
| WxMerchant m = merchantMap.get(merchantId); | |||
| if (null != m) { | |||
| shop.put("merchantName", m.getName()); | |||
| shop.put("merchantId", m.getId()); | |||
| shop.put("linkPerson", m.getLinkPerson()); | |||
| shop.put("linkPhone", m.getLinkPhone()); | |||
| shop.put("brand", m.getBrand()); | |||
| shop.put("businessId", m.getBusinessId()); | |||
| shop.put("shopType", m.getShopType()); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| } | |||
| PageInfo<Map<String,Object>> pageInfo = new PageInfo<>(shops); | |||
| return pageInfo; | |||
| } | |||
| @Override | |||
| public List<Map<String,Object>> rentRateHistory(TenantEntity tenantEntity,Map<String, Object> params){ | |||
| String building = StringUtils.trimToNull((String)params.get("building")); | |||
| String floor = StringUtils.trimToNull((String)params.get("floor")); | |||
| String businessId = StringUtils.trimToNull((String)params.get("businessId")); | |||
| if ((!StringUtils.isBlank(building)) || (!StringUtils.isBlank(floor)) || (!StringUtils.isBlank(businessId))) { | |||
| WxShop shopQ = new WxShop(); | |||
| shopQ.updateTenantInfo(tenantEntity); | |||
| if (null != building) { | |||
| shopQ.setBuilding(Long.parseLong(building)); | |||
| } | |||
| if (null != floor) { | |||
| shopQ.setFloor(Long.parseLong(floor)); | |||
| } | |||
| if (null != businessId) { | |||
| shopQ.setBusinessId(Integer.parseInt(businessId)); | |||
| if (shopQ.getBusinessId() == 0 ) { | |||
| shopQ.setBusinessId(null); | |||
| } | |||
| } | |||
| List<Long> shopIds = wxShopMapper.findIdList(shopQ); | |||
| if(null != shopIds && shopIds.size() > 0 ) { | |||
| params.put("shopIds", shopIds); | |||
| } | |||
| } | |||
| return wxMerchantShopMapper.rentRateHistory(params); | |||
| } | |||
| @Override | |||
| public void exportShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response) { | |||
| List<WxShopVo> list = wxShopMapper.findListWithMerchantMap(wxShop); | |||
| List<WxShopVo> list = findListWithMerchantMap(wxShop); | |||
| String name = EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"店铺列表":"多经点位列表"; | |||
| excelService.exportExcel(list, null, name, WxShopVo.class, name + ".xlsx", response, false); | |||
| } | |||
| @@ -235,29 +561,54 @@ public class WxShopServiceImpl implements WxShopService { | |||
| @Override | |||
| public void exportNotRentShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response) { | |||
| wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode()); | |||
| List<Map<String,Object>> shops = wxShopMapper.notRentListMapAsPage(wxShop); | |||
| PageInfo<Map<String,Object>> pageInfo = notRentListMapAsPage(wxShop,1,10000); | |||
| List<Map<String,Object>> shops = pageInfo.getList(); | |||
| List<WxNotRentShopVo> notRentShopVoList = new ArrayList<>(); | |||
| for (Map<String,Object> m:shops) { | |||
| WxNotRentShopVo notRentShopVo = new WxNotRentShopVo(); | |||
| notRentShopVo.setBuildArea(((Long)m.get("buildArea")).toString()); | |||
| notRentShopVo.setBuilding(((String)m.get("building"))); | |||
| notRentShopVo.setFloor((String)m.get("floor")); | |||
| notRentShopVo.setFreeDay((Long) m.get("freeDay")); | |||
| notRentShopVo.setOperationArea(((Long) m.get("operationArea")).toString()); | |||
| Integer point = (Integer) m.get("type"); | |||
| if(point != null){ | |||
| notRentShopVo.setPointType(EnumRentShopType.getEnum(point).getMessage()); | |||
| } | |||
| notRentShopVo.setShopNumber((String) m.get("shopNumber")); | |||
| notRentShopVoList.add(notRentShopVo); | |||
| if ( null != shops) { | |||
| for (Map<String,Object> m:shops) { | |||
| WxNotRentShopVo notRentShopVo = new WxNotRentShopVo(); | |||
| notRentShopVo.setBuildArea(((Long)m.get("buildArea")).toString()); | |||
| notRentShopVo.setBuilding(((String)m.get("building"))); | |||
| notRentShopVo.setFloor((String)m.get("floor")); | |||
| notRentShopVo.setFreeDay((Long) m.get("freeDay")); | |||
| notRentShopVo.setOperationArea(((Long) m.get("operationArea")).toString()); | |||
| Integer point = (Integer) m.get("type"); | |||
| if(point != null){ | |||
| notRentShopVo.setPointType(EnumRentShopType.getEnum(point).getMessage()); | |||
| } | |||
| notRentShopVo.setShopNumber((String) m.get("shopNumber")); | |||
| notRentShopVoList.add(notRentShopVo); | |||
| } | |||
| } | |||
| String name = "未出租商铺列表"; | |||
| excelService.exportExcel(notRentShopVoList, null, name, WxNotRentShopVo.class, name + ".xlsx", response, false); | |||
| } | |||
| @Override | |||
| public Map<String,Object> detailById(Long id) { | |||
| return wxShopMapper.detailById(id); | |||
| public Map<String,Object> detailById(TenantEntity tenantEntity,Long id) { | |||
| Map<String,Object> shop = wxShopMapper.detailById(id); | |||
| if (null == shop) { | |||
| return null; | |||
| } | |||
| Map<Long, String> buildMap = this.getBuildingMap(tenantEntity); | |||
| Map<Long, String> floorMap = this.getFloorMap(tenantEntity); | |||
| Map<Integer, WxBusiness> businessMap = this.getBussinessMap(); | |||
| Long build = (Long)shop.get("buildingId"); | |||
| if (null != build) { | |||
| shop.put("building", buildMap.get(build)); | |||
| } | |||
| Long floor = (Long)shop.get("floorId"); | |||
| if (null != floor) { | |||
| shop.put("floor", floorMap.get(floor)); | |||
| } | |||
| Integer businessId = (Integer)shop.get("businessId"); | |||
| if (null != businessId) { | |||
| WxBusiness business = businessMap.get(businessId); | |||
| if (null != business) { | |||
| shop.put("businessName", business.getTitle()); | |||
| } | |||
| } | |||
| return shop; | |||
| } | |||
| @Override | |||
| @@ -267,15 +618,33 @@ public class WxShopServiceImpl implements WxShopService { | |||
| wxShop.setSid(sid); | |||
| List<Map<String, Object>> shops = wxShopMapper.detailBySid(wxShop); | |||
| if(shops != null && shops.size() > 0){ | |||
| return shops.get(0); | |||
| Map<String, Object> shop = shops.get(0); | |||
| Map<Long, String> buildMap = this.getBuildingMap(tenantInfo); | |||
| Map<Long, String> floorMap = this.getFloorMap(tenantInfo); | |||
| Map<Integer, WxBusiness> businessMap = this.getBussinessMap(); | |||
| Long build = (Long)shop.get("buildingId"); | |||
| if (null != build) { | |||
| shop.put("building", buildMap.get(build)); | |||
| } | |||
| Long floor = (Long)shop.get("floorId"); | |||
| if (null != floor) { | |||
| shop.put("floor", floorMap.get(floor)); | |||
| } | |||
| Integer businessId = (Integer)shop.get("businessId"); | |||
| if (null != businessId) { | |||
| WxBusiness business = businessMap.get(businessId); | |||
| if (null != business) { | |||
| shop.put("businessName", business.getTitle()); | |||
| } | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| @Override | |||
| public Map<Long,List<WxShopVo>> findMerchantShopVoListMap(TenantEntity tenantEntity, List<Long> merchantIds) { | |||
| Map<Long,String> floorMap = wxMallFloorService.getFloorMap(tenantEntity); | |||
| Map<Long,String> buildingMap = wxMallBuildingService.getBuildingMap(tenantEntity); | |||
| Map<Long,String> floorMap = getFloorMap(tenantEntity); | |||
| Map<Long,String> buildingMap = getBuildingMap(tenantEntity); | |||
| List<Long> shopIds = wxMerchantShopMapper.findShopIds(merchantIds); | |||
| List<WxShopVo> shopVoList = wxShopMapper.newFindShopVoList(tenantEntity.getTenantId(),shopIds); | |||
| @@ -2,6 +2,7 @@ package com.iformall.service.invest; | |||
| import com.iformall.domain.dto.InvestDemandDto; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.invest.InvestMessageEntity; | |||
| import com.iformall.domain.po.invest.InvestTaskEntity; | |||
| import com.iformall.domain.vo.invest.*; | |||
| @@ -14,9 +15,9 @@ import java.util.Map; | |||
| public interface InvestBizService { | |||
| InvestPageResult<InvestDemandVo> queryPageDemand(InvestDemandQuery params); | |||
| InvestPageResult<InvestDemandVo> queryPageDemand(TenantEntity tenantEntity,InvestDemandQuery params); | |||
| void exportCustomer(InvestDemandQuery params, HttpServletResponse response); | |||
| void exportCustomer(TenantEntity tenantEntity,InvestDemandQuery params, HttpServletResponse response); | |||
| void exportCustomerTemplate(HttpServletResponse response); | |||
| @@ -24,9 +25,9 @@ public interface InvestBizService { | |||
| Map queryCustomerImportCount() ; | |||
| List<InvestDemandVo> queryCustomer(); | |||
| List<InvestDemandVo> queryCustomer(TenantEntity tenantEntity); | |||
| InvestPageResult<InvestTaskVo> queryPageTask(InvestTaskQuery params); | |||
| InvestPageResult<InvestTaskVo> queryPageTask(TenantEntity tenantEntity,InvestTaskQuery params); | |||
| InvestPageResult<InvestFollowRecordVo> queryPageFollowRecord(InvestFollowQuery params); | |||
| @@ -15,6 +15,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.dto.InvestDemandDto; | |||
| import com.iformall.domain.dto.InvestTaskDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.invest.*; | |||
| import com.iformall.domain.vo.WxShopVo; | |||
| import com.iformall.domain.vo.invest.*; | |||
| @@ -79,7 +80,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| private String fmUploadDir; | |||
| @Override | |||
| public InvestPageResult<InvestDemandVo> queryPageDemand(InvestDemandQuery params) { | |||
| public InvestPageResult<InvestDemandVo> queryPageDemand(TenantEntity tenantEntity,InvestDemandQuery params) { | |||
| InvestPageResult<InvestDemandVo> investPage = new InvestPageResult<>(); | |||
| InvestDemandDto queryParams = convert(params, this::doConvertDemand); | |||
| InvestCustomerEntity customerParams = null; | |||
| @@ -111,7 +112,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| queryWrapperCustomer.orderByDesc(InvestCustomerEntity::getCreateDate); | |||
| InvestPageResult<InvestCustomerEntity> customers = customerService.queryPage(buildPageQuery(params, null), queryWrapperCustomer); | |||
| List<InvestDemandVo> resultList = getTargeInfoList(demandList, customers.getRecords()); | |||
| List<InvestDemandVo> resultList = getTargeInfoList(tenantEntity,demandList, customers.getRecords()); | |||
| BeanUtils.copyProperties(customers, investPage); | |||
| investPage.setRecords(resultList); | |||
| if (CollectionUtils.isEmpty(customers.getRecords())) { | |||
| @@ -122,7 +123,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| } | |||
| @Override | |||
| public void exportCustomer(InvestDemandQuery params, HttpServletResponse response) { | |||
| public void exportCustomer(TenantEntity tenantEntity,InvestDemandQuery params, HttpServletResponse response) { | |||
| InvestDemandDto queryParams = convert(params, this::doConvertDemand); | |||
| InvestCustomerEntity customerParams = null; | |||
| InvestDemandEntity demandParams = null; | |||
| @@ -145,7 +146,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| queryWrapperCustomer.orderByDesc(InvestCustomerEntity::getCreateDate); | |||
| Collection<InvestCustomerEntity> customers = customerService.list(queryWrapperCustomer); | |||
| if (CollectionUtils.isNotEmpty(customers)) { | |||
| List<InvestCustomerVo> resultList = getCustomerVOList(demandList, customers); | |||
| List<InvestCustomerVo> resultList = getCustomerVOList(tenantEntity,demandList, customers); | |||
| excelService.exportExcel(resultList, null, "客户信息", InvestCustomerVo.class, "客户信息.xlsx", response, false); | |||
| } | |||
| } | |||
| @@ -488,9 +489,9 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| } | |||
| @Override | |||
| public List<InvestDemandVo> queryCustomer() { | |||
| public List<InvestDemandVo> queryCustomer(TenantEntity tenantEntity) { | |||
| List<InvestCustomerEntity> customerEntities = customerService.list(); | |||
| return getTargeInfoList(new ArrayList<>(), customerEntities); | |||
| return getTargeInfoList(tenantEntity,new ArrayList<>(), customerEntities); | |||
| } | |||
| private InvestDemandDto doConvertDemand(InvestDemandQuery params) { | |||
| @@ -515,7 +516,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| } | |||
| @Override | |||
| public InvestPageResult<InvestTaskVo> queryPageTask(InvestTaskQuery params) { | |||
| public InvestPageResult<InvestTaskVo> queryPageTask(TenantEntity tenantEntity,InvestTaskQuery params) { | |||
| InvestTaskDto queryParams = convert(params, this::doConvertTask); | |||
| InvestTaskEntity taskParams = null; | |||
| WxShop shopParams = null; | |||
| @@ -547,7 +548,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| Collection<InvestTaskEntity> taskList = taskPage.getRecords(); | |||
| //2、目标信息 | |||
| Collection<WxShop> shops = shopService.getByIds(getIds(taskList, InvestTaskEntity::getTargetId)); | |||
| Collection<WxShop> shops = shopService.getByIds(tenantEntity,getIds(taskList, InvestTaskEntity::getTargetId)); | |||
| //3、商品合同信息 | |||
| // Map<Long, WxRentContract> shopContractMap = new HashMap<>(); | |||
| // if (CollectionUtils.isNotEmpty(shops)) { | |||
| @@ -886,6 +887,7 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| if (Objects.nonNull(shop)) { | |||
| WxShop shopMapQuery = new WxShop(); | |||
| shopMapQuery.setIds(Arrays.asList(taskEntity.getTargetId())); | |||
| shopMapQuery.updateTenantInfo(shop); | |||
| Collection<Map<String, Object>> shopMap = shopService.listMapAsPage(shopMapQuery, 1, 10).getList(); | |||
| for (Map<String, Object> stringObjectMap : shopMap) { | |||
| Long shopId = Long.valueOf(String.valueOf(stringObjectMap.get("id"))); | |||
| @@ -1257,11 +1259,11 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| return ownerInfo; | |||
| } | |||
| private List<InvestCustomerVo> getCustomerVOList(List<InvestDemandEntity> demandList, Collection<InvestCustomerEntity> customers) { | |||
| private List<InvestCustomerVo> getCustomerVOList(TenantEntity tenantEntity,List<InvestDemandEntity> demandList, Collection<InvestCustomerEntity> customers) { | |||
| Map<Long, InvestDemandEntity> demindsMap = getMap(demandList, InvestDemandEntity::getCustomerId); | |||
| //3、目标信息 | |||
| Collection<WxShop> shops = shopService.getByIds(getIds(demandList, InvestDemandEntity::getTargetId)); | |||
| Collection<WxShop> shops = shopService.getByIds(tenantEntity,getIds(demandList, InvestDemandEntity::getTargetId)); | |||
| Map<Long, WxShop> shopsMap = getMap(shops, WxShop::getId); | |||
| //4、品牌 | |||
| @@ -1282,14 +1284,14 @@ public class InvestBizServiceImpl implements InvestBizService { | |||
| return resultList; | |||
| } | |||
| private List<InvestDemandVo> getTargeInfoList(List<InvestDemandEntity> demandList, Collection<InvestCustomerEntity> customers) { | |||
| private List<InvestDemandVo> getTargeInfoList(TenantEntity tenantEntity,List<InvestDemandEntity> demandList, Collection<InvestCustomerEntity> customers) { | |||
| Map<Long, InvestDemandEntity> demindsMap = new HashMap<>(); | |||
| Map<Long, WxShop> shopsMap = new HashMap<>(); | |||
| Map<Long, MallUserInfo> usersMap = new HashMap<>(); | |||
| if (CollectionUtils.isNotEmpty(demandList)) { | |||
| demindsMap = getMap(demandList, InvestDemandEntity::getCustomerId); | |||
| //3、目标信息 | |||
| Collection<WxShop> shops = shopService.getByIds(getIds(demandList, InvestDemandEntity::getTargetId)); | |||
| Collection<WxShop> shops = shopService.getByIds(tenantEntity,getIds(demandList, InvestDemandEntity::getTargetId)); | |||
| shopsMap = getMap(shops, WxShop::getId); | |||
| //5、用户 | |||
| usersMap = getMap(userInfoService.getByIds(getIds(demandList, InvestDemandEntity::getOwner)), MallUserInfo::getId); | |||
| @@ -119,5 +119,32 @@ | |||
| </foreach> | |||
| </delete> | |||
| <select id="rentRateHistory" resultType="hashmap" parameterType="hashmap"> | |||
| select | |||
| <if test="1 == dateType"> | |||
| DATE_FORMAT(w.create_date,'%Y/%m/%d') xTime | |||
| </if> | |||
| <if test="2 == dateType"> | |||
| DATE_FORMAT(w.create_date,'%Y/%m') xTime | |||
| </if> | |||
| ,count(distinct w.shop_id) xCount | |||
| from wx_merchant_shop w | |||
| where w.is_del=0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and w.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and w.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != shopIds "> | |||
| and w.shop_id in | |||
| <foreach collection="shopIds" index="index" item="shopIdItem" open="(" separator="," close=")"> | |||
| #{shopIdItem} | |||
| </foreach> | |||
| </if> | |||
| group by xTime | |||
| order by xTime | |||
| </select> | |||
| </mapper> | |||
| @@ -536,6 +536,17 @@ | |||
| </foreach> | |||
| </if> | |||
| </select> | |||
| <select id="getUsedRentShopIds" parameterType="com.iformall.domain.po.WxRentContract" resultType="Long"> | |||
| SELECT distinct shop_id FROM wx_rent_contract WHERE status in(1,2,3,4,8) | |||
| and rent_shop_type=2 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| </select> | |||
| </mapper> | |||
| @@ -158,12 +158,10 @@ | |||
| <select id="selectBatchByIds" resultMap="BaseResultMap"> | |||
| select | |||
| s.`id`,s.`tenant_id`,s.`parent_tenant_id`,s.`shop_number`,s.`build_area`,s.`operation_area`,s.building,b.building_name building_name,s.floor,f.floor_name floor_name,s.`status`,s.`x`,s.`y`,s.`sid`,s.`addr`, | |||
| s.`id`,s.`tenant_id`,s.`parent_tenant_id`,s.`shop_number`,s.`build_area`,s.`operation_area`,s.building,s.floor,s.`status`,s.`x`,s.`y`,s.`sid`,s.`addr`, | |||
| s.`baidu_poi`,s.`longitude`,s.`latitude`,s.`create_date`,s.`update_date`,s.`img_url`,s.`manager`,s.`manager_phone`, | |||
| s.`type`,s.`point_type`,s.`comments`,s.`is_del`,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit,s.business_id | |||
| from wx_shop s | |||
| left join wx_mall_building b on s.building=b.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| where s.is_del=0 | |||
| <if test=" null != ids "> | |||
| and s.id in | |||
| @@ -175,17 +173,11 @@ | |||
| <select id="findListMap" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap"> | |||
| select s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,CONVERT(s.build_area,DECIMAL(10,2)) buildArea, | |||
| s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea, | |||
| s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId, | |||
| m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone, | |||
| s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,rent,rent_unit,s.business_id as | |||
| businessId,s.create_date create_date | |||
| s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea,s.status,s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay, | |||
| s.business_id as businessId,s.create_date create_date,s.rent,s.rent_unit,s.building as buildingId,s.floor as floorId,s.manager,s.manager_phone managerPhone | |||
| 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_mall_building b on s.building=b.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| where s.is_del=0 | |||
| where s.is_del=0 | |||
| <if test=" null != type "> | |||
| and s.`type` = #{type} | |||
| @@ -280,19 +272,15 @@ | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </select> | |||
| <select id="notRentListMapAsPage" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap"> | |||
| select s.id as id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,s.build_area buildArea, | |||
| s.img_url imgUrl,s.operation_area operationArea, | |||
| s.status,b.building_name building,f.floor_name floor,s.manager,s.manager_phone managerPhone, | |||
| s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.create_date as createDate | |||
| s.img_url imgUrl,s.operation_area operationArea,s.status,s.manager,s.manager_phone managerPhone,s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay, | |||
| s.create_date as createDate,s.building as buildingId,s.floor as floorId | |||
| from wx_shop s | |||
| left join wx_mall_building b on s.building=b.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| where s.is_del=0 | |||
| <if test=" null != id "> | |||
| and s.`id` = #{id} | |||
| </if> | |||
| @@ -322,65 +310,15 @@ | |||
| <if test="null == sortColumn"> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </if> | |||
| </select> | |||
| <resultMap id="VoResultMap" type="com.iformall.domain.vo.WxShopVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId"/> | |||
| <result column="shop_number" jdbcType="VARCHAR" property="shopNumber"/> | |||
| <result column="build_area" jdbcType="VARCHAR" property="buildArea"/> | |||
| <result column="operation_area" jdbcType="VARCHAR" property="operationArea"/> | |||
| <result column="building" jdbcType="BIGINT" property="building"/> | |||
| <result column="floor" jdbcType="BIGINT" property="floor"/> | |||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||
| <result column="x" jdbcType="DECIMAL" property="x"/> | |||
| <result column="y" jdbcType="DECIMAL" property="y"/> | |||
| <result column="sid" jdbcType="VARCHAR" property="sid"/> | |||
| <result column="addr" jdbcType="VARCHAR" property="addr"/> | |||
| <result column="baidu_poi" jdbcType="VARCHAR" property="baiduPoi"/> | |||
| <result column="longitude" jdbcType="DECIMAL" property="longitude"/> | |||
| <result column="latitude" jdbcType="DECIMAL" property="latitude"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/> | |||
| <result column="manager" jdbcType="VARCHAR" property="manager"/> | |||
| <result column="manager_phone" jdbcType="VARCHAR" property="managerPhone"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="point_type" jdbcType="INTEGER" property="pointType"/> | |||
| <result column="comments" jdbcType="VARCHAR" property="comments"/> | |||
| <result column="building_name" jdbcType="VARCHAR" property="buildingName"/> | |||
| <result column="floor_name" jdbcType="VARCHAR" property="floorName"/> | |||
| <result column="merchantId" jdbcType="VARCHAR" property="merchantId"/> | |||
| <result column="merchantName" jdbcType="VARCHAR" property="merchantName"/> | |||
| <result column="link_phone" jdbcType="VARCHAR" property="linkPhone"/> | |||
| <result column="link_person" jdbcType="VARCHAR" property="linkPerson"/> | |||
| <result column="business" jdbcType="VARCHAR" property="business"/> | |||
| <result column="brandName" jdbcType="VARCHAR" property="brandName"/> | |||
| </resultMap> | |||
| <select id="findListWithMerchantMap" parameterType="com.iformall.domain.vo.WxShopVo" resultMap="VoResultMap"> | |||
| <select id="findListWithMerchantMap" parameterType="com.iformall.domain.vo.WxShopVo" resultMap="BaseResultMap"> | |||
| select | |||
| s.id as | |||
| id,s.shop_number,s.build_area,s.img_url,s.operation_area,s.status,s.manager,s.manager_phone,s.addr,s.type,s.point_type, | |||
| b.building_name,f.floor_name, | |||
| m.id merchantId,m.name merchantName,m.link_person,m.link_phone, | |||
| brand.name brandName, | |||
| bus.title business,s.create_date as create_date | |||
| 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_mall_building b on s.building=b.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| left join wx_business bus on m.business_id = bus.id | |||
| left join wx_brand brand on m.brand = brand.id | |||
| where s.is_del=0 | |||
| s.id as id,s.shop_number,s.build_area,s.img_url,s.operation_area,s.status,s.manager,s.manager_phone,s.addr,s.type,s.point_type, | |||
| s.create_date,s.building,s.floor | |||
| from wx_shop s | |||
| where s.is_del=0 | |||
| <if test=" null != id "> | |||
| and s.`id` = #{id} | |||
| @@ -477,9 +415,6 @@ | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </select> | |||
| <select id="getShopList" resultType="hashmap" parameterType="hashmap"> | |||
| @@ -494,19 +429,10 @@ | |||
| </select> | |||
| <select id="getMerchantShopByShopId" resultType="hashmap" parameterType="hashmap"> | |||
| select m.`name` merchantName,s.build_area buildArea,s.operation_area operationArea, | |||
| c.price,c.receive_period receivePeriod,s.shop_number shopNumber,m.link_person linkPerson, | |||
| m.link_phone linkPhone | |||
| from wx_merchant_shop ms inner join wx_merchant m on ms.merchant_id=m.id | |||
| inner join wx_shop s on ms.shop_id=s.id | |||
| inner join wx_rent_contract c on ms.merchant_id=c.merchant_id | |||
| where ms.shop_id=#{shopId} and ms.is_del=0 and s.is_del=0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and ms.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and ms.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| select | |||
| s.id,s.build_area buildArea,s.operation_area operationArea,s.shop_number shopNumber | |||
| from wx_shop s | |||
| where s.id = #{id} and s.is_del=0 | |||
| </select> | |||
| <select id="queryShopLeftInfo" resultType="hashmap" parameterType="hashmap"> | |||
| @@ -521,16 +447,11 @@ | |||
| </select> | |||
| <select id="listShopFromContract" parameterType="com.iformall.domain.po.WxShop" resultType="hashmap"> | |||
| select s.id id,s.shop_number shopNumber,s.build_area buildArea, | |||
| s.img_url imgUrl,s.operation_area operationArea, | |||
| s.status,b.building_name building,f.floor_name floor,m.`name` merchantName,m.id merchantId, | |||
| m.link_person linkPerson,m.link_phone linkPhone,s.manager,s.manager_phone managerPhone, | |||
| m.brand,m.business_id businessId,m.shop_type shopType,s.create_date create_date | |||
| from wx_shop s left join wx_merchant_shop ms on ms.shop_id=s.id | |||
| left join wx_merchant m on ms.merchant_id=m.id | |||
| left join wx_mall_building b on s.building=b.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| where s.is_del=0 and ms.is_del=0 | |||
| select s.id id,s.shop_number shopNumber,s.build_area buildArea,s.building as buildingId,s.floor as floorId, | |||
| s.img_url imgUrl,s.operation_area operationArea,s.manager,s.manager_phone managerPhone,s.status,s.create_date | |||
| from wx_shop s | |||
| where s.is_del=0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and s.`tenant_id` = #{tenantId} | |||
| </if> | |||
| @@ -540,16 +461,11 @@ | |||
| <if test=" null != status"> | |||
| and s.`status` = #{status} | |||
| </if> | |||
| <if test="null!=status and status==1 and type!=null and type==2"> | |||
| <if test="null != notInIdList and null!=status and status==1 and type!=null and type==2"> | |||
| and s.id not in( | |||
| SELECT shop_id FROM wx_rent_contract WHERE status in(1,2,3,4,8) | |||
| and rent_shop_type=2 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <foreach collection="notInIdList" index="index" item="notInIdItem" open="(" separator="," close=")"> | |||
| #{notInIdItem} | |||
| </foreach> | |||
| ) | |||
| </if> | |||
| <if test=" null != type "> | |||
| @@ -577,7 +493,7 @@ | |||
| <select id="hasShopNumber" parameterType="com.iformall.domain.po.WxShop" resultType="Integer"> | |||
| select count(*) from wx_shop where shop_number=#{shopNumber} and `type`=#{type} | |||
| select count(1) from wx_shop where shop_number=#{shopNumber} and `type`=#{type} | |||
| and is_del=0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| @@ -591,7 +507,7 @@ | |||
| </select> | |||
| <select id="hasShopSid" parameterType="com.iformall.domain.po.WxShop" resultType="Integer"> | |||
| select count(*) from wx_shop where sid=#{sid} | |||
| select count(1) from wx_shop where sid=#{sid} | |||
| and is_del=0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| @@ -640,36 +556,6 @@ | |||
| </if> | |||
| </select> | |||
| <select id="rentRateHistory" resultType="hashmap" parameterType="hashmap"> | |||
| select | |||
| <if test="1 == dateType"> | |||
| DATE_FORMAT(w.create_date,'%Y/%m/%d') xTime | |||
| </if> | |||
| <if test="2 == dateType"> | |||
| DATE_FORMAT(w.create_date,'%Y/%m') xTime | |||
| </if> | |||
| ,count(distinct w.shop_id) xCount | |||
| from wx_merchant_shop w left join wx_shop s on w.shop_id=s.id | |||
| where w.is_del=0 and s.is_del=0 | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and w.`tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and w.`parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test="building!=null"> | |||
| and s.building=#{building} | |||
| </if> | |||
| <if test="floor!=null"> | |||
| and s.floor=#{floor} | |||
| </if> | |||
| <if test="businessId!=null and businessId!=0"> | |||
| and s.business_id=#{businessId} | |||
| </if> | |||
| group by xTime | |||
| order by xTime | |||
| </select> | |||
| <update id="updateUnRentByIds" parameterType="Long"> | |||
| update wx_shop set status = 0 | |||
| where id in | |||
| @@ -681,14 +567,10 @@ | |||
| <select id="detailById" parameterType="Long" resultType="hashmap"> | |||
| select s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber,CONVERT(s.build_area,DECIMAL(10,2)) buildArea, | |||
| s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea, | |||
| s.status,b.building_name building,f.floor_name floor,s.manager,s.manager_phone managerPhone, | |||
| s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,rent,rent_unit,s.business_id as | |||
| businessId,bu.title businessName,s.create_date create_date | |||
| from wx_shop s | |||
| left join wx_mall_building b on s.building=b.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| left join wx_business bu on s.business_id = bu.id | |||
| where s.`id` = #{id} | |||
| s.status,s.manager,s.manager_phone managerPhone, | |||
| s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit,s.business_id as businessId,s.create_date, | |||
| s.building as buildingId,s.floor as floorId | |||
| from wx_shop s where s.`id` = #{id} | |||
| </select> | |||
| @@ -697,14 +579,10 @@ | |||
| s.id id, s.tenant_id tenantId, s.parent_tenant_id parentTenantId, s.shop_number shopNumber, | |||
| CONVERT(s.build_area,DECIMAL(10,2)) buildArea, | |||
| s.img_url imgUrl,CONVERT(s.operation_area,DECIMAL(10,2)) operationArea, | |||
| s.status,b.building_name building,f.floor_name floor,s.manager,s.manager_phone managerPhone, | |||
| s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,rent,rent_unit, | |||
| s.business_id as businessId,bu.title businessName,s.create_date create_date | |||
| from wx_shop s | |||
| left join wx_mall_building b on s.building=b.id | |||
| left join wx_mall_floor f on s.floor=f.id | |||
| left join wx_business bu on s.business_id = bu.id | |||
| where s.`is_del` = 0 and s.`sid` = #{sid} | |||
| s.status,s.manager,s.manager_phone managerPhone,s.type,s.point_type pointType,s.addr,DATEDIFF(now(),s.create_date) freeDay,s.rent,s.rent_unit, | |||
| s.business_id as businessId,s.create_date,s.building as buildingId,s.floor as floorId | |||
| from wx_shop s where s.`is_del` = 0 and s.`sid` = #{sid} | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and s.`tenant_id` = #{tenantId} | |||
| </if> | |||