Przeglądaj źródła

Merge branch 'release_toaliyun_real' of https://git.malls.iformall.com/server/formallProject into release_toaliyun_real

release_toaliyun_real
xhxu 5 lat temu
rodzic
commit
d6b857f049
4 zmienionych plików z 42 dodań i 30 usunięć
  1. +2
    -2
      mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java
  2. +26
    -27
      mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java
  3. +1
    -1
      mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java
  4. +13
    -0
      mallinkService/src/main/resources/mapper/WxMerchantMapper.xml

+ 2
- 2
mallinkSchedule/src/main/java/com/iformall/schedule/ContractSchedule.java Wyświetl plik

@@ -34,9 +34,9 @@ public class ContractSchedule {


/**
* 2小时执行一次
* 凌晨5分
*/
@Scheduled(cron = "0 */1 * * * ?")
@Scheduled(cron = "0 5 0 * * ?")
public void sendMsg() {
logger.info("合同状态更新开始");



+ 26
- 27
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Wyświetl plik

@@ -247,13 +247,10 @@ public class WxMerchantServiceImpl implements WxMerchantService {
return;
}

if(!wxMerchant.getCarVendorType().equals(EnumCarVendor.CAR_NOTFOUND.getCode())){
if (!wxMerchant.getCarVendorType().equals(EnumCarVendor.CAR_NOTFOUND.getCode())) {
logger.info("不能停用停车商户");
return;
}

wxMerchant.setStatus(EnumMerchantStatus.NOT_VALID.getCode());
wxMerchantMapper.updateById(wxMerchant);
//是否有租赁合同
WxRentContract wxRentContract = new WxRentContract();
wxRentContract.setMerchantId(id);
@@ -270,6 +267,8 @@ public class WxMerchantServiceImpl implements WxMerchantService {
c.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
//解绑商铺-没有租赁合同或物业合同才可以
if (countRentContract == 0 || countPropertyContract == 0) {
wxMerchant.setStatus(EnumMerchantStatus.NOT_VALID.getCode());
wxMerchantMapper.updateById(wxMerchant);
WxMerchantShop wxMerchantShopQuery = new WxMerchantShop();
wxMerchantShopQuery.updateTenantInfo(wxMerchant);
wxMerchantShopQuery.setMerchantId(wxMerchant.getId());
@@ -285,30 +284,30 @@ public class WxMerchantServiceImpl implements WxMerchantService {
wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode());
wxShopMapper.updateById(wxShop);
}
//解绑用户
WxMerchantBUser bUser = new WxMerchantBUser();
bUser.setMerchantId(wxMerchant.getId());
List<WxMerchantBUser> wxMerchantBUserMapperList = wxMerchantBUserMapper.findList(bUser);
for (WxMerchantBUser wxMerchantBUser : wxMerchantBUserMapperList) {
wxMerchantBUser.setStatus(EnumMerchantBUserStatus.INVALID.getCode());
wxMerchantBUserMapper.updateById(wxMerchantBUser);
}
//作废卡券
WxCouponMerchant wxCouponMerchant = new WxCouponMerchant();
wxCouponMerchant.updateTenantInfo(wxMerchant);
wxCouponMerchant.setMerchantId(wxMerchant.getId());
wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode());
List<WxCouponMerchant> wxCouponMerchantList = wxCouponMerchantMapper.findList(wxCouponMerchant);
List<Long> couponIds = wxCouponMerchantList.stream().map(cm -> cm.getProductId()).collect(Collectors.toList());

couponIds.stream().filter(cid -> !isCouponMerchantValid(cid)).forEach(cid -> {
WxCoupon wxCoupon = new WxCoupon();
wxCoupon.setId(cid);
wxCoupon.updateTenantInfo(wxMerchant);
wxCoupon.setStatus(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode());
wxCouponService.saveOrUpdate(wxCoupon);
});
}
//解绑用户
WxMerchantBUser bUser = new WxMerchantBUser();
bUser.setMerchantId(wxMerchant.getId());
List<WxMerchantBUser> wxMerchantBUserMapperList = wxMerchantBUserMapper.findList(bUser);
for (WxMerchantBUser wxMerchantBUser : wxMerchantBUserMapperList) {
wxMerchantBUser.setStatus(EnumMerchantBUserStatus.INVALID.getCode());
wxMerchantBUserMapper.updateById(wxMerchantBUser);
}
//作废卡券
WxCouponMerchant wxCouponMerchant = new WxCouponMerchant();
wxCouponMerchant.updateTenantInfo(wxMerchant);
wxCouponMerchant.setMerchantId(wxMerchant.getId());
wxCouponMerchant.setStatus(EnumCouponMerchantStatus.COUPON_MERCHANT_STATUS_VALID.getCode());
List<WxCouponMerchant> wxCouponMerchantList = wxCouponMerchantMapper.findList(wxCouponMerchant);
List<Long> couponIds = wxCouponMerchantList.stream().map(cm->cm.getProductId()).collect(Collectors.toList());

couponIds.stream().filter(cid->!isCouponMerchantValid(cid)).forEach(cid->{
WxCoupon wxCoupon = new WxCoupon();
wxCoupon.setId(cid);
wxCoupon.updateTenantInfo(wxMerchant);
wxCoupon.setStatus(EnumCouponStatus.COUPON_STATUS_TAKE_OFFF.getCode());
wxCouponService.saveOrUpdate(wxCoupon);
});
}

@Transactional(rollbackFor = {Exception.class})


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Wyświetl plik

@@ -1637,7 +1637,7 @@ public class WxRentContractServiceImpl implements WxRentContractService {
WxMerchant merchant = wxMerchantMapper.selectById((Long) merchantId);
Integer status = merchant.getStatus();
if (status.equals(EnumMerchantStatus.VALID.getCode())) {
wxMerchantService.disable((Long) merchantId);
//wxMerchantService.disable((Long) merchantId);
}
}
}


+ 13
- 0
mallinkService/src/main/resources/mapper/WxMerchantMapper.xml Wyświetl plik

@@ -214,6 +214,9 @@
<if test=" null != status ">
and `status` = #{status}
</if>
<if test=" null != type ">
and `type` = #{type}
</if>
order by create_date desc
</select>
@@ -585,5 +588,15 @@
</select>


<select id="getMerchantList" parameterType="com.iformall.domain.po.WxMerchant" resultMap="BaseResultMap">
select * from wx_merchant where 1=1 and is_del=0 and status=1
<if test=" null != tenantId and '' != tenantId">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != parentTenantId and '' != parentTenantId">
and `parent_tenant_id` = #{parentTenantId}
</if>
order by create_date desc
</select>

</mapper>

Ładowanie…
Anuluj
Zapisz