diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java b/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java index ad768f539..878e050c0 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxShop.java @@ -1,5 +1,7 @@ package com.iformall.domain.po; +import cn.afterturn.easypoi.excel.annotation.Excel; + import javax.persistence.Id; import javax.persistence.Table; import javax.persistence.Transient; @@ -52,14 +54,22 @@ public class WxShop implements Serializable { /*租户ID**/ @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") private String tenantId; + + @io.swagger.annotations.ApiModelProperty(value = "点位类型", name = "pointType") + @Excel(name="类型",width = 20,orderNum = "1", + replace = {"商铺_null", "固定点位_1", "临时促销点位_2", "宣传点位_3","ATM点位_4","仓库点位_5","其他点位_6"}) + private Integer pointType; /*商铺编号**/ @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") + @Excel(name="商铺号/多径点位号",width = 20,orderNum = "2") private String shopNumber; /*建筑面积**/ @io.swagger.annotations.ApiModelProperty(value="建筑面积",name="buildArea") + @Excel(name="建筑面积(㎡)",width = 20,orderNum = "5") private String buildArea; /*经营面积**/ @io.swagger.annotations.ApiModelProperty(value="经营面积",name="operationArea") + @Excel(name="计租面积(㎡)",width = 20,orderNum = "6") private String operationArea; /*楼座号**/ @io.swagger.annotations.ApiModelProperty(value="楼座号",name="building") @@ -69,6 +79,7 @@ public class WxShop implements Serializable { private Long floor; /*状态(0:未出租, 1:已出租)**/ @io.swagger.annotations.ApiModelProperty(value="状态(0:未出租, 1:已出租)",name="status") + @Excel(name="租赁状态",width = 20,orderNum = "7",replace = {"未出租_0","已出租_1"}) private Integer status; /*店铺相对位置x**/ @io.swagger.annotations.ApiModelProperty(value="店铺相对位置x",name="x") @@ -107,8 +118,7 @@ public class WxShop implements Serializable { @io.swagger.annotations.ApiModelProperty(value = "类型", name = "type") private Integer type; - @io.swagger.annotations.ApiModelProperty(value = "点位类型", name = "pointType") - private Integer pointType; + @io.swagger.annotations.ApiModelProperty(value = "备注", name = "comments") private String comments; diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxShopVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxShopVo.java new file mode 100644 index 000000000..50648cdac --- /dev/null +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxShopVo.java @@ -0,0 +1,111 @@ +package com.iformall.domain.vo; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.iformall.domain.po.WxShop; + + +public class WxShopVo extends WxShop { + private static final long serialVersionUID = 6687964942922444531L; + + + @io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName") + @Excel(name="楼座",width = 20,orderNum = "3") + private String buildingName; + /**楼层号**/ + @io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName") + @Excel(name="楼层",width = 20,orderNum = "4") + private String floorName; + + + @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") + private Long merchantId; + + @Excel(name="租赁商户",width = 20,orderNum = "8") + @io.swagger.annotations.ApiModelProperty(value="商户名",name="merchantName") + private String merchantName; + + /*联系方式**/ + @io.swagger.annotations.ApiModelProperty(value="联系方式",name="linkPhone") + @Excel(name="负责人电话",width = 20,orderNum = "12") + private String linkPhone; + + @io.swagger.annotations.ApiModelProperty(value="联系人",name="linkPerson") + @Excel(name="负责人",width = 20,orderNum = "11") + private String linkPerson; + + @io.swagger.annotations.ApiModelProperty(value="品牌",name="brandName") + @Excel(name="品牌",width = 20,orderNum = "10") + private String brandName; + + @io.swagger.annotations.ApiModelProperty(value="经营业态",name="business") + @Excel(name="经营业态",width = 20,orderNum = "9") + private String business; + + public String getBuildingName() { + return buildingName; + } + + public void setBuildingName(String buildingName) { + this.buildingName = buildingName; + } + + public String getFloorName() { + return floorName; + } + + public void setFloorName(String floorName) { + this.floorName = floorName; + } + + public Long getMerchantId() { + return merchantId; + } + + public void setMerchantId(Long merchantId) { + this.merchantId = merchantId; + } + + public String getMerchantName() { + return merchantName; + } + + public void setMerchantName(String merchantName) { + this.merchantName = merchantName; + } + + @Override + public String getLinkPhone() { + return linkPhone; + } + + @Override + public void setLinkPhone(String linkPhone) { + this.linkPhone = linkPhone; + } + + @Override + public String getLinkPerson() { + return linkPerson; + } + + @Override + public void setLinkPerson(String linkPerson) { + this.linkPerson = linkPerson; + } + + public String getBrandName() { + return brandName; + } + + public void setBrandName(String brandName) { + this.brandName = brandName; + } + + public String getBusiness() { + return business; + } + + public void setBusiness(String business) { + this.business = business; + } +} diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java index 630277d27..833f2368a 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxShopMapper.java @@ -2,6 +2,7 @@ package com.iformall.mapper; import com.iformall.common.CommonMapper; import com.iformall.domain.po.WxShop; +import com.iformall.domain.vo.WxShopVo; import java.util.List; import java.util.Map; @@ -26,5 +27,5 @@ public interface WxShopMapper extends CommonMapper { int hasShopNumber(WxShop wxShop); - List> findListWithMerchantMap(WxShop record); + List findListWithMerchantMap(WxShop record); } diff --git a/mallinkService/src/main/java/com/iformall/service/ExcelService.java b/mallinkService/src/main/java/com/iformall/service/ExcelService.java index bf2c5df9b..21563014c 100644 --- a/mallinkService/src/main/java/com/iformall/service/ExcelService.java +++ b/mallinkService/src/main/java/com/iformall/service/ExcelService.java @@ -58,7 +58,7 @@ public class ExcelService { { Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF); if (workbook != null); - downLoadExcel(fileName, response, workbook); + downLoadExcel(fileName, response, workbook); } private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java index 969bbb883..29c6ac051 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java @@ -8,10 +8,12 @@ import com.iformall.common.Result; import com.iformall.common.ResultData; import com.iformall.domain.po.WxMerchantShop; import com.iformall.domain.po.WxShop; +import com.iformall.domain.vo.WxShopVo; import com.iformall.enums.*; import com.iformall.exception.MallinkException; import com.iformall.mapper.WxMerchantShopMapper; import com.iformall.mapper.WxShopMapper; +import com.iformall.service.ExcelService; import com.iformall.service.WxShopService; import com.iformall.utils.Constant; import com.iformall.utils.DownFileUtil; @@ -41,6 +43,9 @@ public class WxShopServiceImpl implements WxShopService { @Autowired WxMerchantShopMapper wxMerchantShopMapper; + @Autowired + ExcelService excelService; + @Override public PageInfo listAsPage(WxShop record, Integer pageIndex, Integer pageSize) { return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxShopMapper.findList(record)); @@ -132,6 +137,13 @@ public class WxShopServiceImpl implements WxShopService { return pageInfo; } + public void exportShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response) { + List list = wxShopMapper.findListWithMerchantMap(wxShop); + String name = EnumRentShopType.SHOP.getCode().equals(wxShop.getType())?"店铺列表":"多经点位列表"; + excelService.exportExcel(list,null, name, WxShopVo.class,name+".xls",response); + } + +/* @Override public void exportShop(WxShop wxShop, HttpServletRequest request, HttpServletResponse response) { List> shopList = wxShopMapper.findListWithMerchantMap(wxShop); @@ -258,6 +270,6 @@ public class WxShopServiceImpl implements WxShopService { e.printStackTrace(); } } - +*/ } diff --git a/mallinkService/src/main/resources/mapper/WxShopMapper.xml b/mallinkService/src/main/resources/mapper/WxShopMapper.xml index f8ab09396..eb7e550b6 100644 --- a/mallinkService/src/main/resources/mapper/WxShopMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxShopMapper.xml @@ -148,6 +148,7 @@ + - + select + s.id,s.shop_number,s.build_area,s.img_url,s.operation_area,s.status,s.manager,s.manager_phone,s.addr,s.email,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 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