Browse Source

fix wxshop

release_toaliyun_real
winter 4 years ago
parent
commit
c7833221f7
5 changed files with 27 additions and 10 deletions
  1. +4
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxShop.java
  2. +2
    -0
      mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java
  3. +6
    -0
      mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java
  4. +11
    -0
      mallinkService/src/main/resources/mapper/WxRentContractMapper.xml
  5. +4
    -9
      mallinkService/src/main/resources/mapper/WxShopMapper.xml

+ 4
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxShop.java View File

@@ -12,6 +12,7 @@ import lombok.ToString;


import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;


@TableName(value = "wx_shop") @TableName(value = "wx_shop")
@Data @Data
@@ -20,7 +21,9 @@ import java.util.Date;
public class WxShop extends TenantEntity { public class WxShop extends TenantEntity {


protected Long id; protected Long id;

@TableField(exist = false)
private List<Long> notInIdList;


@TableField(exist = false) @TableField(exist = false)
private Long rentContractId; private Long rentContractId;


+ 2
- 0
mallinkService/src/main/java/com/iformall/mapper/WxRentContractMapper.java View File

@@ -59,4 +59,6 @@ public interface WxRentContractMapper extends CommonMapper<WxRentContract, Long>


List<Map<String, Object>> currentValidByMerchantId(WxRentContract rentContract); List<Map<String, Object>> currentValidByMerchantId(WxRentContract rentContract);
List<Long> getUsedRentShopIds(WxRentContract wxRentContract);
} }

+ 6
- 0
mallinkService/src/main/java/com/iformall/service/impl/WxShopServiceImpl.java View File

@@ -475,6 +475,12 @@ public class WxShopServiceImpl implements WxShopService {
@Override @Override
public PageInfo<Map<String, Object>> listShopFromContract(WxShop wxShop, Integer pageIndex, Integer pageSize) { public PageInfo<Map<String, Object>> listShopFromContract(WxShop wxShop, Integer pageIndex, Integer pageSize) {
PageHelper.startPage(pageIndex, 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); List<Map<String,Object>> shops = wxShopMapper.listShopFromContract(wxShop);
if (null != shops) { if (null != shops) {
Map<Long, String> floorMap = this.getFloorMap(wxShop); Map<Long, String> floorMap = this.getFloorMap(wxShop);


+ 11
- 0
mallinkService/src/main/resources/mapper/WxRentContractMapper.xml View File

@@ -536,6 +536,17 @@
</foreach> </foreach>
</if> </if>
</select> </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> </mapper>



+ 4
- 9
mallinkService/src/main/resources/mapper/WxShopMapper.xml View File

@@ -461,16 +461,11 @@
<if test=" null != status"> <if test=" null != status">
and s.`status` = #{status} and s.`status` = #{status}
</if> </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( 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>
<if test=" null != type "> <if test=" null != type ">


Loading…
Cancel
Save