Преглед на файлове

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

release_toaliyun_real
xhxu преди 5 години
родител
ревизия
d6b857f049
променени са 4 файла, в които са добавени 42 реда и са изтрити 30 реда
  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 Целия файл

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




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




+ 26
- 27
mallinkService/src/main/java/com/iformall/service/impl/WxMerchantServiceImpl.java Целия файл

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


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

wxMerchant.setStatus(EnumMerchantStatus.NOT_VALID.getCode());
wxMerchantMapper.updateById(wxMerchant);
//是否有租赁合同 //是否有租赁合同
WxRentContract wxRentContract = new WxRentContract(); WxRentContract wxRentContract = new WxRentContract();
wxRentContract.setMerchantId(id); wxRentContract.setMerchantId(id);
@@ -270,6 +267,8 @@ public class WxMerchantServiceImpl implements WxMerchantService {
c.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count(); c.getStatus().equals(EnumRentContractStatus.CONTRACT_END_SOON.getCode())).count();
//解绑商铺-没有租赁合同或物业合同才可以 //解绑商铺-没有租赁合同或物业合同才可以
if (countRentContract == 0 || countPropertyContract == 0) { if (countRentContract == 0 || countPropertyContract == 0) {
wxMerchant.setStatus(EnumMerchantStatus.NOT_VALID.getCode());
wxMerchantMapper.updateById(wxMerchant);
WxMerchantShop wxMerchantShopQuery = new WxMerchantShop(); WxMerchantShop wxMerchantShopQuery = new WxMerchantShop();
wxMerchantShopQuery.updateTenantInfo(wxMerchant); wxMerchantShopQuery.updateTenantInfo(wxMerchant);
wxMerchantShopQuery.setMerchantId(wxMerchant.getId()); wxMerchantShopQuery.setMerchantId(wxMerchant.getId());
@@ -285,30 +284,30 @@ public class WxMerchantServiceImpl implements WxMerchantService {
wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode()); wxShop.setStatus(EnumShopStatus.NOT_RENT.getCode());
wxShopMapper.updateById(wxShop); 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}) @Transactional(rollbackFor = {Exception.class})


+ 1
- 1
mallinkService/src/main/java/com/iformall/service/impl/WxRentContractServiceImpl.java Целия файл

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


+ 13
- 0
mallinkService/src/main/resources/mapper/WxMerchantMapper.xml Целия файл

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

Зареждане…
Отказ
Запис